+13
flake.nix
+13
flake.nix
···
73
73
{
74
74
_module.args.pkgs = import inputs.unstable { inherit system; };
75
75
76
+
apps = pkgs.lib.mapAttrs' (host: nixosConfig: {
77
+
name = "${host}-vm";
78
+
value = {
79
+
type = "app";
80
+
program = pkgs.lib.getExe (
81
+
if nixosConfig.config.disko.devices.disk != { } then
82
+
nixosConfig.config.system.build.vmWithDisko
83
+
else
84
+
nixosConfig.config.system.build.vm
85
+
);
86
+
};
87
+
}) inputs.self.nixosConfigurations;
88
+
76
89
legacyPackages.homeConfigurations = import ./home-manager system inputs;
77
90
78
91
formatter = pkgs.nixfmt-rfc-style;
+5
hosts/crossbell/default.nix
+5
hosts/crossbell/default.nix
+11
modules/impermanence.nix
+11
modules/impermanence.nix
···
6
6
}:
7
7
let
8
8
cfg = config.local.impermanence;
9
+
userCfg = config.users.users.peter;
9
10
in
10
11
{
11
12
imports = [
···
26
27
users.mutableUsers = false;
27
28
users.users.root.hashedPasswordFile = "${cfg.persist}/passwords/root";
28
29
users.users.peter.hashedPasswordFile = "${cfg.persist}/passwords/peter";
30
+
31
+
virtualisation.vmVariantWithDisko = {
32
+
users.users.root.hashedPasswordFile = lib.mkForce null;
33
+
users.users.peter.hashedPasswordFile = lib.mkForce null;
34
+
35
+
# https://github.com/NixOS/nixpkgs/issues/6481
36
+
systemd.tmpfiles.rules = [
37
+
"d ${userCfg.home} ${userCfg.homeMode} ${userCfg.name} ${userCfg.group}"
38
+
];
39
+
};
29
40
30
41
age.identityPaths = [ "${cfg.persist}/etc/ssh/ssh_host_ed25519_key" ];
31
42
+18
modules/nixos.nix
+18
modules/nixos.nix
···
53
53
security.sudo.execWheelOnly = lib.mkForce false;
54
54
55
55
services.dbus.implementation = "broker";
56
+
57
+
virtualisation =
58
+
let
59
+
variant = {
60
+
nixpkgs.hostPlatform = "x86_64-linux";
61
+
disabledModules = [ ./tailscale.nix ];
62
+
users.users.peter.password = "";
63
+
virtualisation = {
64
+
cores = 3;
65
+
memorySize = 1024 * 3;
66
+
graphics = false;
67
+
};
68
+
};
69
+
in
70
+
{
71
+
vmVariant = variant;
72
+
vmVariantWithDisko = variant;
73
+
};
56
74
}