setup repo structure (& test system config)
This commit is contained in:
commit
67c2250833
12 changed files with 573 additions and 0 deletions
41
systems/default.nix
Normal file
41
systems/default.nix
Normal file
|
@ -0,0 +1,41 @@
|
|||
{ flake }:
|
||||
let
|
||||
nixpkgs = flake.inputs.nixpkgs;
|
||||
|
||||
# utility function to create a new nixos configuration
|
||||
# call like `mkSystem "x86_64-linux" "<hostname>.eh22.intern"`
|
||||
mkSystem =
|
||||
systemType: name:
|
||||
nixpkgs.lib.nixosSystem {
|
||||
system = systemType;
|
||||
specialArgs = flake.inputs;
|
||||
modules = [
|
||||
flake.inputs.home-manager.nixosModules.home-manager
|
||||
flake.inputs.sops-nix.nixosModules.default
|
||||
flake.inputs.lix.nixosModules.lixFromNixpkgs
|
||||
|
||||
../modules/base_system.nix
|
||||
../modules/user_account.nix
|
||||
#../modules/mail_relay.nix
|
||||
./${name}.nix
|
||||
|
||||
(
|
||||
let
|
||||
fqdnParts = nixpkgs.lib.strings.splitString "." name;
|
||||
in
|
||||
{
|
||||
networking.hostName = builtins.head fqdnParts;
|
||||
networking.domain =
|
||||
if ((builtins.length fqdnParts) > 1) then
|
||||
(builtins.concatStringsSep "." (builtins.tail fqdnParts))
|
||||
else
|
||||
null;
|
||||
}
|
||||
)
|
||||
];
|
||||
};
|
||||
in
|
||||
{
|
||||
# exposed hosts at myroot
|
||||
"test.eh22.intern" = mkSystem "x86_64-linux" "test.eh22.intern";
|
||||
}
|
51
systems/test.eh22.intern.nix
Normal file
51
systems/test.eh22.intern.nix
Normal file
|
@ -0,0 +1,51 @@
|
|||
{
|
||||
...
|
||||
}:
|
||||
{
|
||||
imports = [ ];
|
||||
|
||||
# boot config
|
||||
fileSystems = {
|
||||
"/boot" = {
|
||||
device = "/dev/disk/by-uuid/94A7-6995";
|
||||
fsType = "vfat";
|
||||
options = [
|
||||
"fmask=0077"
|
||||
"dmask=0077"
|
||||
];
|
||||
};
|
||||
"/" = {
|
||||
device = "/dev/disk/by-uuid/4e0b7ea5-8c74-478f-a4e3-ddc5691e4065";
|
||||
fsType = "ext4";
|
||||
};
|
||||
"/srv/data/k8s" = {
|
||||
device = "10.0.10.14:/srv/data/k8s";
|
||||
fsType = "nfs";
|
||||
options = [
|
||||
"defaults"
|
||||
"_netdev"
|
||||
];
|
||||
};
|
||||
};
|
||||
|
||||
# networking config
|
||||
networking.useDHCP = false;
|
||||
systemd.network = {
|
||||
enable = true;
|
||||
networks.enp1s0 = {
|
||||
matchConfig = {
|
||||
Type = "ether";
|
||||
MACAddress = "52:54:00:e6:1f:51";
|
||||
};
|
||||
networkConfig = {
|
||||
IPv6AcceptRA = false;
|
||||
};
|
||||
DHCP = "yes";
|
||||
};
|
||||
};
|
||||
|
||||
# DO NOT CHANGE
|
||||
# this defines the first version of NixOS that was installed on the machine so that programs with non-migratable data files are kept compatible
|
||||
home-manager.users.noc.home.stateVersion = "24.11";
|
||||
system.stateVersion = "24.11";
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue