nixConfig/nixos/machines/nodens/hardware-configuration.nix
Gonne 26fd1e22fe
Add exec permission to mounted nix store from remote machine
Solves the error
```
[gonne@nodens:~]$ sudo nixos-install --flake 'git+https://gitea.mathebau.de/gonne/nixConfig?ref=updates#ghatanothoa'
building the flake in git+https://gitea.mathebau.de/gonne/nixConfig?ref=updates&rev=711f80c85e185ca9fe32a27492b5295f2ddc7a2f...
error: builder for '/nix/store/0iblfp7h8l97qflgcsv3kpnwvfzvr6bi-builder.pl.drv' failed with exit code 1;
       last 1 log lines:
       > error: executing '/nix/store/9nw8b61s8lfdn8fkabxhbz0s775gjhbr-bash-5.2p37/bin/bash': Permission denied
       For full logs, run 'nix log /nix/store/0iblfp7h8l97qflgcsv3kpnwvfzvr6bi-builder.pl.drv'.
error: builder for '/nix/store/ssy2yzclqcsddsmqw60yd7vwc7843fw3-daniel-authorized_keys.drv' failed with exit code 1;
       last 1 log lines:
       > error: executing '/nix/store/9nw8b61s8lfdn8fkabxhbz0s775gjhbr-bash-5.2p37/bin/bash': Permission denied
       For full logs, run 'nix log /nix/store/ssy2yzclqcsddsmqw60yd7vwc7843fw3-daniel-authorized_keys.drv'.
error: builder for '/nix/store/k4npfvmszrzr49yrm5k4hiz3p2c32jl7-etc-os-release.drv' failed with exit code 1;
       last 1 log lines:
       > error: executing '/nix/store/9nw8b61s8lfdn8fkabxhbz0s775gjhbr-bash-5.2p37/bin/bash': Permission denied
       For full logs, run 'nix log /nix/store/k4npfvmszrzr49yrm5k4hiz3p2c32jl7-etc-os-release.drv'.
error: builder for '/nix/store/s72czr6ba3kf87hahwmg5lvjd9dwnjnz-mounts.sh.drv' failed with exit code 1;
       last 1 log lines:
       > error: executing '/nix/store/9nw8b61s8lfdn8fkabxhbz0s775gjhbr-bash-5.2p37/bin/bash': Permission denied
       For full logs, run 'nix log /nix/store/s72czr6ba3kf87hahwmg5lvjd9dwnjnz-mounts.sh.drv'.
error: 1 dependencies of derivation '/nix/store/mm45kds7svlvi0w3fj33pfbcjbzcx2nl-nixos-system-ghatanothoa-25.05pre-git.drv' failed to build

[gonne@nodens:~]$

```
2025-04-22 09:58:32 +02:00

61 lines
1.6 KiB
Nix

# A machine that exists to install other NixOS machines from some config
{
lib,
pkgs,
...
}: {
fileSystems."/" = {
device = "root";
fsType = "tmpfs";
options = ["size=10G" "mode=755"];
};
# Different than usual names in order to automount other VMs
fileSystems."/persist" = {
device = "/dev/disk/by-label/nixosNodens";
fsType = "btrfs";
options = ["subvol=persist"];
neededForBoot = true;
};
fileSystems."/boot" = {
device = "/dev/disk/by-label/bootNodens";
fsType = "ext4";
};
fileSystems."/nix" = {
device = "/dev/disk/by-label/nixosNodens";
fsType = "btrfs";
options = ["subvol=nix"];
};
#Machine to be installed
fileSystems."/mnt/persist" = {
device = "/dev/disk/by-label/nixos";
fsType = "btrfs";
options = [
"subvol=persist"
"users" # Allows any user to mount and unmount
"nofail" # Prevent system from failing if this drive doesn't mount
];
};
fileSystems."/mnt/boot" = {
device = "/dev/disk/by-label/boot";
fsType = "ext4";
options = [
"users" # Allows any user to mount and unmount
"nofail" # Prevent system from failing if this drive doesn't mount
];
};
fileSystems."/mnt/nix" = {
device = "/dev/disk/by-label/nixos";
fsType = "btrfs";
options = [
"subvol=nix"
"users" # Allows any user to mount and unmount
"nofail" # Prevent system from failing if this drive doesn't mount
"exec" # needed for the nixos-install command
];
};
swapDevices = [{device = "/dev/disk/by-uuid/89e13a83-506a-43b4-b06a-09424500ceda";}];
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
}