Impermanence support
parent
ec0eb624df
commit
ab38fc8b08
22
flake.lock
22
flake.lock
|
@ -1,12 +1,27 @@
|
|||
{
|
||||
"nodes": {
|
||||
"impermanence": {
|
||||
"locked": {
|
||||
"lastModified": 1731242966,
|
||||
"narHash": "sha256-B3C3JLbGw0FtLSWCjBxU961gLNv+BOOBC6WvstKLYMw=",
|
||||
"owner": "nix-community",
|
||||
"repo": "impermanence",
|
||||
"rev": "3ed3f0eaae9fcc0a8331e77e9319c8a4abd8a71a",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "nix-community",
|
||||
"repo": "impermanence",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"nixpkgs": {
|
||||
"locked": {
|
||||
"lastModified": 1731676054,
|
||||
"narHash": "sha256-OZiZ3m8SCMfh3B6bfGC/Bm4x3qc1m2SVEAlkV6iY7Yg=",
|
||||
"lastModified": 1732014248,
|
||||
"narHash": "sha256-y/MEyuJ5oBWrWAic/14LaIr/u5E0wRVzyYsouYY3W6w=",
|
||||
"owner": "nixos",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "5e4fbfb6b3de1aa2872b76d49fafc942626e2add",
|
||||
"rev": "23e89b7da85c3640bbc2173fe04f4bd114342367",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
@ -18,6 +33,7 @@
|
|||
},
|
||||
"root": {
|
||||
"inputs": {
|
||||
"impermanence": "impermanence",
|
||||
"nixpkgs": "nixpkgs"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
|
||||
inputs = {
|
||||
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
|
||||
impermanence.url = "github:nix-community/impermanence";
|
||||
};
|
||||
|
||||
outputs =
|
||||
|
|
|
@ -5,7 +5,10 @@
|
|||
...
|
||||
}:
|
||||
{
|
||||
imports = [ (modulesPath + "/profiles/qemu-guest.nix") ];
|
||||
imports = [
|
||||
(modulesPath + "/profiles/qemu-guest.nix")
|
||||
./fs.nix
|
||||
];
|
||||
|
||||
config = {
|
||||
time.timeZone = "Europe/Amsterdam";
|
||||
|
@ -17,10 +20,7 @@
|
|||
# Enable QEMU Guest for Proxmox
|
||||
services.qemuGuest.enable = lib.mkDefault true;
|
||||
|
||||
# Use the boot drive for grub
|
||||
boot.loader.grub.enable = lib.mkDefault true;
|
||||
boot.loader.grub.devices = [ "/dev/sda" ];
|
||||
|
||||
boot.loader.systemd-boot.enable = true;
|
||||
boot.growPartition = lib.mkDefault true;
|
||||
|
||||
# Allow remote updates with flakes and non-root users
|
||||
|
@ -38,14 +38,14 @@
|
|||
isNormalUser = true;
|
||||
group = "maintenance";
|
||||
extraGroups = [ "wheel" ];
|
||||
openssh.authorizedKeys.keyFiles = [ ../authorized_keys ];
|
||||
openssh.authorizedKeys.keyFiles = [ ../../authorized_keys ];
|
||||
};
|
||||
|
||||
users.groups."maintenance" = {};
|
||||
|
||||
# Enable mDNS for `hostname.local` addresses
|
||||
services.avahi.enable = true;
|
||||
services.avahi.nssmdns = true;
|
||||
services.avahi.nssmdns4 = true;
|
||||
services.avahi.publish = {
|
||||
enable = true;
|
||||
addresses = true;
|
||||
|
@ -68,11 +68,18 @@
|
|||
};
|
||||
programs.ssh.startAgent = true;
|
||||
|
||||
# Default filesystem
|
||||
fileSystems."/" = lib.mkDefault {
|
||||
device = "/dev/disk/by-label/nixos";
|
||||
autoResize = true;
|
||||
fsType = "ext4";
|
||||
environment.persistence."/persistent" = {
|
||||
enable = true;
|
||||
hideMounts = true;
|
||||
directories = [
|
||||
"/var/log"
|
||||
"/var/lib/nixos"
|
||||
"/var/lib/systemd/coredump"
|
||||
"/etc/nixos"
|
||||
];
|
||||
files = [
|
||||
"/etc/machine-id"
|
||||
];
|
||||
};
|
||||
|
||||
system.stateVersion = lib.mkDefault "24.05";
|
|
@ -0,0 +1,36 @@
|
|||
{
|
||||
...
|
||||
}:
|
||||
{
|
||||
boot.supportedFilesystems = [ "btrfs" ];
|
||||
|
||||
fileSystems."/" = {
|
||||
device = "none";
|
||||
fsType = "tmpfs";
|
||||
options = [ "default" "mode=755" ];
|
||||
};
|
||||
|
||||
fileSystems."/boot" = {
|
||||
device = "/dev/disk/by-label/boot";
|
||||
fsType = "fat";
|
||||
};
|
||||
|
||||
fileSystems."/nix" = {
|
||||
device = "/dev/disk/by-label/btrfs";
|
||||
fsType = "btrfs";
|
||||
options = [ "compress=zstd" "subvol=nix" "noatime" ];
|
||||
};
|
||||
|
||||
fileSystems."/persistent" = {
|
||||
device = "/dev/disk/by-label/btrfs";
|
||||
fsType = "btrfs";
|
||||
options = [ "compress=zstd" "subvol=persistent" "noatime" ];
|
||||
autoResize = true;
|
||||
neededForBoot = true;
|
||||
};
|
||||
|
||||
fileSystems."/media" = {
|
||||
device = "vm@b9b22d11-3492-49a6-92b7-b36cdf0161fe.cephfs=/media";
|
||||
fsType = "ceph";
|
||||
};
|
||||
}
|
Loading…
Reference in New Issue