From 8cbc0e30a804a83e45c6831b8ba0588b7be6220b Mon Sep 17 00:00:00 2001 From: Michael Thomson Date: Tue, 17 Feb 2026 10:01:22 -0500 Subject: [PATCH] update --- flake.lock | 26 +++++-- flake.nix | 98 +++++++++++++++---------- hosts/desktop/configuration.nix | 21 +----- hosts/macbook/configuration.nix | 32 +------- hosts/macbook/home.nix | 7 -- hosts/thinkpad/configuration.nix | 35 +-------- hosts/wsl/configuration.nix | 15 +--- modules/common/common.nix | 24 ++++++ modules/home-manager/kitty.nix | 2 +- modules/home-manager/neovim/default.nix | 2 + modules/nixos/neovim.nix | 5 -- 11 files changed, 110 insertions(+), 157 deletions(-) create mode 100644 modules/common/common.nix delete mode 100644 modules/nixos/neovim.nix diff --git a/flake.lock b/flake.lock index c953f5b..e44d658 100644 --- a/flake.lock +++ b/flake.lock @@ -61,9 +61,7 @@ "inputs": { "flake-parts": "flake-parts", "neovim-src": "neovim-src", - "nixpkgs": [ - "nixpkgs" - ] + "nixpkgs": "nixpkgs" }, "locked": { "lastModified": 1770249911, @@ -134,7 +132,7 @@ "nixos-wsl": { "inputs": { "flake-compat": "flake-compat", - "nixpkgs": "nixpkgs" + "nixpkgs": "nixpkgs_2" }, "locked": { "lastModified": 1769217863, @@ -152,6 +150,22 @@ } }, "nixpkgs": { + "locked": { + "lastModified": 1770843696, + "narHash": "sha256-LovWTGDwXhkfCOmbgLVA10bvsi/P8eDDpRudgk68HA8=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "2343bbb58f99267223bc2aac4fc9ea301a155a16", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixpkgs-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_2": { "locked": { "lastModified": 1768564909, "narHash": "sha256-Kell/SpJYVkHWMvnhqJz/8DqQg2b6PguxVWOuadbHCc=", @@ -167,7 +181,7 @@ "type": "github" } }, - "nixpkgs_2": { + "nixpkgs_3": { "locked": { "lastModified": 1770115704, "narHash": "sha256-KHFT9UWOF2yRPlAnSXQJh6uVcgNcWlFqqiAZ7OVlHNc=", @@ -190,7 +204,7 @@ "nix-darwin": "nix-darwin", "nixos-hardware": "nixos-hardware", "nixos-wsl": "nixos-wsl", - "nixpkgs": "nixpkgs_2" + "nixpkgs": "nixpkgs_3" } } }, diff --git a/flake.nix b/flake.nix index 2656ad5..ed8d702 100644 --- a/flake.nix +++ b/flake.nix @@ -13,50 +13,70 @@ }; nixos-hardware.url = "github:NixOS/nixos-hardware/master"; nixos-wsl.url = "github:nix-community/NixOS-WSL/main"; - neovim-nightly-overlay = { - url = "github:nix-community/neovim-nightly-overlay"; - inputs.nixpkgs.follows = "nixpkgs"; - }; + neovim-nightly-overlay.url = "github:nix-community/neovim-nightly-overlay"; }; - outputs = inputs @ { - nixpkgs, - nix-darwin, - nixos-wsl, - ... - }: { - nixosConfigurations = { - desktop = nixpkgs.lib.nixosSystem { - system = "x86_64-linux"; - specialArgs = {inherit inputs;}; - modules = [ - ./hosts/desktop/configuration.nix - ]; + outputs = { nixpkgs, home-manager, nix-darwin, nixos-wsl, neovim-nightly-overlay, ... }@inputs: + let + user = "mthomson"; + specialArgs = { inherit inputs user; }; + overlays = [ + neovim-nightly-overlay.overlays.default + ]; + mkHome = host: { + home-manager = { + useGlobalPkgs = true; + useUserPackages = true; + extraSpecialArgs = specialArgs; + users.${user} = import ./hosts/${host}/home.nix; + }; }; - thinkpad = nixpkgs.lib.nixosSystem { - system = "x86_64-linux"; - specialArgs = {inherit inputs;}; - modules = [ - ./hosts/thinkpad/configuration.nix - ]; + in + { + nixosConfigurations = { + desktop = nixpkgs.lib.nixosSystem { + system = "x86_64-linux"; + specialArgs = specialArgs; + modules = [ + ./hosts/desktop/configuration.nix + { nixpkgs.overlays = overlays; } + home-manager.nixosModules.home-manager + (mkHome "desktop") + ]; + }; + thinkpad = nixpkgs.lib.nixosSystem { + system = "x86_64-linux"; + specialArgs = specialArgs; + modules = [ + ./hosts/thinkpad/configuration.nix + { nixpkgs.overlays = overlays; } + home-manager.nixosModules.home-manager + (mkHome "thinkpad") + ]; + }; + wsl = nixpkgs.lib.nixosSystem { + system = "x86_64-linux"; + specialArgs = specialArgs; + modules = [ + nixos-wsl.nixosModules.default + ./hosts/wsl/configuration.nix + { nixpkgs.overlays = overlays; } + home-manager.nixosModules.home-manager + (mkHome "wsl") + ]; + }; }; - wsl = nixpkgs.lib.nixosSystem { - system = "x86_64-linux"; - specialArgs = {inherit inputs;}; - modules = [ - nixos-wsl.nixosModules.default - ./hosts/wsl/configuration.nix - ]; - }; - }; - darwinConfigurations = { - macbook = nix-darwin.lib.darwinSystem { - specialArgs = {inherit inputs;}; - modules = [ - ./hosts/macbook/configuration.nix - ]; + darwinConfigurations = { + macbook = nix-darwin.lib.darwinSystem { + specialArgs = specialArgs; + modules = [ + ./hosts/macbook/configuration.nix + { nixpkgs.overlays = overlays; } + home-manager.darwinModules.home-manager + (mkHome "macbook") + ]; + }; }; }; - }; } diff --git a/hosts/desktop/configuration.nix b/hosts/desktop/configuration.nix index 7f3b620..df2130f 100644 --- a/hosts/desktop/configuration.nix +++ b/hosts/desktop/configuration.nix @@ -6,7 +6,7 @@ }: { imports = [ ./hardware-configuration.nix - inputs.home-manager.nixosModules.default + ../../modules/common/common.nix ../../modules/nixos/bootloader.nix ../../modules/nixos/user.nix ../../modules/nixos/ssh.nix @@ -19,18 +19,8 @@ ../../modules/nixos/docker.nix ]; - boot.kernelPackages = pkgs.linuxPackages_latest; - networking.hostName = "desktop"; - time.timeZone = "America/Toronto"; - - i18n.defaultLocale = "en_CA.UTF-8"; - - nixpkgs.config.allowUnfree = true; - - nix.settings.experimental-features = ["nix-command" "flakes"]; - environment.systemPackages = with pkgs; [ wget git @@ -38,14 +28,5 @@ lsof ]; - home-manager = { - extraSpecialArgs = {inherit inputs;}; - useGlobalPkgs = true; - useUserPackages = true; - users = { - mthomson = import ./home.nix; - }; - }; - system.stateVersion = "23.11"; } diff --git a/hosts/macbook/configuration.nix b/hosts/macbook/configuration.nix index 963a1b4..9b6f647 100644 --- a/hosts/macbook/configuration.nix +++ b/hosts/macbook/configuration.nix @@ -5,56 +5,26 @@ ... }: { imports = [ - inputs.home-manager.darwinModules.default + ../../modules/common/common.nix ../../modules/nix-darwin/system.nix ../../modules/nix-darwin/aerospace.nix - ../../modules/nixos/neovim.nix ]; nixpkgs.hostPlatform = "aarch64-darwin"; - nixpkgs.config.allowUnfree = true; - nixpkgs.config.allowBroken = true; - - nix.nixPath = ["nixpkgs=${inputs.nixpkgs}"]; networking.hostName = "macbook"; system.primaryUser = "mthomson"; - nix.settings = { - trusted-users = ["mthomson"]; - - substituters = [ - "https://cache.nixos.org" - "https://nix-community.cachix.org" - ]; - - trusted-public-keys = [ - "nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs=" - ]; - }; - users.users.mthomson = { home = "/Users/mthomson"; }; - nix.settings.experimental-features = ["nix-command" "flakes"]; - environment.systemPackages = with pkgs; [ man-pages man-pages-posix ]; - home-manager = { - extraSpecialArgs = {inherit inputs;}; - useGlobalPkgs = true; - useUserPackages = true; - backupFileExtension = "backup"; - users = { - mthomson = import ./home.nix; - }; - }; - system.stateVersion = 5; # fix for this: https://github.com/LnL7/nix-darwin/issues/1346 diff --git a/hosts/macbook/home.nix b/hosts/macbook/home.nix index 46e57f1..7a782d8 100644 --- a/hosts/macbook/home.nix +++ b/hosts/macbook/home.nix @@ -30,13 +30,6 @@ home.packages = with pkgs; [ hidden-bar - presenterm - (azure-cli.withExtensions [ - azure-cli.extensions.containerapp - ]) - nh - todo-txt-cli - age ]; programs.home-manager.enable = true; diff --git a/hosts/thinkpad/configuration.nix b/hosts/thinkpad/configuration.nix index 1c12b24..0e3914c 100644 --- a/hosts/thinkpad/configuration.nix +++ b/hosts/thinkpad/configuration.nix @@ -1,6 +1,3 @@ -# Edit this configuration file to define what should be installed on -# your system. Help is available in the configuration.nix(5) man page -# and in the NixOS manual (accessible by running ‘nixos-help’). { config, pkgs, @@ -8,15 +5,13 @@ ... }: { imports = [ - # Include the results of the hardware scan. ./hardware-configuration.nix - inputs.home-manager.nixosModules.default inputs.nixos-hardware.nixosModules.lenovo-thinkpad-t480 + ../../modules/common/common.nix ../../modules/nixos/bootloader.nix ../../modules/nixos/user.nix ../../modules/nixos/ssh.nix ../../modules/nixos/bluetooth.nix - #../../modules/nixos/sway.nix ../../modules/nixos/i3.nix ../../modules/nixos/nm.nix ../../modules/nixos/sound.nix @@ -27,27 +22,8 @@ networking.hostName = "thinkpad"; - nix.settings = { - trusted-users = ["mthomson"]; - - substituters = [ - "https://cache.nixos.org" - "https://nix-community.cachix.org" - ]; - - trusted-public-keys = [ - "nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs=" - ]; - }; - - time.timeZone = "America/Toronto"; - i18n.defaultLocale = "en_CA.UTF-8"; - nixpkgs.config.allowUnfree = true; - - nix.settings.experimental-features = ["nix-command" "flakes"]; - environment.systemPackages = with pkgs; [ wget git @@ -55,14 +31,5 @@ lsof ]; - home-manager = { - extraSpecialArgs = {inherit inputs;}; - useGlobalPkgs = true; - useUserPackages = true; - users = { - mthomson = import ./home.nix; - }; - }; - system.stateVersion = "23.11"; } diff --git a/hosts/wsl/configuration.nix b/hosts/wsl/configuration.nix index 1f3aa9a..543e026 100644 --- a/hosts/wsl/configuration.nix +++ b/hosts/wsl/configuration.nix @@ -11,7 +11,7 @@ ... }: { imports = [ - inputs.home-manager.nixosModules.default + ../../modules/common/common.nix ../../modules/nixos/user.nix ../../modules/nixos/postgres.nix ../../modules/nixos/podman.nix @@ -37,20 +37,7 @@ dconf ]; - nixpkgs.config.allowUnfree = true; - - nix.settings.experimental-features = ["nix-command" "flakes"]; - programs.nix-ld.enable = true; - home-manager = { - extraSpecialArgs = {inherit inputs;}; - useGlobalPkgs = true; - useUserPackages = true; - users = { - mthomson = import ./home.nix; - }; - }; - system.stateVersion = "24.11"; } diff --git a/modules/common/common.nix b/modules/common/common.nix new file mode 100644 index 0000000..5f2e1a9 --- /dev/null +++ b/modules/common/common.nix @@ -0,0 +1,24 @@ +{ + lib, + ... +}: { + nixpkgs.config.allowUnfree = true; + + time.timeZone = "America/Toronto"; + + nix.settings = { + trusted-users = ["mthomson"]; + + experimental-features = ["nix-command" "flakes"]; + + substituters = [ + "https://cache.nixos.org" + "https://nix-community.cachix.org" + ]; + + trusted-public-keys = [ + "nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs=" + ]; + }; + +} diff --git a/modules/home-manager/kitty.nix b/modules/home-manager/kitty.nix index 8868460..77c6e51 100644 --- a/modules/home-manager/kitty.nix +++ b/modules/home-manager/kitty.nix @@ -17,7 +17,7 @@ shellIntegration = { enableZshIntegration = true; }; - themeFile = "Modus_Operandi"; + themeFile = "Modus_Vivendi"; # darwinLaunchOptions = [ # "--single-instance" # ]; diff --git a/modules/home-manager/neovim/default.nix b/modules/home-manager/neovim/default.nix index 825bb9a..a10c011 100644 --- a/modules/home-manager/neovim/default.nix +++ b/modules/home-manager/neovim/default.nix @@ -8,6 +8,8 @@ ]; home.packages = with pkgs; [ + neovim + #utilities ripgrep zk diff --git a/modules/nixos/neovim.nix b/modules/nixos/neovim.nix deleted file mode 100644 index efe04a3..0000000 --- a/modules/nixos/neovim.nix +++ /dev/null @@ -1,5 +0,0 @@ -{pkgs, inputs, ...}: { - environment.systemPackages = [ - inputs.neovim-nightly-overlay.packages.${pkgs.system}.default - ]; -}