Move mkHost helper into a separate module
This commit is contained in:
25
flake.nix
25
flake.nix
@@ -6,33 +6,22 @@
|
||||
nixpkgs-unstable.url = "github:nixos/nixpkgs/nixos-unstable";
|
||||
};
|
||||
|
||||
outputs = { self, nixpkgs, nixpkgs-unstable } @inputs:
|
||||
outputs = { nixpkgs, ... }@inputs:
|
||||
let
|
||||
mkHost = { hostname, system, stateVersion }: nixpkgs.lib.nixosSystem {
|
||||
system = system;
|
||||
modules = [
|
||||
{
|
||||
networking = {
|
||||
hostName = hostname;
|
||||
networkmanager.enable = true;
|
||||
};
|
||||
system.stateVersion = stateVersion;
|
||||
}
|
||||
./modules/nixos
|
||||
./hosts/${hostname}
|
||||
];
|
||||
specialArgs = { inherit inputs; };
|
||||
};
|
||||
utils = import ./lib { inherit inputs; };
|
||||
inherit (utils) mkHost;
|
||||
in {
|
||||
nixosConfigurations = {
|
||||
marauder = mkHost {
|
||||
hostname = "marauder";
|
||||
hostName = "marauder";
|
||||
system = "x86_64-linux";
|
||||
timeZone = "America/Los_Angeles";
|
||||
stateVersion = "24.05";
|
||||
};
|
||||
monolith = mkHost {
|
||||
hostname = "monolith";
|
||||
hostName = "monolith";
|
||||
system = "x86_64-linux";
|
||||
timeZone = "America/Los_Angeles";
|
||||
stateVersion = "24.05";
|
||||
};
|
||||
};
|
||||
|
@@ -5,18 +5,10 @@
|
||||
./backup.nix
|
||||
./boot.nix
|
||||
./hardware.nix
|
||||
../../modules/nixos
|
||||
];
|
||||
|
||||
time.timeZone = "America/Los_Angeles";
|
||||
|
||||
nixpkgs.config.allowUnfree = true;
|
||||
|
||||
nix.settings.experimental-features = [
|
||||
"nix-command"
|
||||
"flakes"
|
||||
];
|
||||
|
||||
services = {
|
||||
xserver = {
|
||||
enable = true;
|
||||
@@ -27,6 +19,4 @@
|
||||
};
|
||||
displayManager.defaultSession = "cinnamon";
|
||||
};
|
||||
|
||||
system.stateVersion = "24.05";
|
||||
}
|
||||
|
@@ -1,20 +1 @@
|
||||
{ config, lib, pkgs, inputs, outputs, ... }:
|
||||
{
|
||||
imports = [
|
||||
outputs.nixosModules
|
||||
];
|
||||
|
||||
time.timeZone = "America/Los_Angeles";
|
||||
|
||||
nix.settings.experimental-features = [
|
||||
"nix-command"
|
||||
"flakes"
|
||||
];
|
||||
|
||||
networking = {
|
||||
hostName = "monolith";
|
||||
networkmanager.enable = true;
|
||||
};
|
||||
|
||||
system.stateVersion = "24.05";
|
||||
}
|
||||
{ ... }: {}
|
||||
|
18
lib/default.nix
Normal file
18
lib/default.nix
Normal file
@@ -0,0 +1,18 @@
|
||||
{ inputs }: {
|
||||
mkHost = { hostName, system, timeZone, stateVersion }: inputs.nixpkgs.lib.nixosSystem {
|
||||
inherit system;
|
||||
modules = [
|
||||
{
|
||||
networking.hostName = hostName;
|
||||
nix.settings.experimental-features = [ "nix-command" "flakes" ];
|
||||
system.stateVersion = stateVersion;
|
||||
time.timeZone = timeZone;
|
||||
}
|
||||
../modules/nixos
|
||||
../hosts/${hostName}
|
||||
];
|
||||
specialArgs = {
|
||||
inherit inputs;
|
||||
};
|
||||
};
|
||||
}
|
@@ -1,6 +1,11 @@
|
||||
{ ... }:
|
||||
{ options, config, lib, ... }:
|
||||
{
|
||||
imports = [
|
||||
./users.nix
|
||||
];
|
||||
users.users = {
|
||||
nettika = {
|
||||
isNormalUser = true;
|
||||
extraGroups = [ "wheel" "networkmanager" ];
|
||||
};
|
||||
};
|
||||
|
||||
networking.networkmanager.enable = true;
|
||||
}
|
@@ -1,9 +0,0 @@
|
||||
{ ... }:
|
||||
{
|
||||
users.users = {
|
||||
nettika = {
|
||||
isNormalUser = true;
|
||||
extraGroups = [ "wheel" "networkmanager" ];
|
||||
};
|
||||
};
|
||||
}
|
Reference in New Issue
Block a user