diff --git a/README.md b/README.md index d213455..5d7702b 100644 --- a/README.md +++ b/README.md @@ -10,6 +10,11 @@ sudo umount /tmp/mnt sudo nixos-generate-config --root /mnt cp /mnt/etc/nixos/hardware-configuration.nix hosts/$(hostname)/hardware-configuration.nix sudo nixos-install --root /mnt --no-root-passwd --flake .#$(hostname) +sudo nixos-enter +passwd +passwd muon +exit +sudo reboot ``` # Impermanence diff --git a/hosts/murk/configuration.nix b/hosts/murk/configuration.nix index 5f9f24c..969f9c3 100644 --- a/hosts/murk/configuration.nix +++ b/hosts/murk/configuration.nix @@ -6,6 +6,11 @@ in { imports = [ ./hardware-configuration.nix inputs.impermanence.nixosModules.impermanence + "${ + builtins.fetchTarball + "https://github.com/nix-community/disko/archive/master.tar.gz" + }/module.nix" + ./disk-config.nix # (inputs.nixpkgs # + "/nixos/modules/installer/cd-dvd/installation-cd-minimal.nix") ]; @@ -19,9 +24,12 @@ in { networking.hostId = "a2309090"; mods.home.file = ./home.nix; + boot.loader.grub.enable = true; + boot.loader.grub.efiSupport = true; + boot.loader.grub.efiInstallAsRemovable = true; + # Modules mods.desktop.enable = true; - mods.boot.enable = true; mods.theme.enable = true; mods.theme.scheme = "woodland"; diff --git a/hosts/murk/hardware-configuration.nix b/hosts/murk/hardware-configuration.nix index 6ea19ce..2598b86 100644 --- a/hosts/murk/hardware-configuration.nix +++ b/hosts/murk/hardware-configuration.nix @@ -4,61 +4,64 @@ { config, lib, pkgs, modulesPath, ... }: { - imports = - [ (modulesPath + "/installer/scan/not-detected.nix") - ]; + imports = [ (modulesPath + "/installer/scan/not-detected.nix") ]; - boot.initrd.availableKernelModules = [ "xhci_pci" "ehci_pci" "ahci" "usb_storage" "sd_mod" "rtsx_pci_sdmmc" ]; + boot.initrd.availableKernelModules = + [ "xhci_pci" "ehci_pci" "ahci" "usb_storage" "sd_mod" "rtsx_pci_sdmmc" ]; boot.initrd.kernelModules = [ ]; boot.kernelModules = [ "kvm-intel" ]; boot.extraModulePackages = [ ]; - fileSystems."/" = - { device = "/dev/mapper/crypted"; - fsType = "btrfs"; - options = [ "subvol=root" ]; - }; + fileSystems."/" = { + device = "/dev/mapper/crypted"; + fsType = "btrfs"; + options = [ "subvol=root" ]; + }; - boot.initrd.luks.devices."crypted".device = "/dev/disk/by-uuid/1ca0c5f6-3cb3-4f86-94a5-4376461da227"; + boot.initrd.luks.devices."crypted".device = + "/dev/disk/by-uuid/1ca0c5f6-3cb3-4f86-94a5-4376461da227"; - fileSystems."/boot" = - { device = "/dev/disk/by-uuid/4BD8-A887"; - fsType = "vfat"; - options = [ "fmask=0077" "dmask=0077" ]; - }; + fileSystems."/boot" = { + device = "/dev/disk/by-uuid/4BD8-A887"; + fsType = "vfat"; + options = [ "fmask=0077" "dmask=0077" ]; + }; - fileSystems."/home" = - { device = "/dev/mapper/crypted"; - fsType = "btrfs"; - options = [ "subvol=home" ]; - }; + fileSystems."/home" = { + device = "/dev/mapper/crypted"; + fsType = "btrfs"; + options = [ "subvol=home" "compress=zstd" "noatime" ]; + }; - fileSystems."/nix" = - { device = "/dev/mapper/crypted"; - fsType = "btrfs"; - options = [ "subvol=nix" ]; - }; + fileSystems."/nix" = { + device = "/dev/mapper/crypted"; + fsType = "btrfs"; + options = [ "subvol=nix" "compress=zstd" "noatime" ]; + }; - fileSystems."/persist" = - { device = "/dev/mapper/crypted"; - fsType = "btrfs"; - options = [ "subvol=persist" ]; - }; + fileSystems."/persist" = { + device = "/dev/mapper/crypted"; + fsType = "btrfs"; + options = [ "subvol=persist" "compress=zstd" "noatime" ]; + neededForBoot = true; + }; - fileSystems."/swap" = - { device = "/dev/mapper/crypted"; - fsType = "btrfs"; - options = [ "subvol=swap" ]; - }; + fileSystems."/swap" = { + device = "/dev/mapper/crypted"; + fsType = "btrfs"; + options = [ "subvol=swap" ]; + }; - fileSystems."/var/log" = - { device = "/dev/mapper/crypted"; - fsType = "btrfs"; - options = [ "subvol=log" ]; - }; + fileSystems."/var/log" = { + device = "/dev/mapper/crypted"; + fsType = "btrfs"; + options = [ "subvol=log" "compress=zstd" "noatime" ]; + neededForBoot = true; + }; swapDevices = [ ]; nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; - hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; + hardware.cpu.intel.updateMicrocode = + lib.mkDefault config.hardware.enableRedistributableFirmware; } diff --git a/modules/home/impermanence.nix b/modules/home/impermanence.nix index 7a7a461..b2dee21 100644 --- a/modules/home/impermanence.nix +++ b/modules/home/impermanence.nix @@ -3,7 +3,6 @@ let fs-diff = with pkgs; writeShellApplication { name = "fs-diff"; - runtimeInputs = [ flameshot curl xsel ]; text = '' #!/usr/bin/env bash # fs-diff.sh @@ -36,7 +35,7 @@ let in with lib; { config = mkIf osConfig.mods.impermanence.enable { home.packages = [ fs-diff ]; - # home.persistence."/persistent/home/muon" = { + # home.persistence."/persist/home/muon" = { # directories = [ # "documents" # "downloads" diff --git a/modules/nixos/impermanence.nix b/modules/nixos/impermanence.nix index 2871d4a..2ca5297 100644 --- a/modules/nixos/impermanence.nix +++ b/modules/nixos/impermanence.nix @@ -3,15 +3,19 @@ with lib; { options.mods.impermanence.enable = mkEnableOption "enables impermanence"; config = mkIf config.mods.impermanence.enable { - # environment.persistence."/persistent" = { - # directories = [ - # "/var/lib/bluetooth" - # "/var/lib/nixos" - # "/var/lib/systemd/coredump" - # "/etc/NetworkManager/system-connections" - # ]; - # files = [ "/etc/machine-id" ]; - # }; + environment.persistence."/persist" = { + directories = + [ "/var/lib/nixos" "/var/lib/systemd/coredump" "/etc/nixos" ]; + files = [ + "/etc/machine-id" + "/etc/passwd" + "/etc/group" + "/etc/shadow" + "/etc/subgid" + "/etc/subuid" + "/etc/sudoers" + ]; + }; boot.initrd.postResumeCommands = lib.mkAfter '' mkdir /btrfs_tmp