diff --git a/flake.nix b/flake.nix index a0d68b52f18ce5be2bdf38e8e2f647c1a7674073..f5cefbb6b0d0d1286e5058f70863531e6697e378 100644 --- a/flake.nix +++ b/flake.nix @@ -90,14 +90,5 @@ inherit user; darwin = true; }; - # darwinConfigurations = { - # "Natalies-MacBook-Air" = darwin.lib.darwinSystem { - # system = "aarch64-darwin"; - # specialArgs = inputs; - # modules = [ - # ./hosts/laptop/configuration.nix - # ]; - # }; - # }; }; } diff --git a/hosts/desktop/configuration.nix b/hosts/desktop/configuration.nix index cae700795bf273e8876f90699520f042aee9442d..16f9db54a3503f9af47818b3f803a8b5ee372e01 100644 --- a/hosts/desktop/configuration.nix +++ b/hosts/desktop/configuration.nix @@ -9,7 +9,6 @@ # Include the results of the hardware scan. ./hardware-configuration.nix - ../../modules/shared/nix.nix ../../modules/nixos/nvidia.nix ../../modules/nixos/boot.nix ]; diff --git a/hosts/desktop/home.nix b/hosts/desktop/home.nix index 4030f77fea97f33b2cf5c096d758b56a941a9484..24f59ece58ebbc3008cd7d73ed2e3b111a3d853f 100644 --- a/hosts/desktop/home.nix +++ b/hosts/desktop/home.nix @@ -7,7 +7,7 @@ nix-options-search, ... }: let - shared-programs = import ../shared/home-programs.nix {inherit config pkgs lib;}; + shared-programs = import ../shared/home-programs.nix {inherit inputs config pkgs lib;}; in { home = { username = "nmarks"; diff --git a/hosts/laptop/configuration.nix b/hosts/laptop/configuration.nix index 918d5f122b81af9240737dc6d69300a80af82648..c3153c93b57e49cdf46dda38cbe2b4a6a4c86483 100644 --- a/hosts/laptop/configuration.nix +++ b/hosts/laptop/configuration.nix @@ -1,13 +1,11 @@ { + inputs, config, pkgs, lib, ... }: { imports = [ - ../../modules/shared/nix.nix - ../../modules/shared/extras.nix - ./modules/icons.nix ]; diff --git a/hosts/laptop/home.nix b/hosts/laptop/home.nix index 274f72282c86b00f8e1ae19724b9ec795d8dc6fd..9a4950bd67f3d11b9cc8d466678a021b61745565 100644 --- a/hosts/laptop/home.nix +++ b/hosts/laptop/home.nix @@ -1,12 +1,14 @@ { + inputs, config, pkgs, lib, ... }: { - programs = import ../shared/home-programs.nix {inherit config pkgs lib;}; + programs = import ../shared/home-programs.nix {inherit inputs config pkgs lib;}; home = { + homeDirectory = "/Users/nmarks/"; # Home Manager needs a bit of information about you and the paths it should # manage. # This value determines the Home Manager release that your configuration is diff --git a/hosts/shared/home-programs.nix b/hosts/shared/home-programs.nix index 5b913c6d8ba45a20ea36d1baa669f4f1e347f2c6..a03fb3e4ead89313bddb68020c26f72df939666f 100644 --- a/hosts/shared/home-programs.nix +++ b/hosts/shared/home-programs.nix @@ -1,9 +1,11 @@ { + inputs, config, pkgs, lib, ... }: { + nix-index.enable = true; atuin = { enable = true; enableBashIntegration = true; @@ -56,8 +58,6 @@ }; color_align = { mode = "horizontal"; - # custom_colors = []; - # fore_back = null; }; distro = "nixos"; pride_month_shown = [ diff --git a/lib/mkSystem.nix b/lib/mkSystem.nix index 5d1003ddf5885e1d0fd2051008eef46f0183e57d..0bb91cf49d8317b53bedafe2951e6815b0aeace9 100644 --- a/lib/mkSystem.nix +++ b/lib/mkSystem.nix @@ -28,6 +28,7 @@ # The config files for this system. hostConfig = ../hosts/${host}/configuration.nix; + homeConfig = ../hosts/${host}/home.nix; # NixOS vs nix-darwin functions systemFunc = @@ -35,7 +36,7 @@ then inputs.darwin.lib.darwinSystem else nixpkgs.lib.nixosSystem; - home-manager = + hmModules = if darwin then inputs.home-manager.darwinModules else inputs.home-manager.nixosModules; @@ -58,13 +59,15 @@ in hostConfig nixindex - home-manager.home-manager + {programs.nix-index-database.comma.enable = true;} + hmModules.home-manager { home-manager = { useGlobalPkgs = true; useUserPackages = true; backupFileExtension = "hm-backup"; extraSpecialArgs = {inherit inputs;}; + users.${user} = homeConfig; }; } diff --git a/modules/shared/extras.nix b/modules/shared/extras.nix index 27c546f6f20526c4075c357b4958eca934308c62..942054db7b9ed7a96b75e19948b8400afdde5636 100644 --- a/modules/shared/extras.nix +++ b/modules/shared/extras.nix @@ -6,6 +6,4 @@ }: { networking = { }; - - inputs.programs.nix-index-database.comma.enable = true; } diff --git a/modules/shared/nix.nix b/modules/shared/nix.nix index 5e8bbf7dda9cbfcb951e2c8f22dfc67ee3f12a3e..292a9aa4c4a3a227c02849a1993aa846f7a7db4c 100644 --- a/modules/shared/nix.nix +++ b/modules/shared/nix.nix @@ -13,8 +13,11 @@ warn-dirty = false ''; + optimise = { + automatic = true; + }; + settings = { - auto-optimise-store = true; experimental-features = ["nix-command" "flakes"]; substituters = [ "https://cache.nixos.org/?priority=10" @@ -31,8 +34,6 @@ }; gc = { automatic = true; - persistent = true; - dates = "weekly"; options = "--delete-older-than 7d"; }; };