diff --git a/hosts/common/configs/getty/default.nix b/hosts/common/configs/getty/default.nix new file mode 100644 index 0000000..23d3241 --- /dev/null +++ b/hosts/common/configs/getty/default.nix @@ -0,0 +1,10 @@ +{ config, lib, ... }: + +{ + services.getty.extraArgs = lib.mkIf (config.services.getty.autologinUser != null) [ + "--skip-login" + "--noissue" + "--nohints" + "--nohostname" + ]; +} diff --git a/hosts/common/configs/persist/default.nix b/hosts/common/configs/persist/default.nix index 7f41615..4f79cb3 100644 --- a/hosts/common/configs/persist/default.nix +++ b/hosts/common/configs/persist/default.nix @@ -1,10 +1,35 @@ -{ inputs, lib, ... }: +{ inputs, pkgs, ... }: { imports = [ inputs.impermanence.nixosModules.impermanence ]; + boot.initrd.systemd = + let + bins = with pkgs; [ + coreutils + util-linux + findutils + btrfs-progs + ]; + in + { + initrdBin = bins; + + services.impermanence = { + description = "Rollback BTRFS subvolumes to a pristine state"; + + serviceConfig.Type = "oneshot"; + wantedBy = [ "initrd.target" ]; + before = [ "sysroot.mount" ]; + after = [ "cryptsetup.target" ]; + unitConfig.DefaultDependencies = "no"; + + path = bins; + script = builtins.readFile ./impermanence.sh; + }; + }; + fileSystems."/persist".neededForBoot = true; - boot.initrd.postDeviceCommands = lib.mkAfter (builtins.readFile ./impermanence.sh); environment.persistence."/persist" = { hideMounts = true; diff --git a/hosts/common/configs/plymouth/default.nix b/hosts/common/configs/plymouth/default.nix new file mode 100644 index 0000000..25cb4e7 --- /dev/null +++ b/hosts/common/configs/plymouth/default.nix @@ -0,0 +1,30 @@ +{ pkgs, ... }: + +{ + boot = { + plymouth = + let + theme = "connect"; + in + { + enable = true; + inherit theme; + themePackages = with pkgs; [ + (adi1090x-plymouth-themes.override { selected_themes = [ theme ]; }) + ]; + }; + + initrd.verbose = false; + consoleLogLevel = 0; + + kernelParams = [ + "quiet" + "loglevel=3" + "splash" + "boot.shell_on_fail" + "rd.systemd.show_status=false" + "rd.udev.log_level=3" + "udev.log_priority=3" + ]; + }; +} diff --git a/hosts/common/default.nix b/hosts/common/default.nix index 689548b..92064fd 100644 --- a/hosts/common/default.nix +++ b/hosts/common/default.nix @@ -4,6 +4,8 @@ imports = [ ./configs/persist ./configs/sops + ./configs/getty + ./configs/plymouth ./configs/brightnessctl ./configs/pipewire ./configs/zsh @@ -22,16 +24,18 @@ boot = { loader = { - systemd-boot.enable = true; - timeout = 3; + systemd-boot = { + enable = true; + editor = false; + }; + + timeout = 1; efi.canTouchEfiVariables = true; }; + initrd.systemd.enable = true; kernelPackages = pkgs.linuxPackages_latest; supportedFilesystems = [ "btrfs" "ntfs" ]; - kernelParams = [ "loglevel=3" "quiet" ]; - initrd.verbose = false; - consoleLogLevel = 0; }; networking.networkmanager.enable = true; diff --git a/hosts/common/scripts/cleanup/default.nix b/hosts/common/scripts/cleanup/default.nix index c44d027..3b26f47 100644 --- a/hosts/common/scripts/cleanup/default.nix +++ b/hosts/common/scripts/cleanup/default.nix @@ -6,8 +6,9 @@ name = "nix-cleanup"; runtimeInputs = with pkgs; [ coreutils-full - btrfs-progs util-linux + findutils + btrfs-progs nix ]; text = builtins.readFile ./cleanup.sh; diff --git a/users/common/options/home-manager/theme/default.nix b/users/common/options/home-manager/theme/default.nix index 0301ffa..0edb35a 100644 --- a/users/common/options/home-manager/theme/default.nix +++ b/users/common/options/home-manager/theme/default.nix @@ -7,7 +7,7 @@ let runtimeInputs = with pkgs; [ coreutils-full ]; bashOptions = [ "nounset" "pipefail" ]; text = '' - if [ -z "$WAYLAND_DISPLAY" ]; then + if [ -z "''${WAYLAND_DISPLAY:-}" ]; then echo "No Wayland session active. Exiting." exit 0 fi