diff --git a/flake.nix b/flake.nix index 0b1dbec..c56f93f 100644 --- a/flake.nix +++ b/flake.nix @@ -12,38 +12,48 @@ }; }; - outputs = { self, nixpkgs, home-manager, ... }: - let - lib = nixpkgs.lib; - userVars = import ./vars.nix; + outputs = + { + self, + nixpkgs, + home-manager, + ... + }: + let + lib = nixpkgs.lib; + userVars = import ./vars.nix; - hostsDir = ./hosts; - hostNames = builtins.attrNames ( - lib.filterAttrs (name: type: type == "directory") (builtins.readDir hostsDir) - ); + hostsDir = ./hosts; + hostNames = builtins.attrNames ( + lib.filterAttrs (name: type: type == "directory") (builtins.readDir hostsDir) + ); - nixosConfigurations = lib.genAttrs hostNames (name: - let - hostConfig = import (./hosts + "/${name}"); - in - lib.nixosSystem { - system = hostConfig.system; - specialArgs = { inherit userVars; }; - modules = [ hostConfig.configModule ] ++ [ - home-manager.nixosModules.home-manager - { - home-manager = { - useGlobalPkgs = true; - useUserPackages = true; - extraSpecialArgs = { inherit userVars; }; - backupFileExtension = "backup"; - }; - } - ]; - } - ); - in - { - inherit nixosConfigurations; - }; + nixosConfigurations = lib.genAttrs hostNames ( + name: + let + hostConfig = import (./hosts + "/${name}"); + in + lib.nixosSystem { + system = hostConfig.system; + specialArgs = { inherit userVars; }; + modules = [ + hostConfig.configModule + ] + ++ [ + home-manager.nixosModules.home-manager + { + home-manager = { + useGlobalPkgs = true; + useUserPackages = true; + extraSpecialArgs = { inherit userVars; }; + backupFileExtension = "backup"; + }; + } + ]; + } + ); + in + { + inherit nixosConfigurations; + }; } diff --git a/hosts/nabro/default.nix b/hosts/nabro/default.nix index 352ebf2..88ecb4b 100644 --- a/hosts/nabro/default.nix +++ b/hosts/nabro/default.nix @@ -1,21 +1,28 @@ { system = "x86_64-linux"; - configModule = { config, lib, pkgs, ... }: { - imports = [ - ./hardware-configuration.nix - ../../modules - ]; + configModule = + { + config, + lib, + pkgs, + ... + }: + { + imports = [ + ./hardware-configuration.nix + ../../modules + ]; - networking.hostName = "nabro"; + networking.hostName = "nabro"; - dotfiles = { - core.enable = true; - user.enable = true; - desktop.enable = true; - dev.enable = true; - shell.enable = true; - zsh.enable = true; - helix.enable = true; + dotfiles = { + core.enable = true; + user.enable = true; + desktop.enable = true; + dev.enable = true; + shell.enable = true; + zsh.enable = true; + helix.enable = true; + }; }; - }; } diff --git a/hosts/nabro/hardware-configuration.nix b/hosts/nabro/hardware-configuration.nix index 4feba8e..00c7288 100644 --- a/hosts/nabro/hardware-configuration.nix +++ b/hosts/nabro/hardware-configuration.nix @@ -1,14 +1,26 @@ # Do not modify this file! It was generated by ‘nixos-generate-config’ # and may be overwritten by future invocations. Please make changes # to /etc/nixos/configuration.nix instead. -{ config, lib, pkgs, modulesPath, ... }: +{ + config, + lib, + pkgs, + modulesPath, + ... +}: { - imports = - [ (modulesPath + "/installer/scan/not-detected.nix") - ]; + imports = [ + (modulesPath + "/installer/scan/not-detected.nix") + ]; - boot.initrd.availableKernelModules = [ "xhci_pci" "ahci" "usb_storage" "sd_mod" "rtsx_usb_sdmmc" ]; + boot.initrd.availableKernelModules = [ + "xhci_pci" + "ahci" + "usb_storage" + "sd_mod" + "rtsx_usb_sdmmc" + ]; boot.initrd.kernelModules = [ ]; boot.kernelModules = [ "kvm-intel" ]; boot.extraModulePackages = [ ]; @@ -18,37 +30,41 @@ "resume_offset=2017177" ]; - fileSystems."/" = - { device = "/dev/mapper/cryproot"; - fsType = "btrfs"; - options = [ "subvol=root" ]; - }; + fileSystems."/" = { + device = "/dev/mapper/cryproot"; + fsType = "btrfs"; + options = [ "subvol=root" ]; + }; - boot.initrd.luks.devices."cryproot".device = "/dev/disk/by-uuid/e667143a-7965-4f53-bf2b-e91a3c9c4c13"; + boot.initrd.luks.devices."cryproot".device = + "/dev/disk/by-uuid/e667143a-7965-4f53-bf2b-e91a3c9c4c13"; - fileSystems."/home" = - { device = "/dev/mapper/cryproot"; - fsType = "btrfs"; - options = [ "subvol=home" ]; - }; + fileSystems."/home" = { + device = "/dev/mapper/cryproot"; + fsType = "btrfs"; + options = [ "subvol=home" ]; + }; - fileSystems."/nix" = - { device = "/dev/mapper/cryproot"; - fsType = "btrfs"; - options = [ "subvol=nix" ]; - }; + fileSystems."/nix" = { + device = "/dev/mapper/cryproot"; + fsType = "btrfs"; + options = [ "subvol=nix" ]; + }; - fileSystems."/swap" = - { device = "/dev/mapper/cryproot"; - fsType = "btrfs"; - options = [ "subvol=swap" ]; - }; + fileSystems."/swap" = { + device = "/dev/mapper/cryproot"; + fsType = "btrfs"; + options = [ "subvol=swap" ]; + }; - fileSystems."/boot" = - { device = "/dev/disk/by-uuid/AB4A-C5EA"; - fsType = "vfat"; - options = [ "fmask=0022" "dmask=0022" ]; - }; + fileSystems."/boot" = { + device = "/dev/disk/by-uuid/AB4A-C5EA"; + fsType = "vfat"; + options = [ + "fmask=0022" + "dmask=0022" + ]; + }; swapDevices = [ { diff --git a/modules/core.nix b/modules/core.nix index 9050a4f..e705fdd 100644 --- a/modules/core.nix +++ b/modules/core.nix @@ -1,4 +1,9 @@ -{ config, lib, pkgs, ... }: +{ + config, + lib, + pkgs, + ... +}: let cfg = config.dotfiles.core; @@ -12,6 +17,17 @@ in boot.loader.systemd-boot.enable = true; boot.loader.efi.canTouchEfiVariables = true; boot.kernelPackages = pkgs.linuxPackages_latest; + boot.consoleLogLevel = 0; + boot.initrd.verbose = false; + boot.kernelParams = [ + "quiet" + "splash" + "boot.shell_on_fail" + "loglevel=3" + "rd.systemd.show_status=false" + "rd.udev.log_level=3" + "udev.log_priority=3" + ]; time.timeZone = "Europe/Berlin"; @@ -21,7 +37,10 @@ in nix = { settings = { - experimental-features = [ "nix-command" "flakes" ]; + experimental-features = [ + "nix-command" + "flakes" + ]; auto-optimise-store = true; }; gc = { diff --git a/modules/default.nix b/modules/default.nix index 2e5363f..3c8efa7 100644 --- a/modules/default.nix +++ b/modules/default.nix @@ -1,4 +1,9 @@ -{ config, lib, pkgs, ... }: +{ + config, + lib, + pkgs, + ... +}: { imports = [ diff --git a/modules/desktop.nix b/modules/desktop.nix index 952d990..1669668 100644 --- a/modules/desktop.nix +++ b/modules/desktop.nix @@ -1,4 +1,10 @@ -{ config, lib, pkgs, userVars, ... }: +{ + config, + lib, + pkgs, + userVars, + ... +}: let cfg = config.dotfiles.desktop; @@ -28,13 +34,16 @@ in ]; fonts.fontconfig.defaultFonts = { - monospace = [ "JetBrainsMono Nerd Font" "Noto Sans Mono" ]; + monospace = [ + "JetBrainsMono Nerd Font" + "Noto Sans Mono" + ]; emoji = [ "Noto Color Emoji" ]; }; hardware.graphics.enable = true; security.polkit.enable = true; - security.pam.services.swaylock = {}; + security.pam.services.swaylock = { }; services.getty.autologinUser = "${userVars.username}"; @@ -87,8 +96,15 @@ in lock = "${pkgs.swaylock-effects}/bin/swaylock -f"; }; timeouts = [ - { timeout = 300; command = "${pkgs.swaylock-effects}/bin/swaylock -f"; } - { timeout = 600; command = "${pkgs.wlopm}/bin/wlopm --off '*'"; resumeCommand = "${pkgs.wlopm}/bin/wlopm --on '*'"; } + { + timeout = 300; + command = "${pkgs.swaylock-effects}/bin/swaylock -f"; + } + { + timeout = 600; + command = "${pkgs.wlopm}/bin/wlopm --off '*'"; + resumeCommand = "${pkgs.wlopm}/bin/wlopm --on '*'"; + } ]; }; diff --git a/modules/dev.nix b/modules/dev.nix index 6f119ed..c7575d1 100644 --- a/modules/dev.nix +++ b/modules/dev.nix @@ -1,4 +1,9 @@ -{ config, lib, pkgs, ... }: +{ + config, + lib, + pkgs, + ... +}: let cfg = config.dotfiles.dev; diff --git a/modules/shell/default.nix b/modules/shell/default.nix index f19128f..bca1e04 100644 --- a/modules/shell/default.nix +++ b/modules/shell/default.nix @@ -1,12 +1,18 @@ -{ config, lib, pkgs, userVars, ... }: +{ + config, + lib, + pkgs, + userVars, + ... +}: let cfg = config.dotfiles.shell; shellDir = ./.; - otherShellFiles = builtins.filter - (name: name != "default.nix" && lib.strings.hasSuffix ".nix" name) - (builtins.attrNames (builtins.readDir shellDir)); + otherShellFiles = builtins.filter ( + name: name != "default.nix" && lib.strings.hasSuffix ".nix" name + ) (builtins.attrNames (builtins.readDir shellDir)); importedModules = map (file: shellDir + "/${file}") otherShellFiles; in { @@ -55,7 +61,6 @@ in pinentry.package = pkgs.pinentry-qt; }; - }; }; } diff --git a/modules/shell/helix.nix b/modules/shell/helix.nix index 14367c9..74ce005 100644 --- a/modules/shell/helix.nix +++ b/modules/shell/helix.nix @@ -35,7 +35,10 @@ in auto-info = true; rulers = [ 80 ]; bufferline = "multiple"; - shell = [ "zsh" "-c" ]; + shell = [ + "zsh" + "-c" + ]; jump-label-alphabet = "asdfghjklqwertyuiopzxcvbnm"; cursor-shape = { diff --git a/modules/user.nix b/modules/user.nix index a59a6af..1cfb85a 100644 --- a/modules/user.nix +++ b/modules/user.nix @@ -1,4 +1,10 @@ -{ config, lib, pkgs, userVars, ... }: +{ + config, + lib, + pkgs, + userVars, + ... +}: let cfg = config.dotfiles.user;