Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5188d951ef | ||
|
|
1ca757fe95 | ||
|
|
9d2ecaa010 | ||
|
|
90dfef044c | ||
|
|
edc2e50a9b |
8 changed files with 85 additions and 59 deletions
24
flake.lock
generated
24
flake.lock
generated
|
|
@ -143,6 +143,21 @@
|
|||
"type": "github"
|
||||
}
|
||||
},
|
||||
"crane_2": {
|
||||
"locked": {
|
||||
"lastModified": 1777830388,
|
||||
"narHash": "sha256-2uoQAqUk2H0ijQtGiWAyNeQYGYc6yfAcRRLlJAz4Gp8=",
|
||||
"owner": "ipetkov",
|
||||
"repo": "crane",
|
||||
"rev": "d459c1350e96ce1a7e3859c513ef5e9869d67d6f",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "ipetkov",
|
||||
"repo": "crane",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"fenix": {
|
||||
"inputs": {
|
||||
"nixpkgs": [
|
||||
|
|
@ -636,6 +651,7 @@
|
|||
},
|
||||
"nova-shell": {
|
||||
"inputs": {
|
||||
"crane": "crane_2",
|
||||
"nixpkgs": [
|
||||
"nixpkgs-unstable"
|
||||
],
|
||||
|
|
@ -643,11 +659,11 @@
|
|||
"treefmt-nix": "treefmt-nix"
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1777656272,
|
||||
"narHash": "sha256-OcxjycGuzEeU6ZbX4SjSx4YVKcDlaZm8gdSvEFGowoo=",
|
||||
"lastModified": 1778180483,
|
||||
"narHash": "sha256-35cMiZn5DAnYFpKFdWg5dxW7hLO3/ey743ED6yV3pL8=",
|
||||
"ref": "refs/heads/main",
|
||||
"rev": "40cc681e9a36320659175f240e9ccc3f3041a7e9",
|
||||
"revCount": 598,
|
||||
"rev": "dfa3840d97186fef3480b49f289acd3ae707ee27",
|
||||
"revCount": 626,
|
||||
"type": "git",
|
||||
"url": "https://git.berlin.ccc.de/vinzenz/nova-shell"
|
||||
},
|
||||
|
|
|
|||
|
|
@ -73,6 +73,7 @@
|
|||
arduino
|
||||
arduino-cli
|
||||
arduino-ide
|
||||
btop
|
||||
claude-code
|
||||
dconf2nix
|
||||
foliate
|
||||
|
|
|
|||
|
|
@ -66,6 +66,8 @@ forDevice (
|
|||
doc.enable = false;
|
||||
};
|
||||
|
||||
time.timeZone = lib.mkDefault "Etc/UTC";
|
||||
|
||||
my = {
|
||||
# keep-sorted start
|
||||
autoupdate.enable = true;
|
||||
|
|
|
|||
|
|
@ -18,6 +18,7 @@
|
|||
gawk
|
||||
gnugrep
|
||||
curl
|
||||
bintools
|
||||
];
|
||||
|
||||
boot.isContainer = true;
|
||||
|
|
|
|||
|
|
@ -10,5 +10,6 @@
|
|||
rustc
|
||||
clippy
|
||||
gh
|
||||
buildPackages.stdenv.cc
|
||||
];
|
||||
}
|
||||
|
|
|
|||
57
nixosConfigurations/muede-lpt2/containers.nix
Normal file
57
nixosConfigurations/muede-lpt2/containers.nix
Normal file
|
|
@ -0,0 +1,57 @@
|
|||
{ self, ... }:
|
||||
{
|
||||
config = {
|
||||
boot.enableContainers = true;
|
||||
virtualisation.containers.enable = true;
|
||||
|
||||
containers.damocles = {
|
||||
autoStart = false;
|
||||
privateNetwork = false;
|
||||
path = self.nixosConfigurations.damocles.config.system.build.toplevel;
|
||||
bindMounts."/etc/nix/distributed-build-key" = {
|
||||
hostPath = "/etc/nix/distributed-build-key";
|
||||
isReadOnly = true;
|
||||
};
|
||||
bindMounts."/persist/damocles-ssh" = {
|
||||
hostPath = "/persist/damocles-ssh";
|
||||
isReadOnly = true;
|
||||
};
|
||||
bindMounts."/persist/damocles-lab" = {
|
||||
hostPath = "/persist/damocles-lab";
|
||||
isReadOnly = false;
|
||||
};
|
||||
};
|
||||
|
||||
containers.damocles-lab = {
|
||||
autoStart = false;
|
||||
privateNetwork = false;
|
||||
path = self.nixosConfigurations.damocles-lab.config.system.build.toplevel;
|
||||
bindMounts."/etc/nix/distributed-build-key" = {
|
||||
hostPath = "/etc/nix/distributed-build-key";
|
||||
isReadOnly = true;
|
||||
};
|
||||
bindMounts."/workspace" = {
|
||||
hostPath = "/persist/damocles-lab";
|
||||
isReadOnly = false;
|
||||
};
|
||||
bindMounts."/persist/damocles-ssh" = {
|
||||
hostPath = "/persist/damocles-ssh";
|
||||
isReadOnly = true;
|
||||
};
|
||||
};
|
||||
|
||||
# Global DefaultTimeoutStopSec is 10s (modern-desktop.nix), which kills systemd-nspawn
|
||||
# before it finishes halting, leaving cgroups busy and breaking restarts.
|
||||
systemd.services."container@damocles".serviceConfig = {
|
||||
TimeoutStopSec = "60s";
|
||||
# After a SIGKILL of nspawn, the kernel needs a moment to reap its cgroups.
|
||||
# Without this, the immediate restart attempt fails with "Device or resource busy".
|
||||
RestartSec = "5s";
|
||||
};
|
||||
|
||||
systemd.services."container@damocles-lab".serviceConfig = {
|
||||
TimeoutStopSec = "60s";
|
||||
RestartSec = "5s";
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
@ -1,6 +1,7 @@
|
|||
{ self, ... }:
|
||||
{
|
||||
imports = [
|
||||
./containers.nix
|
||||
./hardware.nix
|
||||
];
|
||||
|
||||
|
|
@ -64,58 +65,5 @@
|
|||
];
|
||||
|
||||
boot.binfmt.emulatedSystems = [ "aarch64-linux" ];
|
||||
|
||||
containers.damocles = {
|
||||
autoStart = false;
|
||||
privateNetwork = false;
|
||||
path = self.nixosConfigurations.damocles.config.system.build.toplevel;
|
||||
bindMounts."/etc/nix/distributed-build-key" = {
|
||||
hostPath = "/etc/nix/distributed-build-key";
|
||||
isReadOnly = true;
|
||||
};
|
||||
bindMounts."/persist/damocles-ssh" = {
|
||||
hostPath = "/persist/damocles-ssh";
|
||||
isReadOnly = true;
|
||||
};
|
||||
bindMounts."/persist/damocles-lab" = {
|
||||
hostPath = "/persist/damocles-lab";
|
||||
isReadOnly = false;
|
||||
};
|
||||
};
|
||||
|
||||
containers.damocles-lab = {
|
||||
autoStart = false;
|
||||
privateNetwork = false;
|
||||
path = self.nixosConfigurations.damocles-lab.config.system.build.toplevel;
|
||||
bindMounts."/etc/nix/distributed-build-key" = {
|
||||
hostPath = "/etc/nix/distributed-build-key";
|
||||
isReadOnly = true;
|
||||
};
|
||||
bindMounts."/workspace" = {
|
||||
hostPath = "/persist/damocles-lab";
|
||||
isReadOnly = false;
|
||||
};
|
||||
bindMounts."/persist/damocles-ssh" = {
|
||||
hostPath = "/persist/damocles-ssh";
|
||||
isReadOnly = true;
|
||||
};
|
||||
};
|
||||
|
||||
# Global DefaultTimeoutStopSec is 10s (modern-desktop.nix), which kills systemd-nspawn
|
||||
# before it finishes halting, leaving cgroups busy and breaking restarts.
|
||||
systemd.services."container@damocles".serviceConfig = {
|
||||
TimeoutStopSec = "60s";
|
||||
# After a SIGKILL of nspawn, the kernel needs a moment to reap its cgroups.
|
||||
# Without this, the immediate restart attempt fails with "Device or resource busy".
|
||||
RestartSec = "5s";
|
||||
};
|
||||
|
||||
systemd.services."container@damocles-lab".serviceConfig = {
|
||||
TimeoutStopSec = "60s";
|
||||
RestartSec = "5s";
|
||||
};
|
||||
|
||||
boot.enableContainers = true;
|
||||
virtualisation.containers.enable = true;
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@
|
|||
"${pkgs.writeShellScript "ssh-inhibit-pam" ''
|
||||
PIDFILE="/run/ssh-inhibitor-''${PPID}.pid"
|
||||
case "''${PAM_TYPE:-}" in
|
||||
open)
|
||||
open_session)
|
||||
${pkgs.systemd}/bin/systemd-inhibit \
|
||||
--what=sleep \
|
||||
--who=sshd \
|
||||
|
|
@ -38,7 +38,7 @@
|
|||
sleep infinity &
|
||||
echo $! > "$PIDFILE"
|
||||
;;
|
||||
close)
|
||||
close_session)
|
||||
if [ -f "$PIDFILE" ]; then
|
||||
kill "$(cat "$PIDFILE")" 2>/dev/null || true
|
||||
rm -f "$PIDFILE"
|
||||
|
|
|
|||
Loading…
Reference in a new issue