diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..b92e28f --- /dev/null +++ b/flake.nix @@ -0,0 +1,44 @@ +{ + description = "Hyprland test flake with verify-config and normal run"; + + inputs = { + nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; + hyprland.url = "github:hyprwm/Hyprland"; + }; + + outputs = + { + self, + nixpkgs, + hyprland, + ... + }: + let + system = "x86_64-linux"; + pkgs = import nixpkgs { + inherit system; + config.allowUnfree = true; + }; + + hyprPkg = hyprland.packages.${system}.hyprland; + configFile = "${self}/hyprland.lua"; + in + { + apps.${system}.default = { + type = "app"; + program = pkgs.writeShellScript "hyprland-verify" '' + exec ${hyprPkg}/bin/Hyprland --config ${configFile} --verify-config + ''; + }; + + apps.${system}.run = { + type = "app"; + program = pkgs.writeShellScript "hyprland-run" '' + exec ${hyprPkg}/bin/Hyprland --config ${configFile} + ''; + }; + + # Optional: damit `nix build` etwas Sinnvolles baut + packages.${system}.default = hyprPkg; + }; +}