diff --git a/hosts/desktop/configuration.nix b/hosts/desktop/configuration.nix index 9704128..cae7007 100644 --- a/hosts/desktop/configuration.nix +++ b/hosts/desktop/configuration.nix @@ -11,7 +11,7 @@ ../../modules/shared/nix.nix ../../modules/nixos/nvidia.nix - ../../modules/nixos/boot.ni + ../../modules/nixos/boot.nix ]; services.avahi = { enable = true; diff --git a/hosts/laptop/configuration.nix b/hosts/laptop/configuration.nix index ecdfe02..918d5f1 100644 --- a/hosts/laptop/configuration.nix +++ b/hosts/laptop/configuration.nix @@ -5,12 +5,9 @@ ... }: { imports = [ - ../../modules/shared/vars.nix ../../modules/shared/nix.nix ../../modules/shared/extras.nix - ../../modules/shared/modules.nix - ../../modules/shared/home-manager.nix ./modules/icons.nix ]; diff --git a/lib/mkSystem.nix b/lib/mkSystem.nix index 7217ee2..5d1003d 100644 --- a/lib/mkSystem.nix +++ b/lib/mkSystem.nix @@ -10,24 +10,31 @@ darwin ? false, extraModules ? [], }: let - # True if this is a WSL system. - # True if Linux, which is a heuristic for not being Darwin. - mkIfElse = p: yes: no: - nixpkgs.lib.mkMerge [ - (nixpkgs.lib.mkIf p yes) - (nixpkgs.lib.mkIf (!p) no) - ]; + # mkIfElse = p: yes: no: + # nixpkgs.lib.mkMerge [ + # (nixpkgs.lib.mkIf p yes) + # (nixpkgs.lib.mkIf (!p) no) + # ]; + nixindex = + if darwin + then inputs.nix-index-database.darwinModules.nix-index + else inputs.nix-index-database.nixosModules.nix-index; - nixindex = mkIfElse darwin inputs.nix-index-database.darwinModules.nix-index inputs.nix-index-database.nixosModules.nix-index; - - host = mkIfElse darwin "laptop" "desktop"; + host = + if darwin + then "laptop" + else "desktop"; # The config files for this system. hostConfig = ../hosts/${host}/configuration.nix; # NixOS vs nix-darwin functions - systemFunc = mkIfElse darwin inputs.darwin.lib.darwinSystem nixpkgs.lib.nixosSystem; + systemFunc = + if darwin + then inputs.darwin.lib.darwinSystem + else nixpkgs.lib.nixosSystem; + home-manager = if darwin then inputs.home-manager.darwinModules @@ -42,7 +49,13 @@ in # to go through and apply our system type. We do this first so # the overlays are available globally. {nixpkgs.overlays = overlays;} - {inputs.programs.nix-index-database.comma.enable = true;} + + # Enable caching for nix-index so we dont have to rebuild it + + #shared modules + ../modules/shared/nix.nix + ../modules/shared/extras.nix + hostConfig nixindex home-manager.home-manager diff --git a/modules/shared/extras.nix b/modules/shared/extras.nix index 942054d..27c546f 100644 --- a/modules/shared/extras.nix +++ b/modules/shared/extras.nix @@ -6,4 +6,6 @@ }: { networking = { }; + + inputs.programs.nix-index-database.comma.enable = true; }