diff --git a/flake/checks.nix b/flake/checks.nix index 01c2a7b..256d5c9 100644 --- a/flake/checks.nix +++ b/flake/checks.nix @@ -6,16 +6,10 @@ checks = { treefmt = (import ./treefmt.nix { inherit inputs pkgs; }).check self; - statix = - let - statix-config = pkgs.writeText "statix.toml" '' - disabled = ["repeated_keys"] - ''; - in - pkgs.runCommand "statix" { buildInputs = [ pkgs.statix ]; } '' - statix check ${self} --config ${statix-config} - mkdir $out - ''; + statix = pkgs.runCommand "statix" { buildInputs = [ pkgs.statix ]; } '' + statix check ${self} + mkdir $out + ''; deadnix = pkgs.runCommand "deadnix" { buildInputs = [ pkgs.deadnix ]; } '' deadnix ${self} --fail --exclude ${self}/flake/formatter.nix diff --git a/hosts/inspiron/hardware.nix b/hosts/inspiron/hardware.nix index ee68699..c7e8048 100644 --- a/hosts/inspiron/hardware.nix +++ b/hosts/inspiron/hardware.nix @@ -6,19 +6,27 @@ ]; nixpkgs.hostPlatform = "x86_64-linux"; - hardware.enableRedistributableFirmware = true; - hardware.cpu.amd.updateMicrocode = true; - boot.kernelModules = [ "kvm-amd" ]; - boot.initrd.kernelModules = [ "usb_storage" ]; - boot.initrd.availableKernelModules = [ - "nvme" - "xhci_pci" - "ahci" - "sd_mod" - ]; + + hardware = { + enableRedistributableFirmware = true; + cpu.amd.updateMicrocode = true; + }; + + boot = { + kernelModules = [ "kvm-amd" ]; + initrd.kernelModules = [ "usb_storage" ]; + initrd.availableKernelModules = [ + "nvme" + "xhci_pci" + "ahci" + "sd_mod" + ]; + }; zramSwap.enable = true; - services.fstrim.enable = true; - services.fwupd.enable = true; - services.auto-cpufreq.enable = true; + services = { + fstrim.enable = true; + fwupd.enable = true; + auto-cpufreq.enable = true; + }; } diff --git a/hosts/north/hardware.nix b/hosts/north/hardware.nix index cac5113..2f31bf0 100644 --- a/hosts/north/hardware.nix +++ b/hosts/north/hardware.nix @@ -12,21 +12,27 @@ ]; nixpkgs.hostPlatform = "x86_64-linux"; - hardware.enableRedistributableFirmware = true; - hardware.cpu.amd.updateMicrocode = true; - boot.kernelModules = [ - "kvm-amd" - "k10temp" - "nct6775" - ]; - boot.initrd.availableKernelModules = [ - "xhci_pci" - "ahci" - "nvme" - "usb_storage" - "usbhid" - "sd_mod" - ]; + + hardware = { + enableRedistributableFirmware = true; + cpu.amd.updateMicrocode = true; + }; + + boot = { + kernelModules = [ + "kvm-amd" + "k10temp" + "nct6775" + ]; + initrd.availableKernelModules = [ + "xhci_pci" + "ahci" + "nvme" + "usb_storage" + "usbhid" + "sd_mod" + ]; + }; zramSwap.enable = true; services.fstrim.enable = true; diff --git a/modules/home/git.nix b/modules/home/git.nix index 9d7fff5..5d7040d 100644 --- a/modules/home/git.nix +++ b/modules/home/git.nix @@ -3,18 +3,22 @@ options.myConfig.git.enable = lib.mkEnableOption ""; config = lib.mkIf config.myConfig.git.enable { - programs.git = { - enable = true; - userName = "SebastianStork"; - userEmail = "sebastian.stork@pm.me"; - extraConfig.init.defaultBranch = "main"; - }; - programs.lazygit.enable = true; - sops.secrets.github-ssh-key.path = "${config.home.homeDirectory}/.ssh/github"; - programs.ssh = { - enable = true; - matchBlocks."github.com".identityFile = "~/.ssh/github"; + + programs = { + git = { + enable = true; + userName = "SebastianStork"; + userEmail = "sebastian.stork@pm.me"; + extraConfig.init.defaultBranch = "main"; + }; + + lazygit.enable = true; + + ssh = { + enable = true; + matchBlocks."github.com".identityFile = "~/.ssh/github"; + }; }; }; } diff --git a/modules/home/shell/default.nix b/modules/home/shell/default.nix index 1140dbc..cda32a9 100644 --- a/modules/home/shell/default.nix +++ b/modules/home/shell/default.nix @@ -8,48 +8,50 @@ options.myConfig.shell.zsh.enable = lib.mkEnableOption ""; config = lib.mkIf config.myConfig.shell.zsh.enable { - programs.zsh = { - enable = true; - dotDir = ".config/zsh"; + programs = { + zsh = { + enable = true; + dotDir = ".config/zsh"; - autocd = true; - autosuggestion.enable = true; - syntaxHighlighting.enable = true; - history = { - ignoreAllDups = true; - path = "${config.xdg.dataHome}/zsh/zsh_history"; + autocd = true; + autosuggestion.enable = true; + syntaxHighlighting.enable = true; + history = { + ignoreAllDups = true; + path = "${config.xdg.dataHome}/zsh/zsh_history"; + }; + + plugins = [ + { + name = "fzf-tab"; + src = pkgs.zsh-fzf-tab; + file = "share/fzf-tab/fzf-tab.plugin.zsh"; + } + ]; + + initExtra = '' + zstyle ':completion:*' matcher-list 'm:{a-z}={A-Za-Z}' + zstyle ':completion:*' list-colors ''${(s.:.)LS_COLORS} + zstyle ':completion:*' menu no + zstyle ':fzf-tab:complete:cd:*' fzf-preview 'ls $realpath' + + bindkey "^[[1;5D" backward-word + bindkey "^[[1;5C" forward-word + ''; }; - plugins = [ - { - name = "fzf-tab"; - src = pkgs.zsh-fzf-tab; - file = "share/fzf-tab/fzf-tab.plugin.zsh"; - } - ]; + fzf.enable = true; - initExtra = '' - zstyle ':completion:*' matcher-list 'm:{a-z}={A-Za-Z}' - zstyle ':completion:*' list-colors ''${(s.:.)LS_COLORS} - zstyle ':completion:*' menu no - zstyle ':fzf-tab:complete:cd:*' fzf-preview 'ls $realpath' + zoxide = { + enable = true; + options = [ "--cmd cd" ]; + }; - bindkey "^[[1;5D" backward-word - bindkey "^[[1;5C" forward-word - ''; - }; - - programs.fzf.enable = true; - - programs.zoxide = { - enable = true; - options = [ "--cmd cd" ]; - }; - - programs.direnv = { - enable = true; - nix-direnv.enable = true; - config.global.hide_env_diff = true; + direnv = { + enable = true; + nix-direnv.enable = true; + config.global.hide_env_diff = true; + }; }; }; } diff --git a/modules/system/auto-gc.nix b/modules/system/auto-gc.nix index 990b863..9a17c1d 100644 --- a/modules/system/auto-gc.nix +++ b/modules/system/auto-gc.nix @@ -3,11 +3,13 @@ options.myConfig.auto-gc.enable = lib.mkEnableOption ""; config = lib.mkIf config.myConfig.auto-gc.enable { - programs.nh.enable = true; - programs.nh.clean = { + programs.nh = { enable = true; - dates = "daily"; - extraArgs = "--keep 10 --keep-since 3d"; + clean = { + enable = true; + dates = "daily"; + extraArgs = "--keep 10 --keep-since 3d"; + }; }; }; } diff --git a/modules/system/bluetooth.nix b/modules/system/bluetooth.nix index b6e6f29..b26d000 100644 --- a/modules/system/bluetooth.nix +++ b/modules/system/bluetooth.nix @@ -3,11 +3,14 @@ options.myConfig.bluetooth.enable = lib.mkEnableOption ""; config = lib.mkIf config.myConfig.bluetooth.enable { - hardware.bluetooth = { - enable = true; - powerOnBoot = true; + hardware = { + bluetooth = { + enable = true; + powerOnBoot = true; + }; + logitech.wireless.enable = true; }; + services.blueman.enable = true; - hardware.logitech.wireless.enable = true; }; } diff --git a/modules/system/boot/loader.nix b/modules/system/boot/loader.nix index 6f2c089..b9f0b46 100644 --- a/modules/system/boot/loader.nix +++ b/modules/system/boot/loader.nix @@ -3,15 +3,17 @@ options.myConfig.boot.loader.systemd-boot.enable = lib.mkEnableOption ""; config = lib.mkIf config.myConfig.boot.loader.systemd-boot.enable { - boot.tmp.cleanOnBoot = true; - boot.loader = { - systemd-boot = { - enable = true; - editor = false; - configurationLimit = 20; + boot = { + tmp.cleanOnBoot = true; + loader = { + systemd-boot = { + enable = true; + editor = false; + configurationLimit = 20; + }; + efi.canTouchEfiVariables = true; + timeout = 0; }; - efi.canTouchEfiVariables = true; - timeout = 0; }; systemd.watchdog.rebootTime = "10"; }; diff --git a/modules/system/boot/silent.nix b/modules/system/boot/silent.nix index 2d48489..1548b3d 100644 --- a/modules/system/boot/silent.nix +++ b/modules/system/boot/silent.nix @@ -10,9 +10,11 @@ "rd.udev.log_level=3" "udev.log_priority=3" ]; + initrd = { + verbose = false; + systemd.enable = true; + }; consoleLogLevel = 3; - initrd.verbose = false; - initrd.systemd.enable = true; plymouth.enable = true; }; }; diff --git a/modules/system/comma.nix b/modules/system/comma.nix index 98cf7c8..f0157d6 100644 --- a/modules/system/comma.nix +++ b/modules/system/comma.nix @@ -13,8 +13,10 @@ in options.myConfig.comma.enable = lib.mkEnableOption ""; config = { - programs.command-not-found.enable = !cfg.enable; - programs.nix-index.enable = cfg.enable; - programs.nix-index-database.comma.enable = cfg.enable; + programs = { + command-not-found.enable = !cfg.enable; + nix-index.enable = cfg.enable; + nix-index-database.comma.enable = cfg.enable; + }; }; } diff --git a/modules/system/printing.nix b/modules/system/printing.nix index 0b56c35..8818d38 100644 --- a/modules/system/printing.nix +++ b/modules/system/printing.nix @@ -3,11 +3,13 @@ options.myConfig.printing.enable = lib.mkEnableOption ""; config = lib.mkIf config.myConfig.printing.enable { - services.printing.enable = true; - services.avahi = { - enable = true; - nssmdns4 = true; - openFirewall = true; + services = { + printing.enable = true; + avahi = { + enable = true; + nssmdns4 = true; + openFirewall = true; + }; }; }; } diff --git a/modules/system/sound.nix b/modules/system/sound.nix index cae033c..e7e2bb5 100644 --- a/modules/system/sound.nix +++ b/modules/system/sound.nix @@ -8,9 +8,11 @@ services.pipewire = { enable = true; wireplumber.enable = true; - alsa.enable = true; - alsa.support32Bit = true; pulse.enable = true; + alsa = { + enable = true; + support32Bit = true; + }; }; }; }