refactor common modules

This commit is contained in:
Sean Buckley 2021-04-09 18:23:21 -04:00
parent 4c1a6c264e
commit 0fb53034fe
5 changed files with 6 additions and 10 deletions

View file

@ -1,10 +1,12 @@
{ unstable, stable2009 }: { unstable, stable2009 }:
let let
commonModules = [ commonModules = name: [
../. (../.)
(./. + "/${name}")
({ ... }: { ({ ... }: {
config = { config = {
networking.hostName = name;
sconfig.flakes.enable = true; sconfig.flakes.enable = true;
sconfig.flakes.rebuildPath = "github:buckley310/nixos-config"; sconfig.flakes.rebuildPath = "github:buckley310/nixos-config";
}; };
@ -13,17 +15,15 @@ let
mkStandardSystem = { name, pkgs }: pkgs.lib.nixosSystem { mkStandardSystem = { name, pkgs }: pkgs.lib.nixosSystem {
system = "x86_64-linux"; system = "x86_64-linux";
modules = commonModules ++ [ modules = (commonModules name) ++ [
pkgs.nixosModules.notDetected pkgs.nixosModules.notDetected
(./. + "/${name}")
]; ];
}; };
mkQemuSystem = { name, pkgs }: pkgs.lib.nixosSystem { mkQemuSystem = { name, pkgs }: pkgs.lib.nixosSystem {
system = "x86_64-linux"; system = "x86_64-linux";
modules = commonModules ++ [ modules = (commonModules name) ++ [
(x: { imports = [ "${x.modulesPath}/profiles/qemu-guest.nix" ]; }) (x: { imports = [ "${x.modulesPath}/profiles/qemu-guest.nix" ]; })
(./. + "/${name}")
]; ];
}; };

View file

@ -12,7 +12,6 @@
}; };
networking = { networking = {
hostName = "hp";
search = [ "bck.me" ]; search = [ "bck.me" ];
}; };

View file

@ -5,7 +5,6 @@
services.tlp.enable = true; services.tlp.enable = true;
services.openssh.enable = true; services.openssh.enable = true;
networking.hostName = "manta";
networking.search = [ "bck.me" ]; networking.search = [ "bck.me" ];
sconfig = { sconfig = {

View file

@ -7,7 +7,6 @@
}; };
networking = { networking = {
hostName = "neo";
search = [ "bck.me" ]; search = [ "bck.me" ];
}; };

View file

@ -1,6 +1,5 @@
{ ... }: { ... }:
{ {
networking.hostName = "vm";
sconfig.profile = "server"; sconfig.profile = "server";
boot.loader.grub.device = "/dev/vda"; boot.loader.grub.device = "/dev/vda";
fileSystems."/" = { device = "/dev/vda1"; fsType = "ext4"; }; fileSystems."/" = { device = "/dev/vda1"; fsType = "ext4"; };