factor out hostnames

This commit is contained in:
Sean Buckley 2022-06-15 23:20:48 -04:00
parent 004d2b1263
commit 6f3ab9c4bf
6 changed files with 14 additions and 23 deletions

View file

@ -1,9 +1,5 @@
{ config, lib, pkgs, ... }: { config, lib, pkgs, ... }:
{ {
networking.hostName = "cube";
# imports = [ ./monitors.nix ];
virtualisation.libvirtd.enable = true; virtualisation.libvirtd.enable = true;
environment.systemPackages = with pkgs; [ environment.systemPackages = with pkgs; [
virt-manager virt-manager

View file

@ -1,17 +1,20 @@
nixpkgs: hardware: nixosModule: nixpkgs: hardware: nixosModule:
with hardware; with hardware;
let builtins.mapAttrs
sys = system: mods: nixpkgs.lib.nixosSystem {
inherit system; (name: { system, mods }: nixpkgs.lib.nixosSystem {
modules = [ nixosModule ] ++ mods; inherit system;
}; modules = mods ++ [
nixosModule
{ networking.hostName = name; }
];
})
in
{ {
cube = sys "x86_64-linux" [ physical ./cube ]; cube = { system = "x86_64-linux"; mods = [ physical ./cube ]; };
hp = sys "x86_64-linux" [ physical ./hp ]; hp = { system = "x86_64-linux"; mods = [ physical ./hp ]; };
lenny = sys "x86_64-linux" [ physical ./lenny ]; lenny = { system = "x86_64-linux"; mods = [ physical ./lenny ]; };
nixdev = sys "x86_64-linux" [ qemu ./nixdev ]; nixdev = { system = "x86_64-linux"; mods = [ qemu ./nixdev ]; };
slate = sys "x86_64-linux" [ physical ./slate ]; slate = { system = "x86_64-linux"; mods = [ physical ./slate ]; };
} }

View file

@ -1,7 +1,5 @@
{ config, lib, pkgs, ... }: { config, lib, pkgs, ... }:
{ {
networking.hostName = "hp";
services = { services = {
openssh.enable = true; openssh.enable = true;
}; };

View file

@ -1,7 +1,5 @@
{ config, lib, pkgs, ... }: { config, lib, pkgs, ... }:
{ {
networking.hostName = "lenny";
services = { services = {
openssh.enable = true; openssh.enable = true;
}; };

View file

@ -1,7 +1,5 @@
{ config, lib, pkgs, ... }: { config, lib, pkgs, ... }:
{ {
networking.hostName = "nixdev";
sconfig = { sconfig = {
gnome = true; gnome = true;
profile = "desktop"; profile = "desktop";

View file

@ -1,7 +1,5 @@
{ pkgs, ... }: { pkgs, ... }:
{ {
networking.hostName = "slate";
sconfig = { sconfig = {
profile = "desktop"; profile = "desktop";
gnome = true; gnome = true;