better logic

This commit is contained in:
2026-03-03 10:43:21 +01:00
parent d99a9cd1f4
commit e4f1c5d84a
4 changed files with 11 additions and 9 deletions

View File

@@ -1,6 +1,7 @@
{ ... }: { { ... }: {
flake.nixosModules.network = {lib, ... }:{ flake.nixosModules.network = {lib, host, ... }:{
networking.firewall.enable = true; networking.firewall.enable = true;
networking.networkmanager.enable = true; networking.networkmanager.enable = true;
networking.hostName = host;
}; };
} }

View File

@@ -4,7 +4,6 @@
boot.kernelParams = [ "quiet" "splash" "boot.shell_on_fail" "loglevel=3" "rd.systemd.show_status=false" "rd.udev.log_level=3" "udev.log_priority=3" ]; boot.kernelParams = [ "quiet" "splash" "boot.shell_on_fail" "loglevel=3" "rd.systemd.show_status=false" "rd.udev.log_level=3" "udev.log_priority=3" ];
nixpkgs.hostPlatform = "x86_64-linux"; nixpkgs.hostPlatform = "x86_64-linux";
hardware.cpu.amd.updateMicrocode = true; hardware.cpu.amd.updateMicrocode = true;
networking.hostName = "computer-mo";
boot.kernelModules = [ "kvm-amd" ]; boot.kernelModules = [ "kvm-amd" ];
}; };
} }

View File

@@ -1,12 +1,14 @@
{ inputs, ... }: { inputs, ... }:
let let
system = "x86_64-linux";
user = "mo";
host = "computer-mo";
mkHost = inputs.self.lib.mkHost; mkHost = inputs.self.lib.mkHost;
in in
{ {
flake.nixosConfigurations = { flake.nixosConfigurations.${host} = mkHost {
computer-mo = mkHost { inherit system user host;
user = "mo"; extraModules = [ inputs.self.nixosModules.${host} ];
extraModules = [ inputs.self.nixosModules.computer-mo ];
};
}; };
} }

View File

@@ -1,9 +1,9 @@
{ inputs, ... }: { { inputs, ... }: {
flake.lib.mkHost = { system ? "x86_64-linux", user, extraModules ? [] }: flake.lib.mkHost = { system, user, host, extraModules ? [] }:
inputs.nixpkgs.lib.nixosSystem { inputs.nixpkgs.lib.nixosSystem {
inherit system; inherit system;
specialArgs = { specialArgs = {
inherit user; inherit user host;
pkgs-unstable = import inputs.nixpkgs-unstable { pkgs-unstable = import inputs.nixpkgs-unstable {
inherit system; inherit system;
config.allowUnfree = true; config.allowUnfree = true;