| ... | ... | @@ -10,24 +10,31 @@ |
| 10 | 10 | darwin ? false, |
| 11 | 11 | extraModules ? [], |
| 12 | 12 | }: let |
| 13 | | # True if this is a WSL system. |
| 14 | | # True if Linux, which is a heuristic for not being Darwin. |
| 15 | | mkIfElse = p: yes: no: |
| 16 | | nixpkgs.lib.mkMerge [ |
| 17 | | (nixpkgs.lib.mkIf p yes) |
| 18 | | (nixpkgs.lib.mkIf (!p) no) |
| 19 | | ]; |
| 20 | | |
| 21 | | nixindex = mkIfElse darwin inputs.nix-index-database.darwinModules.nix-index inputs.nix-index-database.nixosModules.nix-index; |
| 13 | # mkIfElse = p: yes: no: |
| 14 | # nixpkgs.lib.mkMerge [ |
| 15 | # (nixpkgs.lib.mkIf p yes) |
| 16 | # (nixpkgs.lib.mkIf (!p) no) |
| 17 | # ]; |
| 18 | nixindex = |
| 19 | if darwin |
| 20 | then inputs.nix-index-database.darwinModules.nix-index |
| 21 | else inputs.nix-index-database.nixosModules.nix-index; |
| 22 | 22 | |
| 23 | | host = mkIfElse darwin "laptop" "desktop"; |
| 23 | host = |
| 24 | if darwin |
| 25 | then "laptop" |
| 26 | else "desktop"; |
| 24 | 27 | |
| 25 | 28 | # The config files for this system. |
| 26 | 29 | |
| 27 | 30 | hostConfig = ../hosts/${host}/configuration.nix; |
| 28 | 31 | |
| 29 | 32 | # NixOS vs nix-darwin functions |
| 30 | | systemFunc = mkIfElse darwin inputs.darwin.lib.darwinSystem nixpkgs.lib.nixosSystem; |
| 33 | systemFunc = |
| 34 | if darwin |
| 35 | then inputs.darwin.lib.darwinSystem |
| 36 | else nixpkgs.lib.nixosSystem; |
| 37 | |
| 31 | 38 | home-manager = |
| 32 | 39 | if darwin |
| 33 | 40 | then inputs.home-manager.darwinModules |
| ... | ... | @@ -42,7 +49,13 @@ in |
| 42 | 49 | # to go through and apply our system type. We do this first so |
| 43 | 50 | # the overlays are available globally. |
| 44 | 51 | {nixpkgs.overlays = overlays;} |
| 45 | | {inputs.programs.nix-index-database.comma.enable = true;} |
| 52 | |
| 53 | # Enable caching for nix-index so we dont have to rebuild it |
| 54 | |
| 55 | #shared modules |
| 56 | ../modules/shared/nix.nix |
| 57 | ../modules/shared/extras.nix |
| 58 | |
| 46 | 59 | hostConfig |
| 47 | 60 | nixindex |
| 48 | 61 | home-manager.home-manager |