Compare commits

...

2 Commits

Author SHA1 Message Date
h7x4
0c66cff9f2 hosts/skrott: move here from the dibbler repo 2026-01-06 17:40:10 +09:00
h7x4
893de326af flake.nix: allow disabling defaults for nixosConfig func 2026-01-06 17:11:15 +09:00
3 changed files with 151 additions and 10 deletions

57
flake.lock generated
View File

@@ -21,6 +21,28 @@
"type": "github"
}
},
"dibbler": {
"inputs": {
"flake-utils": "flake-utils",
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1767688395,
"narHash": "sha256-vvAr3XPLmpG8cP1F0csbxfVNipiWD5Jhtg2lE42H+AQ=",
"ref": "main",
"rev": "1733843b772dc0055f0182155c9a105bccd7a858",
"revCount": 216,
"type": "git",
"url": "https://git.pvv.ntnu.no/Projects/dibbler.git"
},
"original": {
"ref": "main",
"type": "git",
"url": "https://git.pvv.ntnu.no/Projects/dibbler.git"
}
},
"disko": {
"inputs": {
"nixpkgs": [
@@ -62,6 +84,23 @@
"inputs": {
"systems": "systems"
},
"locked": {
"lastModified": 1731533236,
"narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "11707dc2f618dd54ca8739b309ec4fc024de578b",
"type": "github"
},
"original": {
"id": "flake-utils",
"type": "indirect"
}
},
"flake-utils_2": {
"inputs": {
"systems": "systems_2"
},
"locked": {
"lastModified": 1726560853,
"narHash": "sha256-X6rJYSESBVr3hBoH0WbKE5KvhPU5bloyZ2L4K60/fPQ=",
@@ -250,7 +289,7 @@
"nix-topology": {
"inputs": {
"devshell": "devshell",
"flake-utils": "flake-utils",
"flake-utils": "flake-utils_2",
"nixpkgs": [
"nixpkgs"
],
@@ -368,6 +407,7 @@
},
"root": {
"inputs": {
"dibbler": "dibbler",
"disko": "disko",
"gergle": "gergle",
"greg-ng": "greg-ng",
@@ -505,6 +545,21 @@
"repo": "default",
"type": "github"
}
},
"systems_2": {
"locked": {
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
"owner": "nix-systems",
"repo": "default",
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default",
"type": "github"
}
}
},
"root": "root",

View File

@@ -20,6 +20,9 @@
pvv-calendar-bot.url = "git+https://git.pvv.ntnu.no/Projects/calendar-bot.git?ref=main";
pvv-calendar-bot.inputs.nixpkgs.follows = "nixpkgs";
dibbler.url = "git+https://git.pvv.ntnu.no/Projects/dibbler.git?ref=main";
dibbler.inputs.nixpkgs.follows = "nixpkgs";
matrix-next.url = "github:dali99/nixos-matrix-modules/v0.8.0";
matrix-next.inputs.nixpkgs.follows = "nixpkgs";
@@ -80,24 +83,30 @@
nixpkgs:
name:
configurationPath:
extraArgs:
extraArgs@{
system ? "x86_64-linux",
specialArgs ? { },
modules ? [ ],
overlays ? [ ],
enableDefaults ? true,
...
}:
lib.nixosSystem (lib.recursiveUpdate
(let
system = "x86_64-linux";
in {
{
inherit system;
specialArgs = {
inherit unstablePkgs inputs;
values = import ./values.nix;
fp = path: ./${path};
} // extraArgs.specialArgs or { };
} // specialArgs;
modules = [
configurationPath
] ++ (lib.optionals enableDefaults [
sops-nix.nixosModules.sops
inputs.roowho2.nixosModules.default
] ++ extraArgs.modules or [];
]) ++ modules;
pkgs = import nixpkgs {
inherit system;
@@ -106,16 +115,18 @@
"nvidia-x11"
"nvidia-settings"
];
overlays = [
overlays = (lib.optionals enableDefaults [
# Global overlays go here
inputs.roowho2.overlays.default
] ++ extraArgs.overlays or [ ];
]) ++ overlays;
};
})
}
(builtins.removeAttrs extraArgs [
"system"
"modules"
"overlays"
"specialArgs"
"enableDefaults"
])
);
@@ -200,6 +211,16 @@
inputs.gergle.overlays.default
];
};
skrott = stableNixosConfig "skrott" {
system = "aarch64-linux";
modules = [
(nixpkgs + "/nixos/modules/installer/sd-card/sd-image-aarch64.nix")
inputs.dibbler.nixosModules.default
];
overlays = [
inputs.dibbler.overlays.default
];
};
}
//
(let
@@ -261,6 +282,11 @@
lib.genAttrs allMachines
(machine: self.nixosConfigurations.${machine}.config.system.build.toplevel)
//
# Skrott is exception
{
skrott = self.nixosConfigurations.skrott.config.system.build.sdImage;
}
//
# Nix-topology
(let
topology' = import inputs.nix-topology {

View File

@@ -0,0 +1,60 @@
{ lib, fp, ... }: {
imports = [
# ./hardware-configuration.nix
(fp /base)
];
boot = {
consoleLogLevel = 0;
enableContainers = false;
loader.grub.enable = false;
};
# Now turn off a bunch of stuff lol
system.autoUpgrade.enable = lib.mkForce false;
services.irqbalance.enable = lib.mkForce false;
services.logrotate.enable = lib.mkForce false;
services.nginx.enable = lib.mkForce false;
services.postfix.enable = lib.mkForce false;
# TODO: can we reduce further?
system.stateVersion = "25.05";
# sops.defaultSopsFile = fp /secrets/skrott/skrott.yaml;
# sops.age.sshKeyPaths = [ "/etc/ssh/ssh_host_ed25519_key" ];
# sops.age.keyFile = "/var/lib/sops-nix/key.txt";
# sops.age.generateKey = true;
# zramSwap.enable = true;
networking = {
hostName = "skrot";
interfaces.eth0 = {
useDHCP = false;
ipv4.addresses = [{
address = "129.241.210.235";
prefixLength = 25;
}];
};
};
services.dibbler = {
enable = true;
kioskMode = true;
limitScreenWidth = 80;
limitScreenHeight = 42;
};
# https://github.com/NixOS/nixpkgs/issues/84105
boot.kernelParams = [
"console=ttyUSB0,9600"
# "console=tty1" # Already part of the module
];
systemd.services."serial-getty@ttyUSB0" = {
enable = true;
wantedBy = [ "getty.target" ]; # to start at boot
serviceConfig.Restart = "always"; # restart when session is closed
};
}