split configs

This commit is contained in:
2026-05-11 22:03:23 -05:00
parent 5f569c1a32
commit 2d23b501f0
2 changed files with 55 additions and 28 deletions
+4 -3
View File
@@ -2,6 +2,7 @@
config, config,
lib, lib,
pkgs, pkgs,
meta,
... ...
}: }:
@@ -56,8 +57,8 @@
}; };
}; };
networking.hostName = "roy-laptop"; networking.hostName = meta.hostname;
networking.hostId = "4cb9fc76"; networking.hostId = meta.hostId;
networking = { networking = {
useDHCP = true; useDHCP = true;
@@ -116,7 +117,7 @@
users.mutableUsers = false; users.mutableUsers = false;
users.users.roy = { users.users.roy = {
isNormalUser = true; isNormalUser = true;
hashedPassword = "$y$j9T$4yOAv6R7Xtn23XmhSSC8g.$T1CckfWgxjEyZshjBzcaMO9WidP.q..OG7LwtXFTw12"; hashedPassword = meta.hashedPass;
extraGroups = [ extraGroups = [
"wheel" "wheel"
"networkmanager" "networkmanager"
+51 -25
View File
@@ -37,32 +37,58 @@
sops-nix, sops-nix,
firefox-addons, firefox-addons,
}@inputs: }@inputs:
# Place all config differences between laptop/desktop here
# If they grow sufficiently different, maybe split them out completely
let
platforms = [
{
name = "roy-laptop";
hostId = "4cb9fc76";
hashedPass = "$y$j9T$4yOAv6R7Xtn23XmhSSC8g.$T1CckfWgxjEyZshjBzcaMO9WidP.q..OG7LwtXFTw12";
}
{
name = "roy-desktop";
hostId = "67cf9bc4";
hashedPass = "$y$j9T$4yOAv6R7Xtn23XmhSSC8g.$T1CckfWgxjEyZshjBzcaMO9WidP.q..OG7LwtXFTw12";
}
];
in
{ {
nixosConfigurations.default = nixpkgs.lib.nixosSystem { nixosConfigurations = builtins.listToAttrs (
system = "x86_64-linux"; map (platform: {
modules = [ name = platform.name;
./configuration.nix value = nixpkgs.lib.nixosSystem {
./hardware-configuration.nix specialArgs.meta = {
./disk-config.nix hostname = platform.name;
disko.nixosModules.disko hostId = platform.hostId;
impermanence.nixosModules.impermanence hashedPass = platform.hashedPass;
sops-nix.nixosModules.sops };
home-manager.nixosModules.home-manager system = "x86_64-linux";
{ modules = [
home-manager.useGlobalPkgs = true; ./configuration.nix
home-manager.useUserPackages = true; ./hardware-configuration.nix
home-manager.extraSpecialArgs = { inherit inputs; }; ./disk-config.nix
home-manager.users.roy = disko.nixosModules.disko
{ ... }: impermanence.nixosModules.impermanence
sops-nix.nixosModules.sops
home-manager.nixosModules.home-manager
{ {
imports = [ home-manager.useGlobalPkgs = true;
./home.nix home-manager.useUserPackages = true;
nixvim.homeModules.nixvim home-manager.extraSpecialArgs = { inherit inputs; };
sops-nix.homeManagerModules.sops home-manager.users.roy =
]; { ... }:
}; {
} imports = [
]; ./home.nix
}; nixvim.homeModules.nixvim
sops-nix.homeManagerModules.sops
];
};
}
];
};
}) platforms
);
}; };
} }