NixConfigs now provide hostname in flake

This commit is contained in:
Chris Toph 2024-09-27 18:36:22 -04:00
parent 3f34bb40d6
commit d861feae5c
2 changed files with 42 additions and 11 deletions

View file

@ -15,43 +15,63 @@
lib = nixpkgs.lib;
in {
nixosConfigurations = {
caenus = lib.nixosSystem {
caenus = let
hostName = "caenus";
default = ./. + "/host/${hostName}";
in lib.nixosSystem {
specialArgs = { inherit hostName; };
system = ARM;
modules = [
./nix
./host/caenus
default
];
};
cloud = lib.nixosSystem {
cloud = let
hostName = "cloud";
default = ./. + "/host/${hostName}";
in lib.nixosSystem {
specialArgs = { inherit hostName; };
system = X86;
modules = [
./nix
./host/cloud
default
];
};
komodo = lib.nixosSystem {
komodo = let
hostName = "komodo";
default = ./. + "/host/${hostName}";
in lib.nixosSystem {
specialArgs = { inherit hostName; };
system = X86;
modules = [
./nix
./host/komodo
default
];
};
nix = lib.nixosSystem {
nix = let
hostName = "nix";
default = ./. + "/host/${hostName}";
in lib.nixosSystem {
specialArgs = { inherit hostName; };
system = X86;
modules = [
./nix
./host/nix
default
];
};
proxy = lib.nixosSystem {
proxy = let
hostName = "proxy";
default = ./. + "/host/${hostName}";
in lib.nixosSystem {
specialArgs = { inherit hostName; };
system = X86;
modules = [
./nix
./host/proxy
default
];
};
};

View file

@ -1,4 +1,4 @@
{ modulesPath, config, pkgs, ... }:
{ modulesPath, config, pkgs, hostName... }:
let
@ -41,7 +41,18 @@ in {
environment.shells = with pkgs; [ bash fish ];
programs.fish.enable = true;
## NETWORKING ##
networking = {
dhcpcd.enable = false;
hostName = hostName;
networkmanager.enable = true;
useDHCP = true;
useHostResolvConf = false;
usePredictableInterfaceNames = true;
};
## NIXOS ##
# forces interfaces to be named predictably
# This value determines the NixOS release with which your system is to be
system.stateVersion = "24.11";
# Enable Flakes