From f05f9df81368169cdc21d1eb53f5562dffd937df Mon Sep 17 00:00:00 2001 From: Grey Jones Date: Sat, 4 Jul 2026 22:17:51 +0100 Subject: [PATCH] fix errors on `nixos-rebuild` --- flake.nix | 7 +++++-- global-default.nix | 5 ++++- global-home.nix | 8 +++----- hosts/nixos-vm/default.nix | 10 ++++------ hosts/nixos-vm/home.nix | 6 +++--- 5 files changed, 19 insertions(+), 17 deletions(-) diff --git a/flake.nix b/flake.nix index e405505..65141e5 100644 --- a/flake.nix +++ b/flake.nix @@ -36,7 +36,7 @@ outputs = {self,nixpkgs,home-manager,plasma-manager,...}@inputs: { nixosConfigurations = builtins.listToAttrs (map (name: { - name = name; + inherit name; value = nixpkgs.lib.nixosSystem { modules = [ ./hosts/${name} @@ -47,14 +47,17 @@ users.grey = ./hosts/${name}/home.nix; extraSpecialArgs = { inherit inputs; + hostname = name; + stateVersion = "26.05"; }; }; } ]; specialArgs = { inherit inputs; - inherit name; + hostname = name; system = "x86-64-linux"; + stateVersion = "26.05"; }; }; }) ["takamaki" "kitagawa" "nixos-vm"]); diff --git a/global-default.nix b/global-default.nix index dee7b3b..542165a 100644 --- a/global-default.nix +++ b/global-default.nix @@ -1,8 +1,11 @@ { config, pkgs, + specialArgs, ... }: { + networking.hostName = specialArgs.hostname; # Define your hostname. + nix.settings.experimental-features = [ "nix-command" "flakes" @@ -68,5 +71,5 @@ # this value at the release version of the first install of this system. # Before changing this value read the documentation for this option # (e.g. man configuration.nix or on https://nixos.org/nixos/options.html). - system.stateVersion = "26.05"; # Did you read the comment? + system.stateVersion = specialArgs.stateVersion; # Did you read the comment? } \ No newline at end of file diff --git a/global-home.nix b/global-home.nix index 1884b7d..bac1c1e 100644 --- a/global-home.nix +++ b/global-home.nix @@ -1,12 +1,10 @@ { config, pkgs, + specialArgs, ... }: { - home.username = "grey"; - home.homeDirectory = "/home/grey"; - - home.stateVersion = system.stateVersion; + home.stateVersion = specialArgs.stateVersion; programs.git = { enable = true; @@ -44,7 +42,7 @@ Port = 22; User = "git"; IdentityFile = "~/.ssh/id_github"; - } + }; }; }; diff --git a/hosts/nixos-vm/default.nix b/hosts/nixos-vm/default.nix index b645979..8e592b7 100644 --- a/hosts/nixos-vm/default.nix +++ b/hosts/nixos-vm/default.nix @@ -7,18 +7,16 @@ pkgs, ... }: let -name = "nixos-vm"; modules-dir = ../../modules; in { imports = [ - ./hardware-configuration.nix ../../global-default.nix - ${modules-dir}/nh.nix - ${modules-dir}/plasma-desktop.nix - ${modules-dir}/home-manager.nix + ./hardware-configuration.nix + "${modules-dir}/nh.nix" + "${modules-dir}/plasma-desktop.nix" + "${modules-dir}/home-manager.nix" ]; - networking.hostName = name; # Define your hostname. # networking.wireless.enable = true; # Enables wireless support via wpa_supplicant. # Configure network proxy if necessary diff --git a/hosts/nixos-vm/home.nix b/hosts/nixos-vm/home.nix index e863337..fa63961 100644 --- a/hosts/nixos-vm/home.nix +++ b/hosts/nixos-vm/home.nix @@ -9,9 +9,9 @@ global-configs-dir = ../../global-configs; in { imports = [ ../../global-home.nix - ${global-configs-dir}/plasma.nix - ${global-configs-dir}/fastfetch.nix - ${global-configs-dir}/zen-browser.nix + "${global-configs-dir}/plasma.nix" + "${global-configs-dir}/fastfetch.nix" + "${global-configs-dir}/zen-browser.nix" ]; home.packages = with pkgs; [