From c4911b9d5f2fbd88e29d631d3b706881a5351fc4 Mon Sep 17 00:00:00 2001 From: mjallen18 Date: Wed, 3 Sep 2025 17:54:33 -0500 Subject: [PATCH] fixes --- flake.lock | 6 +- flake.nix | 4 +- .../matt@macbook-pro-nixos/default.nix | 2 +- lib/default.nix | 6 +- lib/examples/default.nix | 2 +- lib/examples/file-utils.nix | 38 +++++----- lib/examples/home-sops.nix | 13 +++- lib/examples/sops.nix | 24 +++--- lib/examples/system-utils.nix | 67 +++++++++++------ lib/system/common.nix | 10 ++- modules/home/sops/default.nix | 1 - modules/nixos/boot/common/default.nix | 72 +++++++++++++----- modules/nixos/boot/systemd-boot/default.nix | 9 ++- modules/nixos/desktop/hyprland/options.nix | 13 +++- .../desktop/hyprland/wallpapers/default.nix | 10 ++- modules/nixos/disko/x86_64-linux/default.nix | 1 + .../nixos/hardware/raspberry-pi/default.nix | 26 +++---- modules/nixos/impermanence/default.nix | 56 +++++++------- modules/nixos/network/default.nix | 25 ++++--- modules/nixos/network/options.nix | 42 +++++++---- modules/nixos/power/default.nix | 9 ++- modules/nixos/security/tpm/default.nix | 9 ++- modules/nixos/services/nextcloud/default.nix | 2 +- modules/nixos/services/samba/default.nix | 7 +- modules/nixos/sops/options.nix | 5 +- .../aarch64-darwin/macbook-pro/settings.nix | 2 +- .../macbook-pro-nixos/default.nix | 75 ++++++++++--------- .../macbook-pro-nixos/services.nix | 12 ++- systems/aarch64-linux/pi4/default.nix | 2 +- systems/x86_64-linux/jallen-nas/default.nix | 2 +- systems/x86_64-linux/steamdeck/default.nix | 10 --- 31 files changed, 339 insertions(+), 223 deletions(-) diff --git a/flake.lock b/flake.lock index 8ff5a53..5536f45 100644 --- a/flake.lock +++ b/flake.lock @@ -1063,11 +1063,11 @@ }, "nixpkgs_13": { "locked": { - "lastModified": 1756542300, - "narHash": "sha256-tlOn88coG5fzdyqz6R93SQL5Gpq+m/DsWpekNFhqPQk=", + "lastModified": 1756787288, + "narHash": "sha256-rw/PHa1cqiePdBxhF66V7R+WAP8WekQ0mCDG4CFqT8Y=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "d7600c775f877cd87b4f5a831c28aa94137377aa", + "rev": "d0fc30899600b9b3466ddb260fd83deb486c32f1", "type": "github" }, "original": { diff --git a/flake.nix b/flake.nix index 9ede912..9d4604f 100644 --- a/flake.nix +++ b/flake.nix @@ -263,10 +263,10 @@ outputs-builder = channels: { formatter = inputs.treefmt-nix.lib.mkWrapper channels.nixpkgs ./treefmt.nix; - + # Add mjallen-lib to the flake outputs overlays = { - mjallen-lib = final: prev: { + mjallen-lib = _final: _prev: { mjallen-lib = (import ./lib { inherit inputs; }).mjallen-lib; }; }; diff --git a/homes/aarch64-linux/matt@macbook-pro-nixos/default.nix b/homes/aarch64-linux/matt@macbook-pro-nixos/default.nix index cd0438a..d81109b 100755 --- a/homes/aarch64-linux/matt@macbook-pro-nixos/default.nix +++ b/homes/aarch64-linux/matt@macbook-pro-nixos/default.nix @@ -23,7 +23,7 @@ in home.stateVersion = "23.11"; mjallen = { - desktop.hyprland = { + programs.hyprland = { enable = true; primaryDisplay = "eDP-1"; diff --git a/lib/default.nix b/lib/default.nix index c50b4b0..f5d49c3 100644 --- a/lib/default.nix +++ b/lib/default.nix @@ -3,13 +3,13 @@ mjallen-lib = { # Import module utilities module = import ./module { inherit inputs; }; - + # Import file utilities file = import ./file { inherit inputs; }; - + # Import system utilities system = import ./system { inherit inputs; }; - + # Import examples examples = import ./examples { inherit inputs; }; }; diff --git a/lib/examples/default.nix b/lib/examples/default.nix index d9fc418..4b15ff4 100644 --- a/lib/examples/default.nix +++ b/lib/examples/default.nix @@ -1,4 +1,4 @@ -{ inputs, ... }: +{ ... }: { # Import all examples sops = import ./sops.nix; diff --git a/lib/examples/file-utils.nix b/lib/examples/file-utils.nix index e908c1f..ccd8ee4 100644 --- a/lib/examples/file-utils.nix +++ b/lib/examples/file-utils.nix @@ -1,46 +1,47 @@ { lib, ... }: let - inherit (lib.mjallen.file) - readFile - pathExists - safeImport - scanDir - getFile + inherit (lib.mjallen.file) + readFile + pathExists + safeImport + scanDir + getFile importModulesRecursive scanSystems filterNixOSSystems filterDarwinSystems - scanHomes; + scanHomes + ; in { # Example of reading a file myFileContent = readFile ./example.txt; - + # Example of checking if a file exists fileExists = pathExists ./example.txt; - + # Example of safely importing a file - myConfig = safeImport ./my-config.nix {}; - + myConfig = safeImport ./my-config.nix { }; + # Example of scanning a directory directoryContents = scanDir ./modules; - + # Example of getting a file path relative to the flake root flakeFile = getFile "flake.nix"; - + # Example of importing modules recursively modules = importModulesRecursive ./modules; - + # Example of scanning systems allSystems = scanSystems ./systems; - + # Example of filtering systems nixosSystems = filterNixOSSystems allSystems; darwinSystems = filterDarwinSystems allSystems; - + # Example of scanning homes allHomes = scanHomes ./homes; - + # Example of using these functions together nixosConfigurations = lib.mapAttrs' ( name: @@ -51,7 +52,8 @@ in inherit system; modules = [ { networking.hostName = hostname; } - ] ++ importModulesRecursive ./modules/nixos; + ] + ++ importModulesRecursive ./modules/nixos; }; } ) nixosSystems; diff --git a/lib/examples/home-sops.nix b/lib/examples/home-sops.nix index 60152c2..58b71b8 100644 --- a/lib/examples/home-sops.nix +++ b/lib/examples/home-sops.nix @@ -1,14 +1,19 @@ -{ config, lib, pkgs, ... }: +{ + config, + lib, + pkgs, + ... +}: let - inherit (lib.mjallen.module) mkModule mkOpt mkBoolOpt; + inherit (lib.mjallen.module) mkModule mkOpt; in mkModule { name = "sops"; description = "SOPS secret management for home-manager"; options = { defaultSopsFile = mkOpt lib.types.path null "Default sops file."; - - sshKeyPaths = mkOpt (lib.types.listOf lib.types.str) [] "SSH Key paths to use."; + + sshKeyPaths = mkOpt (lib.types.listOf lib.types.str) [ ] "SSH Key paths to use."; }; config = { home.packages = with pkgs; [ diff --git a/lib/examples/sops.nix b/lib/examples/sops.nix index af655d4..f2169e5 100644 --- a/lib/examples/sops.nix +++ b/lib/examples/sops.nix @@ -7,15 +7,17 @@ mkModule { description = "SOPS secret management"; options = { defaultSopsFile = mkOpt lib.types.path null "Default sops file."; - + generateAgeKey = mkBoolOpt true "Whether to automatically generate an age key if one doesn't exist."; - - ageKeyPath = mkOpt (lib.types.nullOr lib.types.str) null "Custom path to the age key file. If null, will use the default path."; - + + ageKeyPath = + mkOpt (lib.types.nullOr lib.types.str) null + "Custom path to the age key file. If null, will use the default path."; + sshKeyPaths = mkOpt (lib.types.listOf lib.types.str) [ "/etc/ssh/ssh_host_ed25519_key" ] "SSH Key paths to use."; - + validateSopsFiles = mkBoolOpt false "Whether to validate that sops files exist."; }; config = { @@ -24,11 +26,13 @@ mkModule { age = { inherit (config.mjallen.sops) generateAgeKey; - - keyFile = if config.mjallen.sops.ageKeyPath != null - then config.mjallen.sops.ageKeyPath - else "${config.users.users.${config.mjallen.user.name}.home}/.config/sops/age/keys.txt"; - + + keyFile = + if config.mjallen.sops.ageKeyPath != null then + config.mjallen.sops.ageKeyPath + else + "${config.users.users.${config.mjallen.user.name}.home}/.config/sops/age/keys.txt"; + sshKeyPaths = config.mjallen.sops.sshKeyPaths; }; }; diff --git a/lib/examples/system-utils.nix b/lib/examples/system-utils.nix index 65ae752..0679ba0 100644 --- a/lib/examples/system-utils.nix +++ b/lib/examples/system-utils.nix @@ -1,19 +1,20 @@ { inputs, ... }: let - inherit (inputs.self.mjallen-lib.system.common) + inherit (inputs.self.mjallen-lib.system.common) mkExtendedLib mkNixpkgsConfig mkHomeConfigs mkHomeManagerConfig - mkSpecialArgs; + mkSpecialArgs + ; in { # Example of creating NixOS configurations - nixosConfigurations = + nixosConfigurations = let # Get all systems allSystems = inputs.self.mjallen-lib.file.scanSystems ../systems; - + # Filter for NixOS systems nixosSystems = inputs.self.mjallen-lib.file.filterNixOSSystems allSystems; in @@ -23,16 +24,21 @@ in let # Create extended lib with mjallen-lib extendedLib = mkExtendedLib inputs.self inputs.nixpkgs; - + # Find matching home configurations for this system matchingHomes = mkHomeConfigs { flake = inputs.self; inherit system hostname; }; - + # Create home-manager configuration homeManagerConfig = mkHomeManagerConfig { - inherit extendedLib inputs system matchingHomes; + inherit + extendedLib + inputs + system + matchingHomes + ; isNixOS = true; }; in @@ -40,46 +46,55 @@ in name = hostname; value = inputs.nixpkgs.lib.nixosSystem { inherit system; - + # Pass special arguments to modules specialArgs = mkSpecialArgs { inherit inputs hostname extendedLib; username = "mjallen"; }; - + modules = [ # Set lib to extended lib { _module.args.lib = extendedLib; } - + # Configure nixpkgs { nixpkgs = { inherit system; - } // mkNixpkgsConfig inputs.self; + } + // mkNixpkgsConfig inputs.self; } - + # Import home-manager module inputs.home-manager.nixosModules.home-manager - + # Auto-inject home configurations homeManagerConfig - + # Import all nixos modules recursively ../${system}/${hostname} - ] ++ (extendedLib.mjallen.file.importModulesRecursive ../modules/nixos); + ] + ++ (extendedLib.mjallen.file.importModulesRecursive ../modules/nixos); }; } ) nixosSystems; - + # Example of creating home-manager configurations - homeConfigurations = + homeConfigurations = let # Get all homes allHomes = inputs.self.mjallen-lib.file.scanHomes ../homes; in inputs.nixpkgs.lib.mapAttrs' ( name: - { system, username, hostname, userAtHost, path, ... }: + { + system, + username, + hostname, + userAtHost, + path, + ... + }: let # Create extended lib with mjallen-lib extendedLib = mkExtendedLib inputs.self inputs.nixpkgs; @@ -91,20 +106,26 @@ in inherit system; inherit ((mkNixpkgsConfig inputs.self)) config overlays; }; - + extraSpecialArgs = { - inherit inputs hostname username system; + inherit + inputs + hostname + username + system + ; inherit (inputs) self; lib = extendedLib; }; - + modules = [ # Set lib to extended lib { _module.args.lib = extendedLib; } - + # Import the home configuration path - ] ++ (extendedLib.mjallen.file.importModulesRecursive ../modules/home); + ] + ++ (extendedLib.mjallen.file.importModulesRecursive ../modules/home); }; } ) allHomes; diff --git a/lib/system/common.nix b/lib/system/common.nix index 8e485a9..445ef7d 100644 --- a/lib/system/common.nix +++ b/lib/system/common.nix @@ -3,9 +3,13 @@ let inherit (inputs.nixpkgs.lib) filterAttrs mapAttrs'; in { - mkExtendedLib = flake: nixpkgs: nixpkgs.lib.extend (final: prev: { - mjallen = flake.mjallen-lib; - }); + mkExtendedLib = + flake: nixpkgs: + nixpkgs.lib.extend ( + _final: _prev: { + mjallen = flake.mjallen-lib; + } + ); mkNixpkgsConfig = flake: { overlays = builtins.attrValues flake.overlays; diff --git a/modules/home/sops/default.nix b/modules/home/sops/default.nix index 35dda95..23c521a 100644 --- a/modules/home/sops/default.nix +++ b/modules/home/sops/default.nix @@ -1,7 +1,6 @@ { config, lib, - namespace, ... }: let diff --git a/modules/nixos/boot/common/default.nix b/modules/nixos/boot/common/default.nix index 65e8843..75e095e 100644 --- a/modules/nixos/boot/common/default.nix +++ b/modules/nixos/boot/common/default.nix @@ -1,35 +1,69 @@ { + config, pkgs, system, lib, + namespace, ... }: +with lib; let + inherit (lib.${namespace}) mkOpt mkBoolOpt; + cfg = config.${namespace}.boot.common; isArm = ("aarch64-linux" == system) || ("aarch64-darwin" == system); in { - boot = { - kernelParams = [ - "quiet" - ]; + options.${namespace}.boot.common = { + enable = mkBoolOpt true "Enable common boot stuff"; - binfmt = lib.mkIf isArm { - registrations."x86_64-linux" = { - magicOrExtension = ''\x7fELF\x02\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x3e\x00''; - mask = ''\xff\xff\xff\xff\xff\xfe\xfe\x00\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff''; - openBinary = true; - interpreter = "${lib.getExe pkgs.box64}"; - preserveArgvZero = true; - matchCredentials = true; - fixBinary = false; + yubikeyEncryption = mkBoolOpt false "Enable Yubikey root encryption"; + + yubikeyGracePeriod = mkOpt types.int 180 "Time to wait for yubikey in seconds"; + }; + + config = mkIf cfg.enable { + boot = { + kernelParams = [ + "quiet" + ]; + + binfmt = lib.mkIf isArm { + registrations."x86_64-linux" = { + magicOrExtension = ''\x7fELF\x02\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x3e\x00''; + mask = ''\xff\xff\xff\xff\xff\xfe\xfe\x00\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff''; + openBinary = true; + interpreter = "${lib.getExe pkgs.box64}"; + preserveArgvZero = true; + matchCredentials = true; + fixBinary = false; + }; + }; + + supportedFilesystems = [ "bcachefs" ]; + + consoleLogLevel = lib.mkForce 3; + bootspec.enable = (!isArm); + + initrd = { + luks = mkIf cfg.yubikeyEncryption { + devices = { + "${config.disko.devices.disk.main.content.partitions.root.name}" = { + yubikey = { + storage = { + device = "/dev/disk/by-label/${config.disko.devices.disk.main.content.partitions.root.name}"; + fsType = config.${namespace}.hardware.disko.filesystem; + path = "/"; + }; + slot = 2; + twoFactor = false; + gracePeriod = yubikeyGracePeriod; + }; + }; + }; + }; }; }; - supportedFilesystems = [ "bcachefs" ]; - - consoleLogLevel = lib.mkForce 3; - bootspec.enable = (!isArm); + zramSwap.enable = lib.mkDefault true; }; - - zramSwap.enable = lib.mkDefault true; } diff --git a/modules/nixos/boot/systemd-boot/default.nix b/modules/nixos/boot/systemd-boot/default.nix index bd92cf1..031b727 100644 --- a/modules/nixos/boot/systemd-boot/default.nix +++ b/modules/nixos/boot/systemd-boot/default.nix @@ -1,4 +1,9 @@ -{ config, lib, namespace, ... }: +{ + config, + lib, + namespace, + ... +}: with lib; let inherit (lib.${namespace}) mkOpt; @@ -26,4 +31,4 @@ in }; }; }; -} \ No newline at end of file +} diff --git a/modules/nixos/desktop/hyprland/options.nix b/modules/nixos/desktop/hyprland/options.nix index f085d25..619594b 100644 --- a/modules/nixos/desktop/hyprland/options.nix +++ b/modules/nixos/desktop/hyprland/options.nix @@ -1,4 +1,9 @@ -{ lib, pkgs, namespace, ... }: +{ + lib, + pkgs, + namespace, + ... +}: with lib; let inherit (lib.${namespace}) mkOpt; @@ -14,9 +19,9 @@ in enable = mkEnableOption "enable hyprland desktop environment"; wallpaperSource = mkOpt (types.enum [ - "bing" - "nasa" - ]) "bing" "Source for the wallpaper (bing or nasa)"; + "bing" + "nasa" + ]) "bing" "Source for the wallpaper (bing or nasa)"; wallpaper = mkOpt types.path "/var/lib/wallpapers/current.jpg" "Path to the wallpaper folder"; diff --git a/modules/nixos/desktop/hyprland/wallpapers/default.nix b/modules/nixos/desktop/hyprland/wallpapers/default.nix index 6e1c456..28ac5ea 100644 --- a/modules/nixos/desktop/hyprland/wallpapers/default.nix +++ b/modules/nixos/desktop/hyprland/wallpapers/default.nix @@ -1,4 +1,10 @@ -{ config, lib, pkgs, namespace, ... }: +{ + config, + lib, + pkgs, + namespace, + ... +}: let cfg = config.${namespace}.desktop.hyprland; @@ -173,4 +179,4 @@ in }; }; }; -} \ No newline at end of file +} diff --git a/modules/nixos/disko/x86_64-linux/default.nix b/modules/nixos/disko/x86_64-linux/default.nix index fa2387e..49ee35e 100644 --- a/modules/nixos/disko/x86_64-linux/default.nix +++ b/modules/nixos/disko/x86_64-linux/default.nix @@ -58,6 +58,7 @@ let # BCacheFS root partition configuration bcachefsRoot = { + name = "bcachefs-root"; size = "100%"; content = { type = "bcachefs"; diff --git a/modules/nixos/hardware/raspberry-pi/default.nix b/modules/nixos/hardware/raspberry-pi/default.nix index 7ae83f7..a7c7137 100644 --- a/modules/nixos/hardware/raspberry-pi/default.nix +++ b/modules/nixos/hardware/raspberry-pi/default.nix @@ -23,20 +23,18 @@ in config = lib.mkIf cfg.enable { # Common Raspberry Pi packages - environment.systemPackages = - with pkgs; - [ - i2c-tools - libraspberrypi - raspberrypi-eeprom - raspberrypifw - raspberrypiWirelessFirmware - raspberrypi-armstubs - erofs-utils - fex - squashfuse - squashfsTools - ]; + environment.systemPackages = with pkgs; [ + i2c-tools + libraspberrypi + raspberrypi-eeprom + raspberrypifw + raspberrypiWirelessFirmware + raspberrypi-armstubs + erofs-utils + fex + squashfuse + squashfsTools + ]; # Common Bluetooth configuration systemd.services.btattach = { diff --git a/modules/nixos/impermanence/default.nix b/modules/nixos/impermanence/default.nix index edd6183..7d4704f 100755 --- a/modules/nixos/impermanence/default.nix +++ b/modules/nixos/impermanence/default.nix @@ -19,29 +19,33 @@ in }; # extraDirectories = mkOpt (types.listOf types.path) [ ] "Extra directory paths to add to impermanence"; - extraDirectories = mkOpt (types.listOf (types.either types.str (types.submodule { - options = { - directory = mkOption { - type = types.str; - description = "Directory path"; - }; - user = mkOption { - type = types.str; - default = "root"; - description = "Directory owner"; - }; - group = mkOption { - type = types.str; - default = "root"; - description = "Directory group"; - }; - mode = mkOption { - type = types.str; - default = "u=rwx,g=rx,o="; - description = "Directory permissions"; - }; - }; - }))) [ ] "Extra directory paths to add to impermanence"; + extraDirectories = mkOpt (types.listOf ( + types.either types.str ( + types.submodule { + options = { + directory = mkOption { + type = types.str; + description = "Directory path"; + }; + user = mkOption { + type = types.str; + default = "root"; + description = "Directory owner"; + }; + group = mkOption { + type = types.str; + default = "root"; + description = "Directory group"; + }; + mode = mkOption { + type = types.str; + default = "u=rwx,g=rx,o="; + description = "Directory permissions"; + }; + }; + } + ) + )) [ ] "Extra directory paths to add to impermanence"; extraFiles = mkOpt (types.listOf types.path) [ ] "Extra file paths to add to impermanence"; }; @@ -79,10 +83,12 @@ in group = "jallen-nas"; mode = "u=rwx,g=rx,o=rx"; } - ] ++ cfg.extraDirectories; + ] + ++ cfg.extraDirectories; files = [ "/etc/machine-id" - ] ++ cfg.extraFiles; + ] + ++ cfg.extraFiles; }; security.sudo.extraConfig = '' diff --git a/modules/nixos/network/default.nix b/modules/nixos/network/default.nix index a2d24e7..9a5ca4a 100644 --- a/modules/nixos/network/default.nix +++ b/modules/nixos/network/default.nix @@ -8,7 +8,7 @@ with lib; let cfg = config.${namespace}.network; - profiles = + profiles = let make = name: profile: @@ -21,16 +21,19 @@ let autoconnect-priority = profile.priority; interface-name = cfg.ipv4.interface; }; - ipv4 = - { - method = cfg.ipv4.method; - } // (if (cfg.ipv4.method == "auto") then { } - else - { - address = cfg.ipv4.address; - gateway = cfg.ipv4.gateway; - dns = cfg.ipv4.dns; - }); + ipv4 = { + method = cfg.ipv4.method; + } + // ( + if (cfg.ipv4.method == "auto") then + { } + else + { + address = cfg.ipv4.address; + gateway = cfg.ipv4.gateway; + dns = cfg.ipv4.dns; + } + ); ipv6 = { addr-gen-mode = "stable-privacy"; method = "auto"; diff --git a/modules/nixos/network/options.nix b/modules/nixos/network/options.nix index 159e3b7..d2715bf 100644 --- a/modules/nixos/network/options.nix +++ b/modules/nixos/network/options.nix @@ -53,30 +53,40 @@ in powersave = mkBoolOpt false "Whether to enable WiFi power saving."; - profiles = mkOpt (types.attrsOf ( - types.submodule { - options = { - ssid = mkOpt types.str "" "SSID of the WiFi network."; + profiles = + mkOpt + (types.attrsOf ( + types.submodule { + options = { + ssid = mkOpt types.str "" "SSID of the WiFi network."; - type = mkOpt types.str "wifi" "type of the network.(wifi/ethernet)"; + type = mkOpt types.str "wifi" "type of the network.(wifi/ethernet)"; - autoconnect = mkBoolOpt true "autoconnect to this connection"; + autoconnect = mkBoolOpt true "autoconnect to this connection"; - autoconnect-retries = mkOpt types.int (-1) "The number of times a connection should be tried when autoactivating before giving up. Zero means forever, -1 means the global default (4 times if not overridden)"; + autoconnect-retries = + mkOpt types.int (-1) + "The number of times a connection should be tried when autoactivating before giving up. Zero means forever, -1 means the global default (4 times if not overridden)"; - priority = mkOpt types.int 0 "connection priority in range -999 to 999. The higher number means higher priority."; + priority = + mkOpt types.int 0 + "connection priority in range -999 to 999. The higher number means higher priority."; - psk = mkOpt types.str "$PSK" "PSK environment variable for the WiFi password."; + psk = mkOpt types.str "$PSK" "PSK environment variable for the WiFi password."; - keyMgmt = mkOpt types.str "sae" "Key management type (e.g., sae, wpa-psk)."; + keyMgmt = mkOpt types.str "sae" "Key management type (e.g., sae, wpa-psk)."; + }; + } + )) + { + "Joey's Jungle 6G" = { + priority = -900; + }; + "Joey's Jungle 5G" = { + priority = -999; }; } - )) - { - "Joey's Jungle 6G" = { priority = -900; }; - "Joey's Jungle 5G" = { priority = -999; }; - } - "network profiles."; + "network profiles."; }; hostId = mkOpt types.str "" "Host ID for ZFS and other services."; diff --git a/modules/nixos/power/default.nix b/modules/nixos/power/default.nix index 49abf1f..1d9d925 100644 --- a/modules/nixos/power/default.nix +++ b/modules/nixos/power/default.nix @@ -1,4 +1,9 @@ -{ config, lib, namespace, ... }: +{ + config, + lib, + namespace, + ... +}: with lib; let inherit (lib.${namespace}) mkOpt; @@ -60,4 +65,4 @@ in }; }; }; -} \ No newline at end of file +} diff --git a/modules/nixos/security/tpm/default.nix b/modules/nixos/security/tpm/default.nix index b30e46e..8197960 100644 --- a/modules/nixos/security/tpm/default.nix +++ b/modules/nixos/security/tpm/default.nix @@ -1,4 +1,9 @@ -{ config, lib, namespace, ... }: +{ + config, + lib, + namespace, + ... +}: with lib; let # inherit (lib.${namespace}) mkOpt; @@ -30,4 +35,4 @@ in }; }; }; -} \ No newline at end of file +} diff --git a/modules/nixos/services/nextcloud/default.nix b/modules/nixos/services/nextcloud/default.nix index 0cd0c03..4aa6478 100755 --- a/modules/nixos/services/nextcloud/default.nix +++ b/modules/nixos/services/nextcloud/default.nix @@ -138,7 +138,7 @@ in soft_auto_provision = false; allow_multiple_user_backends = false; # auto redirect to authentik for login }; - + social_login_auto_redirect = true; }; }; diff --git a/modules/nixos/services/samba/default.nix b/modules/nixos/services/samba/default.nix index 651593e..eba5259 100755 --- a/modules/nixos/services/samba/default.nix +++ b/modules/nixos/services/samba/default.nix @@ -1,4 +1,9 @@ -{ lib, config, namespace, ... }: +{ + lib, + config, + namespace, + ... +}: with lib; let cfg = config.${namespace}.samba; diff --git a/modules/nixos/sops/options.nix b/modules/nixos/sops/options.nix index e49ab17..35d926e 100644 --- a/modules/nixos/sops/options.nix +++ b/modules/nixos/sops/options.nix @@ -28,7 +28,10 @@ with lib; type = types.listOf types.str; default = [ "/etc/ssh/ssh_host_ed25519_key" ]; description = "List of SSH key paths to use for age decryption."; - example = [ "/etc/ssh/ssh_host_ed25519_key" "/etc/ssh/ssh_host_rsa_key" ]; + example = [ + "/etc/ssh/ssh_host_ed25519_key" + "/etc/ssh/ssh_host_rsa_key" + ]; }; validateSopsFiles = mkOption { diff --git a/systems/aarch64-darwin/macbook-pro/settings.nix b/systems/aarch64-darwin/macbook-pro/settings.nix index f87f17d..abf78b8 100644 --- a/systems/aarch64-darwin/macbook-pro/settings.nix +++ b/systems/aarch64-darwin/macbook-pro/settings.nix @@ -248,4 +248,4 @@ }; }; }; -} \ No newline at end of file +} diff --git a/systems/aarch64-linux/macbook-pro-nixos/default.nix b/systems/aarch64-linux/macbook-pro-nixos/default.nix index 9eed873..8c6a41a 100755 --- a/systems/aarch64-linux/macbook-pro-nixos/default.nix +++ b/systems/aarch64-linux/macbook-pro-nixos/default.nix @@ -3,14 +3,6 @@ # https://search.nixos.org/options and in the NixOS manual (`nixos-help`). { pkgs, namespace, ... }: -let - # Displays - display = { - input = "eDP-1"; - resolution = "3456x2234"; - refreshRate = "60.00000"; - }; -in { imports = [ ./boot.nix @@ -46,39 +38,47 @@ in distrobox ]; }; - programs = { + + desktop = { hyprland = { enable = true; - primaryDisplay = "eDP-1"; - - display1 = { - input = "eDP-1"; - resolution = "3456x2234"; - refreshRate = "60.00000"; - }; - - wallpaper = [ - "${display.input}, /run/wallpaper.jpg" - ]; - - monitor = [ - "${display.input},${display.resolution}@${display.refreshRate},0x0,1.25,bitdepth,10,cm,hdr,sdrbrightness,1.2,sdrsaturation,0.98" - ]; - - workspace = [ - "name:firefox, monitor:${display.input}, default:false, special, class:(.*firefox.*)" - "name:discord, monitor:${display.input}, default:true, special, title:(.*vesktop.*), title:(.*Apple Music.*)" - "name:steam, monitor:${display.input}, default:false, special, class:(.*[Ss]team.*)" - ]; - - windowRule = [ - "size 2160 3356, tag:horizonrdp" - ]; + wallpaperSource = "nasa"; }; + gnome.enable = false; }; + # programs = { + # hyprland = { + # enable = true; + # primaryDisplay = "eDP-1"; + + # display1 = { + # input = "eDP-1"; + # resolution = "3456x2234"; + # refreshRate = "60.00000"; + # }; + + # wallpaper = [ + # "${display.input}, /run/wallpaper.jpg" + # ]; + + # monitor = [ + # "${display.input},${display.resolution}@${display.refreshRate},0x0,1.25,bitdepth,10,cm,hdr,sdrbrightness,1.2,sdrsaturation,0.98" + # ]; + + # workspace = [ + # "name:firefox, monitor:${display.input}, default:false, special, class:(.*firefox.*)" + # "name:discord, monitor:${display.input}, default:true, special, title:(.*vesktop.*), title:(.*Apple Music.*)" + # "name:steam, monitor:${display.input}, default:false, special, class:(.*[Ss]team.*)" + # ]; + + # windowRule = [ + # "size 2160 3356, tag:horizonrdp" + # ]; + # }; + # }; network = { hostName = "macbook-pro-nixos"; - wifi.enable = false; + networkmanager.enable = false; iwd = { enable = true; settings = { @@ -106,8 +106,9 @@ in nixpkgs.config.allowUnsupportedSystem = true; virtualisation = { - containers.enable = true; - podman.enable = true; + waydroid.enable = false; + # - CONFIG_ANDROID_BINDER_IPC is not enabled! + # - CONFIG_ANDROID_BINDERFS is not enabled }; # List packages installed in system profile. To search, run: diff --git a/systems/aarch64-linux/macbook-pro-nixos/services.nix b/systems/aarch64-linux/macbook-pro-nixos/services.nix index b92e589..6be1b7d 100644 --- a/systems/aarch64-linux/macbook-pro-nixos/services.nix +++ b/systems/aarch64-linux/macbook-pro-nixos/services.nix @@ -65,10 +65,14 @@ }; logind = { - lidSwitch = "suspend"; - lidSwitchExternalPower = "ignore"; - powerKey = "suspend"; - powerKeyLongPress = "poweroff"; + settings = { + Login = { + HandleLidSwitchExternalPower = "ignore"; + HandleLidSwitch = "suspend"; + HandlePowerKeyLongPress = "poweroff"; + HandlePowerKey = "suspend"; + }; + }; }; # Enable Flatpak diff --git a/systems/aarch64-linux/pi4/default.nix b/systems/aarch64-linux/pi4/default.nix index 58f1dda..a8e0b3f 100755 --- a/systems/aarch64-linux/pi4/default.nix +++ b/systems/aarch64-linux/pi4/default.nix @@ -56,7 +56,7 @@ allowedTCPPorts = [ 53 ]; allowedUDPPorts = [ 53 ]; }; - networkmanger = { + networkmanager = { profiles = { "static-enabcm6e4ei0" = { type = "ethernet"; diff --git a/systems/x86_64-linux/jallen-nas/default.nix b/systems/x86_64-linux/jallen-nas/default.nix index a921e49..0bfb08b 100755 --- a/systems/x86_64-linux/jallen-nas/default.nix +++ b/systems/x86_64-linux/jallen-nas/default.nix @@ -160,7 +160,7 @@ # ################################################### # # Samba # # # ################################################### - + samba = { enable = true; hostsAllow = "10.0.1."; diff --git a/systems/x86_64-linux/steamdeck/default.nix b/systems/x86_64-linux/steamdeck/default.nix index edb8acc..d60fb62 100644 --- a/systems/x86_64-linux/steamdeck/default.nix +++ b/systems/x86_64-linux/steamdeck/default.nix @@ -29,16 +29,6 @@ }; network = { hostName = "steamdeck"; - wifi = { - enable = true; - powersave = false; - profiles = { - "Joey's Jungle 5G" = { - ssid = "Joey's Jungle 5G"; - keyMgmt = "sae"; - }; - }; - }; }; }; }