diff --git a/flake.lock b/flake.lock index 59ae112..1aebfba 100644 --- a/flake.lock +++ b/flake.lock @@ -61,11 +61,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1661700591, - "narHash": "sha256-NZa+z+TJC+Hk+87+LKkjFFmBn4GyMVEPcWFXFU+aTkU=", + "lastModified": 1662874738, + "narHash": "sha256-kG29aU9f5UTWhPf/QEh5LanDmqqbbcErWYAcPptC/Cg=", "owner": "nixos", "repo": "nixpkgs", - "rev": "16236dd7e33ba4579ccd3ca8349396b2f9c960fe", + "rev": "dd1f4d982445a7d1b1869baa42f8f0f9bc606714", "type": "github" }, "original": { diff --git a/flake.nix b/flake.nix index 2fff083..d146399 100644 --- a/flake.nix +++ b/flake.nix @@ -28,36 +28,37 @@ in (rec { lib = { mkHome = { - profile, - extraModules ? [], + profiles, system, username ? "samw", }: - inputs.home-manager.lib.homeManagerConfiguration rec { + inputs.home-manager.lib.homeManagerConfiguration { inherit username system; stateVersion = "21.11"; homeDirectory = if (inputs.nixpkgs.lib.systems.elaborate system).isDarwin then "/Users/${username}" else "/home/${username}"; - configuration = {...} @ args: ((profile args) // {nixpkgs.overlays = overlays;}); - extraSpecialArgs = {inherit system;}; - inherit extraModules; + # In home-manager 22.11 configuration/extraModules go away and are replaced + # by a single "modules". So let's get ready for that. + configuration = {...}: {}; + extraSpecialArgs = { inherit system; }; + extraModules = profiles ++ [{ nixpkgs.overlays = overlays; }]; }; }; - profiles = import ./home/profiles.nix; # Standalone home-manager configurations - homeConfigurations = { + homeConfigurations = let + profiles = import ./home/profiles.nix; + in { boron = lib.mkHome { system = "aarch64-darwin"; - profile = profiles.laptop; + profiles = with profiles; [ default dev sensitive mac docker aws ]; username = "samuel.willcocks"; - extraModules = [./home/docker.nix ./home/aws.nix]; }; zinc = lib.mkHome { system = "aarch64-darwin"; - profile = profiles.laptop; + profiles = with profiles; [ default dev sensitive mac ]; }; }; } diff --git a/home/default.nix b/home/default.nix index a1a5c2c..e48cbcd 100644 --- a/home/default.nix +++ b/home/default.nix @@ -15,7 +15,7 @@ in { enable = true; package = pkgs.nix; settings.experimental-features = "nix-command flakes"; - settings.max-jobs = "auto"; # Gotta go fast (build derivations in parallel) + settings.max-jobs = "auto"; # Gotta go fast (build derivations in parallel) }; programs = { home-manager.enable = true; diff --git a/home/profiles.nix b/home/profiles.nix index f44f993..d5da924 100644 --- a/home/profiles.nix +++ b/home/profiles.nix @@ -1,18 +1,23 @@ { + # The basics that you'll want everywhere + default = ./default.nix; + # A machine for development dev = {...}: { - imports = [./default.nix ./git.nix ./rust.nix ./vim.nix ./vim-dev]; + imports = [ ./git.nix ./rust.nix ./vim.nix ./vim-dev ./vscode.nix ]; }; - laptop = {...}: { + # Sensitive stuff + sensitive = {...}: { imports = [ - ./default.nix - ./git.nix - ./macs.nix - ./rust.nix - ./vim.nix - ./vim-dev ./passwords.nix ./gpg.nix ]; }; + # A MacOS machine + mac = ./macs.nix; + # A machine you want to do docker stuff on + docker = ./docker.nix; + # A machine you want to do aws stuff on + aws = ./aws.nix; + # A server server = {...}: {imports = [./default.nix ./git.nix ./vim.nix];}; } diff --git a/home/vscode.nix b/home/vscode.nix new file mode 100644 index 0000000..de22131 --- /dev/null +++ b/home/vscode.nix @@ -0,0 +1,16 @@ +{ pkgs, ... }: +{ + programs.vscode = { + enable = true; + package = pkgs.vscodium; + mutableExtensionsDir = false; + extensions = with pkgs.vscode-extensions; [ + matklad.rust-analyzer + jdinhlife.gruvbox + ]; + userSettings = { + "update.mode" = "none"; + "workbench.colorTheme" = "Gruvbox Dark Hard"; + }; + }; +}