diff options
author | Mark Nipper <nipsy@bitgnome.net> | 2024-04-15 23:57:01 -0700 |
---|---|---|
committer | Mark Nipper <nipsy@bitgnome.net> | 2024-04-15 23:57:01 -0700 |
commit | ae7994f09eb10c6bb3a26cfbad9b9b6ec7ad9dde (patch) | |
tree | a82cd06ccdd8bd0803af4ecc41da03750f2c4a20 | |
parent | 624c07e8680501a00b3edd45476a6380127aaad7 (diff) | |
download | nix-ae7994f09eb10c6bb3a26cfbad9b9b6ec7ad9dde.tar nix-ae7994f09eb10c6bb3a26cfbad9b9b6ec7ad9dde.tar.gz nix-ae7994f09eb10c6bb3a26cfbad9b9b6ec7ad9dde.tar.bz2 nix-ae7994f09eb10c6bb3a26cfbad9b9b6ec7ad9dde.tar.lz nix-ae7994f09eb10c6bb3a26cfbad9b9b6ec7ad9dde.tar.xz nix-ae7994f09eb10c6bb3a26cfbad9b9b6ec7ad9dde.tar.zst nix-ae7994f09eb10c6bb3a26cfbad9b9b6ec7ad9dde.zip |
Update disko installer and finalize VM configuration
Diffstat (limited to '')
-rw-r--r-- | flake.nix | 6 | ||||
-rw-r--r-- | hosts/richese/default.nix | 31 | ||||
-rw-r--r-- | hosts/richese/disks.nix | 18 | ||||
-rw-r--r-- | hosts/richese/hardware-configuration.nix | 2 | ||||
-rwxr-xr-x | scripts/install-with-disko | 15 |
5 files changed, 54 insertions, 18 deletions
@@ -40,9 +40,9 @@ system = "x86_64-linux"; modules = [ ./hosts/richese - #home-manager-unstable.nixosModules.home-manager { - # home-manager.users.nipsy = import ./home/nipsy/richese.nix; - #} + home-manager-unstable.nixosModules.home-manager { + home-manager.users.nipsy = import ./home/nipsy/richese.nix; + } ]; }; }; diff --git a/hosts/richese/default.nix b/hosts/richese/default.nix index 979bd24..2c46971 100644 --- a/hosts/richese/default.nix +++ b/hosts/richese/default.nix @@ -1,4 +1,4 @@ -{ config, pkgs, ... }: { +{ config, lib, pkgs, ... }: { boot = { initrd.kernelModules = [ "zfs" ]; kernelPackages = config.boot.zfs.package.latestCompatibleLinuxPackages; @@ -16,13 +16,13 @@ ../common/core #../common/optional/db.nix #../common/optional/dev.nix - #../common/optional/misc.nix + ../common/optional/misc.nix #../common/optional/multimedia.nix - #../common/optional/pipewire.nix + ../common/optional/pipewire.nix ../common/optional/services/openssh.nix - #../common/optional/services/xorg.nix + ../common/optional/services/xorg.nix ../common/optional/zfs.nix - #../common/users/nipsy + ../common/users/nipsy ../common/users/root ]; @@ -32,11 +32,26 @@ nftables.enable = true; }; - services.xserver.videoDrivers = [ "vmware" ]; + services.xserver.videoDrivers = lib.mkForce [ "vmware" "virtualbox" "modesetting" ]; system.stateVersion = "23.11"; + #systemd.user.services = let + # vbox-client = desc: flags: { + # description = "VirtualBox Guest: ${desc}"; + + # wantedBy = [ "graphical-session.target" ]; + # requires = [ "dev-vboxguest.device" ]; + # after = [ "dev-vboxguest.device" ]; + + # unitConfig.ConditionVirtualization = "oracle"; + + # serviceConfig.ExecStart = "${config.boot.kernelPackages.virtualboxGuestAdditions}/bin/VBoxClient -fv ${flags}"; + # }; + #in { + # virtualbox-resize = vbox-client "Resize" "--vmsvga"; + # virtualbox-clipboard = vbox-client "Clipboard" "--clipboard"; + #}; + virtualisation.virtualbox.guest.enable = true; - # no longer in unstable apparently - #virtualisation.virtualbox.guest.x11 = true; } diff --git a/hosts/richese/disks.nix b/hosts/richese/disks.nix index 9f05d48..a0c8ed4 100644 --- a/hosts/richese/disks.nix +++ b/hosts/richese/disks.nix @@ -46,14 +46,15 @@ type = "zpool"; rootFsOptions = { acltype = "posixacl"; + canmount = "off"; + compression = "on"; dnodesize = "auto"; - xattr = "sa"; - relatime = "on"; - normalization = "formD"; encryption = "aes-256-gcm"; keyformat = "passphrase"; keylocation = "file:///tmp/data.keyfile"; - compression = "on"; + normalization = "formD"; + relatime = "on"; + xattr = "sa"; }; postCreateHook = '' zfs set keylocation="prompt" rpool @@ -63,6 +64,10 @@ #autotrim = "on"; }; datasets = { + "local" = { + type = "zfs_fs"; + options.mountpoint = "none"; + }; "local/root" = { type = "zfs_fs"; options.mountpoint = "legacy"; @@ -76,6 +81,11 @@ }; mountpoint = "/nix"; }; + "user" = { + type = "zfs_fs"; + options.mountpoint = "none"; + mountpoint = "/home"; + }; "user/home" = { type = "zfs_fs"; options.mountpoint = "legacy"; diff --git a/hosts/richese/hardware-configuration.nix b/hosts/richese/hardware-configuration.nix index dc9fd42..5b94417 100644 --- a/hosts/richese/hardware-configuration.nix +++ b/hosts/richese/hardware-configuration.nix @@ -41,6 +41,4 @@ swapDevices = [ { device = "/dev/disk/by-label/swap"; } ]; - - virtualisation.virtualbox.guest.enable = true; } diff --git a/scripts/install-with-disko b/scripts/install-with-disko index 4a89676..7ae4e8e 100755 --- a/scripts/install-with-disko +++ b/scripts/install-with-disko @@ -5,7 +5,6 @@ setopt ERR_EXIT NO_UNSET PIPE_FAIL DIR="${0:h}" TARGET_HOST="${1:-}" -TARGET_USER="${2:-nipsy}" if [[ "${USERNAME}" != "nixos" ]]; then echo "ERROR! ${0:t} should be run as the nixos user from a NixOS installer." >&2 @@ -78,8 +77,22 @@ if [[ "${REPLY}" == "y" ]]; then if [[ "${?}" -eq 0 ]]; then cd + + for i in $(awk -F: '{if ($3 >= 1000 && $3 <= 30000) print $1}' /mnt/etc/passwd); do + read -q "?Do you want to set a password for the user ${i}? [y/N] " + echo + if [[ "${REPLY}" == "y" ]]; then + sudo chroot /mnt /$(find /mnt/nix/store/*-shadow-*/bin/passwd -executable -name passwd | cut -d/ -f3-) ${i} + fi + echo + done + + echo 'Unmounting file systems...' >&2 mount | grep -v zfs | awk '$3 ~ /^\/mnt\// {print $3}' | xargs -i{} sudo umount -lf {} + echo 'Unmounting ZFS file systems...' >&2 while ! sudo umount -t zfs -a; do echo 'attempting to umount all ZFS file systems' >&2; sleep 1; done + echo 'Exporting zpool...' >&2 while ! sudo zpool export -a; do echo 'attempting to export all zpools' >&2; sleep 1; done + echo 'Type reboot when ready.' >&2 fi fi |