diff --git a/flake.lock b/flake.lock new file mode 100644 index 000000000..2cbdfea9a --- /dev/null +++ b/flake.lock @@ -0,0 +1,497 @@ +{ + "nodes": { + "aquamarine": { + "inputs": { + "hyprutils": [ + "hyprland", + "hyprutils" + ], + "hyprwayland-scanner": [ + "hyprland", + "hyprwayland-scanner" + ], + "nixpkgs": [ + "hyprland", + "nixpkgs" + ], + "systems": [ + "hyprland", + "systems" + ] + }, + "locked": { + "lastModified": 1753216019, + "narHash": "sha256-zik7WISrR1ks2l6T1MZqZHb/OqroHdJnSnAehkE0kCk=", + "owner": "hyprwm", + "repo": "aquamarine", + "rev": "be166e11d86ba4186db93e10c54a141058bdce49", + "type": "github" + }, + "original": { + "owner": "hyprwm", + "repo": "aquamarine", + "type": "github" + } + }, + "flake-compat": { + "flake": false, + "locked": { + "lastModified": 1696426674, + "narHash": "sha256-kvjfFW7WAETZlt09AgDn1MrtKzP7t90Vf7vypd3OL1U=", + "owner": "edolstra", + "repo": "flake-compat", + "rev": "0f9255e01c2351cc7d116c072cb317785dd33b33", + "type": "github" + }, + "original": { + "owner": "edolstra", + "repo": "flake-compat", + "type": "github" + } + }, + "gitignore": { + "inputs": { + "nixpkgs": [ + "hyprland", + "pre-commit-hooks", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1709087332, + "narHash": "sha256-HG2cCnktfHsKV0s4XW83gU3F57gaTljL9KNSuG6bnQs=", + "owner": "hercules-ci", + "repo": "gitignore.nix", + "rev": "637db329424fd7e46cf4185293b9cc8c88c95394", + "type": "github" + }, + "original": { + "owner": "hercules-ci", + "repo": "gitignore.nix", + "type": "github" + } + }, + "hyprcursor": { + "inputs": { + "hyprlang": [ + "hyprland", + "hyprlang" + ], + "nixpkgs": [ + "hyprland", + "nixpkgs" + ], + "systems": [ + "hyprland", + "systems" + ] + }, + "locked": { + "lastModified": 1753964049, + "narHash": "sha256-lIqabfBY7z/OANxHoPeIrDJrFyYy9jAM4GQLzZ2feCM=", + "owner": "hyprwm", + "repo": "hyprcursor", + "rev": "44e91d467bdad8dcf8bbd2ac7cf49972540980a5", + "type": "github" + }, + "original": { + "owner": "hyprwm", + "repo": "hyprcursor", + "type": "github" + } + }, + "hyprgraphics": { + "inputs": { + "hyprutils": [ + "hyprland", + "hyprutils" + ], + "nixpkgs": [ + "hyprland", + "nixpkgs" + ], + "systems": [ + "hyprland", + "systems" + ] + }, + "locked": { + "lastModified": 1752149140, + "narHash": "sha256-gbh1HL98Fdqu0jJIWN4OJQN7Kkth7+rbkFpSZLm/62A=", + "owner": "hyprwm", + "repo": "hyprgraphics", + "rev": "340494a38b5ec453dfc542c6226481f736cc8a9a", + "type": "github" + }, + "original": { + "owner": "hyprwm", + "repo": "hyprgraphics", + "type": "github" + } + }, + "hyprland": { + "inputs": { + "aquamarine": "aquamarine", + "hyprcursor": "hyprcursor", + "hyprgraphics": "hyprgraphics", + "hyprland-protocols": "hyprland-protocols", + "hyprland-qtutils": "hyprland-qtutils", + "hyprlang": "hyprlang", + "hyprutils": "hyprutils", + "hyprwayland-scanner": "hyprwayland-scanner", + "nixpkgs": [ + "nixpkgs" + ], + "pre-commit-hooks": "pre-commit-hooks", + "systems": "systems", + "xdph": "xdph" + }, + "locked": { + "lastModified": 1754662442, + "narHash": "sha256-+nJzzAL+YcU17uuQyfv9KqVIwitbjPf+ZS5P3Qw3E1c=", + "owner": "hyprwm", + "repo": "Hyprland", + "rev": "00da4450db9bab1abfda169eefec8dab98f63a0b", + "type": "github" + }, + "original": { + "owner": "hyprwm", + "repo": "Hyprland", + "type": "github" + } + }, + "hyprland-protocols": { + "inputs": { + "nixpkgs": [ + "hyprland", + "nixpkgs" + ], + "systems": [ + "hyprland", + "systems" + ] + }, + "locked": { + "lastModified": 1749046714, + "narHash": "sha256-kymV5FMnddYGI+UjwIw8ceDjdeg7ToDVjbHCvUlhn14=", + "owner": "hyprwm", + "repo": "hyprland-protocols", + "rev": "613878cb6f459c5e323aaafe1e6f388ac8a36330", + "type": "github" + }, + "original": { + "owner": "hyprwm", + "repo": "hyprland-protocols", + "type": "github" + } + }, + "hyprland-qt-support": { + "inputs": { + "hyprlang": [ + "hyprland", + "hyprland-qtutils", + "hyprlang" + ], + "nixpkgs": [ + "hyprland", + "hyprland-qtutils", + "nixpkgs" + ], + "systems": [ + "hyprland", + "hyprland-qtutils", + "systems" + ] + }, + "locked": { + "lastModified": 1749154592, + "narHash": "sha256-DO7z5CeT/ddSGDEnK9mAXm1qlGL47L3VAHLlLXoCjhE=", + "owner": "hyprwm", + "repo": "hyprland-qt-support", + "rev": "4c8053c3c888138a30c3a6c45c2e45f5484f2074", + "type": "github" + }, + "original": { + "owner": "hyprwm", + "repo": "hyprland-qt-support", + "type": "github" + } + }, + "hyprland-qtutils": { + "inputs": { + "hyprland-qt-support": "hyprland-qt-support", + "hyprlang": [ + "hyprland", + "hyprlang" + ], + "hyprutils": [ + "hyprland", + "hyprland-qtutils", + "hyprlang", + "hyprutils" + ], + "nixpkgs": [ + "hyprland", + "nixpkgs" + ], + "systems": [ + "hyprland", + "systems" + ] + }, + "locked": { + "lastModified": 1753819801, + "narHash": "sha256-tHe6XeNeVeKapkNM3tcjW4RuD+tB2iwwoogWJOtsqTI=", + "owner": "hyprwm", + "repo": "hyprland-qtutils", + "rev": "b308a818b9dcaa7ab8ccab891c1b84ebde2152bc", + "type": "github" + }, + "original": { + "owner": "hyprwm", + "repo": "hyprland-qtutils", + "type": "github" + } + }, + "hyprlang": { + "inputs": { + "hyprutils": [ + "hyprland", + "hyprutils" + ], + "nixpkgs": [ + "hyprland", + "nixpkgs" + ], + "systems": [ + "hyprland", + "systems" + ] + }, + "locked": { + "lastModified": 1753622892, + "narHash": "sha256-0K+A+gmOI8IklSg5It1nyRNv0kCNL51duwnhUO/B8JA=", + "owner": "hyprwm", + "repo": "hyprlang", + "rev": "23f0debd2003f17bd65f851cd3f930cff8a8c809", + "type": "github" + }, + "original": { + "owner": "hyprwm", + "repo": "hyprlang", + "type": "github" + } + }, + "hyprutils": { + "inputs": { + "nixpkgs": [ + "hyprland", + "nixpkgs" + ], + "systems": [ + "hyprland", + "systems" + ] + }, + "locked": { + "lastModified": 1753800567, + "narHash": "sha256-W0xgXsaqGa/5/7IBzKNhf0+23MqGPymYYfqT7ECqeTE=", + "owner": "hyprwm", + "repo": "hyprutils", + "rev": "c65d41d4f4e6ded6fdb9d508a73e2fe90e55cdf7", + "type": "github" + }, + "original": { + "owner": "hyprwm", + "repo": "hyprutils", + "type": "github" + } + }, + "hyprwayland-scanner": { + "inputs": { + "nixpkgs": [ + "hyprland", + "nixpkgs" + ], + "systems": [ + "hyprland", + "systems" + ] + }, + "locked": { + "lastModified": 1751897909, + "narHash": "sha256-FnhBENxihITZldThvbO7883PdXC/2dzW4eiNvtoV5Ao=", + "owner": "hyprwm", + "repo": "hyprwayland-scanner", + "rev": "fcca0c61f988a9d092cbb33e906775014c61579d", + "type": "github" + }, + "original": { + "owner": "hyprwm", + "repo": "hyprwayland-scanner", + "type": "github" + } + }, + "matugen": { + "inputs": { + "nixpkgs": [ + "nixpkgs" + ], + "systems": "systems_2" + }, + "locked": { + "lastModified": 1745334376, + "narHash": "sha256-GZAesQW51EwCEB9w5caxgi87LiAMhVfP6GqZmet9VZc=", + "owner": "InioX", + "repo": "Matugen", + "rev": "4619cca93513470dc2a1833d9a138297cbccaf2e", + "type": "github" + }, + "original": { + "owner": "InioX", + "repo": "Matugen", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1754498491, + "narHash": "sha256-erbiH2agUTD0Z30xcVSFcDHzkRvkRXOQ3lb887bcVrs=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "c2ae88e026f9525daf89587f3cbee584b92b6134", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "pre-commit-hooks": { + "inputs": { + "flake-compat": "flake-compat", + "gitignore": "gitignore", + "nixpkgs": [ + "hyprland", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1750779888, + "narHash": "sha256-wibppH3g/E2lxU43ZQHC5yA/7kIKLGxVEnsnVK1BtRg=", + "owner": "cachix", + "repo": "git-hooks.nix", + "rev": "16ec914f6fb6f599ce988427d9d94efddf25fe6d", + "type": "github" + }, + "original": { + "owner": "cachix", + "repo": "git-hooks.nix", + "type": "github" + } + }, + "quickshell": { + "inputs": { + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1753595452, + "narHash": "sha256-vqkSDvh7hWhPvNjMjEDV4KbSCv2jyl2Arh73ZXe274k=", + "ref": "refs/heads/master", + "rev": "a5431dd02dc23d9ef1680e67777fed00fe5f7cda", + "revCount": 665, + "type": "git", + "url": "https://git.outfoxxed.me/outfoxxed/quickshell" + }, + "original": { + "type": "git", + "url": "https://git.outfoxxed.me/outfoxxed/quickshell" + } + }, + "root": { + "inputs": { + "hyprland": "hyprland", + "matugen": "matugen", + "nixpkgs": "nixpkgs", + "quickshell": "quickshell" + } + }, + "systems": { + "locked": { + "lastModified": 1689347949, + "narHash": "sha256-12tWmuL2zgBgZkdoB6qXZsgJEH9LR3oUgpaQq2RbI80=", + "owner": "nix-systems", + "repo": "default-linux", + "rev": "31732fcf5e8fea42e59c2488ad31a0e651500f68", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default-linux", + "type": "github" + } + }, + "systems_2": { + "locked": { + "lastModified": 1689347949, + "narHash": "sha256-12tWmuL2zgBgZkdoB6qXZsgJEH9LR3oUgpaQq2RbI80=", + "owner": "nix-systems", + "repo": "default-linux", + "rev": "31732fcf5e8fea42e59c2488ad31a0e651500f68", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default-linux", + "type": "github" + } + }, + "xdph": { + "inputs": { + "hyprland-protocols": [ + "hyprland", + "hyprland-protocols" + ], + "hyprlang": [ + "hyprland", + "hyprlang" + ], + "hyprutils": [ + "hyprland", + "hyprutils" + ], + "hyprwayland-scanner": [ + "hyprland", + "hyprwayland-scanner" + ], + "nixpkgs": [ + "hyprland", + "nixpkgs" + ], + "systems": [ + "hyprland", + "systems" + ] + }, + "locked": { + "lastModified": 1753633878, + "narHash": "sha256-js2sLRtsOUA/aT10OCDaTjO80yplqwOIaLUqEe0nMx0=", + "owner": "hyprwm", + "repo": "xdg-desktop-portal-hyprland", + "rev": "371b96bd11ad2006ed4f21229dbd1be69bed3e8a", + "type": "github" + }, + "original": { + "owner": "hyprwm", + "repo": "xdg-desktop-portal-hyprland", + "type": "github" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix index de2758024..1ccb94eca 100644 --- a/flake.nix +++ b/flake.nix @@ -8,17 +8,26 @@ url = "github:hyprwm/Hyprland"; inputs.nixpkgs.follows = "nixpkgs"; }; + quickshell = { + url = "git+https://git.outfoxxed.me/outfoxxed/quickshell"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + matugen = { + url = "github:/InioX/Matugen"; + inputs.nixpkgs.follows = "nixpkgs"; + # ref = "refs/tags/matugen-v0.10.0"; + }; }; outputs = { self, nixpkgs, + hyprland, + quickshell, + matugen, + ... }: let - # A list of supported systems. We are restricting this to x86_64-linux. - supportedSystems = ["x86_64-linux"]; - - # A helper function to apply a function to each supported system. - # This ensures that all outputs are only built for x86_64-linux. + supportedSystems = ["x86_64-linux" "aarch64-darwin"]; eachSupportedSystem = f: nixpkgs.lib.genAttrs supportedSystems (system: let pkgs = import nixpkgs { @@ -27,19 +36,32 @@ in f pkgs); in { - # This output defines the NixOS modules. - # It points to the `./modules` directory, which would contain your system configuration. nixosModules = rec { default = illogical-impulse; illogical-impulse = ./nix/modules; }; - # The legacyPackages output is required for some Nix commands to work. - # We set it to the standard nixpkgs set for our supported system. - legacyPackages = eachSupportedSystem (pkgs: pkgs); + legacyPackages = eachSupportedSystem (pkgs: { + iiShellConfig = pkgs.stdenv.mkDerivation { + pname = "ii-shell-config"; + version = "1.0"; + src = ./.; + installPhase = '' + runHook preInstall + + install -d -m 755 $out/.config + cp -r .config/quickshell $out/.config/ + + runHook postInstall + ''; + dontPatchShebangs = true; + }; + }); + devShells = eachSupportedSystem (pkgs: { - default = pkgs.mkShell { + default = pkgs.mkShellNoCC { packages = [ + self.legacyPackages.${pkgs.system}.iiShellConfig ]; }; }); diff --git a/nix/modules/desktop/default.nix b/nix/modules/desktop/default.nix new file mode 100644 index 000000000..60ec95804 --- /dev/null +++ b/nix/modules/desktop/default.nix @@ -0,0 +1,5 @@ +{ + imports = [ + ./desktop.nix + ]; +} diff --git a/nix/modules/desktop/desktop.nix b/nix/modules/desktop/desktop.nix new file mode 100644 index 000000000..fcb82ae44 --- /dev/null +++ b/nix/modules/desktop/desktop.nix @@ -0,0 +1,43 @@ +{ + config, + lib, + inputs, + pkgs, + ... +}: let + inherit + (lib) + mkIf + mkMerge + mkDefault + mkOption + types + ; + cfg = config.illogical-impulse.desktop; +in { + options = { + illogical-impulse.desktop = { + enable = mkOption { + type = types.bool; + default = true; + description = '' + Enables Hyprland and quickshell. + ''; + }; + }; + }; + config = mkIf cfg.enable { + programs.hyprland = { + enable = true; + package = inputs.hyprland.packages.${pkgs.stdenv.hostPlatform.system}.hyprland; + portalPackage = inputs.hyprland.packages.${pkgs.stdenv.hostPlatform.system}.xdg-desktop-portal-hyprland; + }; + environment.systemPackages = [ + inputs.quickshell.packages.${pkgs.system}.default + inputs.matugen.packages.${pkgs.system}.default + ]; + environment.etc."skel/.config/quickshell" = { + source = "../../../.config/quickshell"; + }; + }; +} diff --git a/nix/modules/terminal/default.nix b/nix/modules/terminal/default.nix new file mode 100644 index 000000000..5de7028f0 --- /dev/null +++ b/nix/modules/terminal/default.nix @@ -0,0 +1,5 @@ +{ + imports = [ + ./terminal.nix + ]; +} diff --git a/nix/modules/terminal/terminal.nix b/nix/modules/terminal/terminal.nix new file mode 100644 index 000000000..1c4418593 --- /dev/null +++ b/nix/modules/terminal/terminal.nix @@ -0,0 +1,50 @@ +{ + config, + lib, + ... +}: let + inherit + (lib) + mkIf + mkMerge + mkDefault + mkOption + types + ; + cfg = config.illogical-impulse.terminal; +in { + options = { + illogical-impulse.terminal = { + enable = mkOption { + type = types.bool; + default = true; + description = '' + Whether to enable the terminal-related configuration for this user. + ''; + }; + + # New option to choose the terminal emulator. + terminalEmulator = mkOption { + type = types.enum ["foot" "kitty"]; + default = "foot"; + description = '' + The default terminal emulator to enable for this user. + ''; + }; + }; + }; + + config = mkIf cfg.enable (mkMerge [ + (mkIf (cfg.terminalEmulator == "foot") { + programs.foot = { + enable = true; + }; + }) + + (mkIf (cfg.terminalEmulator == "kitty") { + programs.kitty = { + enable = true; + }; + }) + ]); +} diff --git a/result b/result new file mode 120000 index 000000000..658cb65ad --- /dev/null +++ b/result @@ -0,0 +1 @@ +/nix/store/87n00rqvz62aha1q9xgn8w3gnhibq8xn-ii-shell-config-1.0 \ No newline at end of file