From 771624767c3d916e2c77d352e71c07bffca8da59 Mon Sep 17 00:00:00 2001 From: Alejandro Soto Date: Tue, 3 Dec 2024 17:30:42 -0600 Subject: sys/platform/[lustrated]: initial commit, adapted from old [lustrated] repo --- home/default.nix | 1 + sys/baseline/default.nix | 9 ++++++++- sys/boot/efi.nix | 19 +++++++++++++++---- sys/hardware/epson.nix | 21 +++++++++++++-------- sys/net/interfaces.nix | 4 ++-- sys/seat/default.nix | 2 +- 6 files changed, 40 insertions(+), 16 deletions(-) diff --git a/home/default.nix b/home/default.nix index 254cde2..6944180 100644 --- a/home/default.nix +++ b/home/default.nix @@ -1,6 +1,7 @@ { flakes, ... }: { imports = [ flakes.hm-isolation.homeManagerModule + flakes.impermanence.nixosModules.home-manager.impermanence ../pki ./baseline ./desktop diff --git a/sys/baseline/default.nix b/sys/baseline/default.nix index 3cb457e..00922d0 100644 --- a/sys/baseline/default.nix +++ b/sys/baseline/default.nix @@ -1,4 +1,4 @@ -{ config, lib, pkgs, ... }: +{ config, flakes, lib, pkgs, ... }: with lib; { config = { # This value determines the NixOS release from which the default @@ -24,6 +24,13 @@ with lib; { ]; }; + home-manager = { + useGlobalPkgs = true; + useUserPackages = true; + + extraSpecialArgs = { inherit flakes; }; + }; + lib.local = pkgs.local.lib; local.boot.impermanence.directories = [ "/var/lib/dhparams" ]; diff --git a/sys/boot/efi.nix b/sys/boot/efi.nix index 35cf687..cbcefd9 100644 --- a/sys/boot/efi.nix +++ b/sys/boot/efi.nix @@ -6,8 +6,15 @@ in options.local.boot.efi = { enable = mkEnableOption "EFI with FAT32 system partition"; - esp.uuid = mkOption { - type = types.strMatching "[0-9A-F]{4}-[0-9A-F]{4}"; + esp = { + mountpoint = mkOption { + type = types.enum [ "/boot" "/boot/efi" ]; + default = "/boot"; + }; + + uuid = mkOption { + type = types.strMatching "[0-9A-F]{4}-[0-9A-F]{4}"; + }; }; removable = mkOption { @@ -20,12 +27,16 @@ in initrd.supportedFilesystems = [ "vfat" ]; loader = { - efi.canTouchEfiVariables = !cfg.removable; + efi = { + efiSysMountPoint = cfg.esp.mountpoint; + canTouchEfiVariables = !cfg.removable; + }; + grub.efiInstallAsRemovable = cfg.removable; }; }; - fileSystems."/boot" = { + fileSystems.${cfg.esp.mountpoint} = { device = "/dev/disk/by-uuid/${cfg.esp.uuid}"; fsType = "vfat"; options = [ "noatime" "umask=027" "sync" ]; diff --git a/sys/hardware/epson.nix b/sys/hardware/epson.nix index 3900a2c..66304f9 100644 --- a/sys/hardware/epson.nix +++ b/sys/hardware/epson.nix @@ -15,15 +15,20 @@ in } ]; - services.printing.enable = true; - hardware.sane.enable = true; + hardware.sane = { + enable = true; - hardware.sane.extraBackends = [ - pkgs.epkowa - ]; + extraBackends = [ + pkgs.epkowa + ]; + }; - services.printing.drivers = [ - pkgs.epson_201207w - ]; + services.printing = { + enable = true; + + drivers = [ + pkgs.epson_201207w + ]; + }; }; } diff --git a/sys/net/interfaces.nix b/sys/net/interfaces.nix index 9203c1f..38889bd 100644 --- a/sys/net/interfaces.nix +++ b/sys/net/interfaces.nix @@ -32,8 +32,8 @@ in firewall.logRefusedConnections = false; useDHCP = false; - enableIPv6 = true; - useNetworkd = true; + enableIPv6 = mkDefault true; + useNetworkd = mkDefault true; useHostResolvConf = false; wireguard.enable = true; diff --git a/sys/seat/default.nix b/sys/seat/default.nix index 45b14f1..395cb88 100644 --- a/sys/seat/default.nix +++ b/sys/seat/default.nix @@ -107,7 +107,7 @@ in xserver = mkIf (!cfg.wayland) { enable = true; videoDrivers = cfg.videoDrivers ++ [ "modesetting" "fbdev" ]; - displayManager.startx.enable = true; + displayManager.startx.enable = mkDefault true; }; }; -- cgit v1.2.3