diff --git a/checks/default.nix b/checks/default.nix index cd7d5cd..376d792 100644 --- a/checks/default.nix +++ b/checks/default.nix @@ -1,27 +1,40 @@ -{ inputs, self, lib, ... }: { - imports = [ inputs.treefmt-nix.flakeModule inputs.git-hooks-nix.flakeModule ]; +{ + inputs, + self, + lib, + ... +}: +{ + imports = [ + inputs.treefmt-nix.flakeModule + inputs.git-hooks-nix.flakeModule + ]; - perSystem = { ... }: { - treefmt.config = { - projectRootFile = ".git/config"; - programs = { - nixfmt.enable = true; + perSystem = + { ... }: + { + treefmt.config = { + projectRootFile = ".git/config"; + programs = { + nixfmt.enable = true; + deadnix.enable = false; + }; + }; + + pre-commit.settings.hooks = { + nixfmt-rfc-style.enable = true; deadnix.enable = false; }; }; - pre-commit.settings.hooks = { - nixfmt-rfc-style.enable = true; - deadnix.enable = false; + flake.checks = + let + build = _: nc: nc.config.system.build.toplevel; + in + { + x86_64-linux = lib.mapAttrs build { inherit (self.nixosConfigurations) picard; }; + aarch64-linux = lib.mapAttrs build { + inherit (self.nixosConfigurations) sisko; # pbp; + }; }; - }; - - flake.checks = let build = _: nc: nc.config.system.build.toplevel; - in { - x86_64-linux = - lib.mapAttrs build { inherit (self.nixosConfigurations) picard; }; - aarch64-linux = lib.mapAttrs build { - inherit (self.nixosConfigurations) sisko; # pbp; - }; - }; } diff --git a/flake.nix b/flake.nix index 098e393..e62a744 100644 --- a/flake.nix +++ b/flake.nix @@ -1,6 +1,5 @@ { - description = - "A complete, declarative, and reproducible configuration of my entire Nix fleet"; + description = "A complete, declarative, and reproducible configuration of my entire Nix fleet"; inputs = { flakeParts.url = "github:hercules-ci/flake-parts"; @@ -34,11 +33,12 @@ url = "github:MatthewCroughan/NixThePlanet/"; inputs.nixpkgs.follows = "nixpkgs"; }; - nixDarwin = { url = "github:LnL7/nix-darwin"; }; + nixDarwin = { + url = "github:LnL7/nix-darwin"; + }; nix-on-droid.url = "github:nix-community/nix-on-droid"; lix = { - url = - "git+https://git@git.lix.systems/lix-project/lix?rev=f6077314fa6aff862758095bb55fe844e9162a1d"; # FIXME update + url = "git+https://git@git.lix.systems/lix-project/lix?rev=f6077314fa6aff862758095bb55fe844e9162a1d"; # FIXME update flake = false; }; lix-module = { @@ -65,7 +65,8 @@ emacs-overlay.url = "github:nix-community/emacs-overlay"; }; - outputs = inputs@{ flakeParts, ... }: + outputs = + inputs@{ flakeParts, ... }: flakeParts.lib.mkFlake { inherit inputs; } { imports = [ # TODO export modules as flake outputs @@ -76,6 +77,9 @@ ./shell ./checks ]; - systems = [ "x86_64-linux" "aarch64-linux" ]; + systems = [ + "x86_64-linux" + "aarch64-linux" + ]; }; } diff --git a/hmModules/hyprland/default.nix b/hmModules/hyprland/default.nix index e10dbf0..bcc035e 100644 --- a/hmModules/hyprland/default.nix +++ b/hmModules/hyprland/default.nix @@ -16,7 +16,8 @@ let fi fi ''; -in { +in +{ imports = [ ./hyprpaper.nix ../waybar @@ -38,7 +39,9 @@ in { brightnessctl ]; - systemd.user.sessionVariables = { NIXOS_OZONE_WL = "1"; }; + systemd.user.sessionVariables = { + NIXOS_OZONE_WL = "1"; + }; services.network-manager-applet.enable = true; services.blueman-applet.enable = true; @@ -61,7 +64,9 @@ in { }; }; - qt = { enable = true; }; + qt = { + enable = true; + }; # services.kanshi = { # enable = true; @@ -91,14 +96,16 @@ in { # }; home.file.".icons/catppuccin-mocha-sapphire" = { - source = - "${pkgs.catppuccin-cursors.mochaSapphire}/share/icons/catppuccin-mocha-sapphire-cursors"; + source = "${pkgs.catppuccin-cursors.mochaSapphire}/share/icons/catppuccin-mocha-sapphire-cursors"; recursive = true; }; wayland.windowManager.hyprland = { enable = true; - plugins = with pkgs.hyprlandPlugins; [ hy3 hyprspace ]; + plugins = with pkgs.hyprlandPlugins; [ + hy3 + hyprspace + ]; # TODO migrate to structured options extraConfig = builtins.readFile ./hyprland.conf; }; diff --git a/hosts/kirk/default.nix b/hosts/kirk/default.nix index ec647ef..3b17a67 100644 --- a/hosts/kirk/default.nix +++ b/hosts/kirk/default.nix @@ -1,34 +1,42 @@ -{ fleetModules, lib, pkgs, ... }: { - imports = fleetModules [ - "common" - "ssh" - "ccr" - "nix" - "networkmanager" - "bluetooth" - "dbus" - "docker" - "fonts" - "qmk-udev" - "mosh" - "udisks2" - "xdg" - "pipewire" - "nix-development" - "virt-manager" - "ssh-initrd" - "printing" - "pam" - "wireguard-client" - "greetd" - "syncthing" - "mount-sisko" - "adb" - "binfmt" - "prometheus-exporters" - "promtail" - "syncthing" - ] ++ [ ./disko.nix ]; +{ + fleetModules, + lib, + pkgs, + ... +}: +{ + imports = + fleetModules [ + "common" + "ssh" + "ccr" + "nix" + "networkmanager" + "bluetooth" + "dbus" + "docker" + "fonts" + "qmk-udev" + "mosh" + "udisks2" + "xdg" + "pipewire" + "nix-development" + "virt-manager" + "ssh-initrd" + "printing" + "pam" + "wireguard-client" + "greetd" + "syncthing" + "mount-sisko" + "adb" + "binfmt" + "prometheus-exporters" + "promtail" + "syncthing" + ] + ++ [ ./disko.nix ]; ccr = { enable = true; @@ -70,8 +78,12 @@ }; boot.initrd.kernelModules = [ "i915" ]; - boot.initrd.availableKernelModules = - [ "nvme" "xhci_pci" "usb_storage" "sd_mod" ]; + boot.initrd.availableKernelModules = [ + "nvme" + "xhci_pci" + "usb_storage" + "sd_mod" + ]; boot.kernelModules = [ "kvm-intel" ]; boot.kernelPackages = pkgs.linuxPackages; diff --git a/hosts/picard/default.nix b/hosts/picard/default.nix index 3ecc2ef..fd17130 100644 --- a/hosts/picard/default.nix +++ b/hosts/picard/default.nix @@ -1,40 +1,49 @@ -{ fleetModules, lib, config, pkgs, ... }: { - imports = fleetModules [ - "common" - "ssh" - "ccr" - "nix" - "networkmanager" - "bluetooth" - "dbus" - "docker" - "fonts" - "qmk-udev" - "mosh" - "udisks2" - "xdg" - "pipewire" - "nix-development" - "waydroid" - "virt-manager" - "ssh-initrd" - "printing" - "pam" - "wireguard-client" - "binfmt" - "greetd" - "syncthing" - "hass-poweroff" - "forgejo-runners" - "teamviewer" - "macos-ventura" - "sunshine" - "mount-sisko" - "adb" - "guix" - "prometheus-exporters" - "promtail" - ] ++ [ ./disko.nix ]; +{ + fleetModules, + lib, + config, + pkgs, + ... +}: +{ + imports = + fleetModules [ + "common" + "ssh" + "ccr" + "nix" + "networkmanager" + "bluetooth" + "dbus" + "docker" + "fonts" + "qmk-udev" + "mosh" + "udisks2" + "xdg" + "pipewire" + "nix-development" + "waydroid" + "virt-manager" + "ssh-initrd" + "printing" + "pam" + "wireguard-client" + "binfmt" + "greetd" + "syncthing" + "hass-poweroff" + "forgejo-runners" + "teamviewer" + "macos-ventura" + "sunshine" + "mount-sisko" + "adb" + "guix" + "prometheus-exporters" + "promtail" + ] + ++ [ ./disko.nix ]; ccr = { enable = true; @@ -88,8 +97,13 @@ boot.kernelParams = [ "ip=dhcp" ]; boot.initrd.kernelModules = [ "amdgpu" ]; - boot.initrd.availableKernelModules = - [ "nvme" "xhci_pci" "ahci" "usbhid" "r8169" ]; + boot.initrd.availableKernelModules = [ + "nvme" + "xhci_pci" + "ahci" + "usbhid" + "r8169" + ]; boot.kernelModules = [ "kvm-amd" "ddcci" @@ -138,8 +152,7 @@ nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; powerManagement.cpuFreqGovernor = lib.mkDefault "schedutil"; - hardware.cpu.amd.updateMicrocode = - lib.mkDefault config.hardware.enableRedistributableFirmware; + hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; hardware.enableRedistributableFirmware = lib.mkDefault true; hardware.graphics = { diff --git a/modules/nix/default.nix b/modules/nix/default.nix index a565803..84e36c4 100644 --- a/modules/nix/default.nix +++ b/modules/nix/default.nix @@ -1,11 +1,15 @@ -{ config, lib, fleetFlake, ... }: { +{ + config, + lib, + fleetFlake, + ... +}: +{ nixpkgs.overlays = [ (final: _: { - nix-eval-job = - fleetFlake.inputs.lix-eval-jobs.packages.${final.system}.nix-eval-jobs - // { - nix = final.nix; - }; + nix-eval-job = fleetFlake.inputs.lix-eval-jobs.packages.${final.system}.nix-eval-jobs // { + nix = final.nix; + }; }) ]; @@ -17,7 +21,10 @@ settings = { auto-optimise-store = true; - trusted-users = [ "root" "@wheel" ]; + trusted-users = [ + "root" + "@wheel" + ]; netrc-file = "/etc/nix/netrc"; substituters = [ # "s3://cache?profile=default®ion=eu-south-1&scheme=https&endpoint=cache.aciceri.dev" @@ -49,29 +56,32 @@ options = "--delete-older-than 180d"; }; - registry = lib.mkForce ({ - nixpkgs.to = { - type = "path"; - path = fleetFlake.inputs.nixpkgs; - }; - n.to = { - type = "path"; - path = fleetFlake.inputs.nixpkgs; - }; - } // (lib.optionalAttrs (builtins.hasAttr "ccr" config) { - nixfleet.to = { - type = "path"; - path = "/home/${config.ccr.username}/projects/aciceri/nixfleet"; - }; - fleet.to = { - type = "path"; - path = "/home/${config.ccr.username}/projects/aciceri/nixfleet"; - }; - ccrEmacs.to = { - type = "path"; - path = "/home/${config.ccr.username}/.config/emacs"; - }; - })); + registry = lib.mkForce ( + { + nixpkgs.to = { + type = "path"; + path = fleetFlake.inputs.nixpkgs; + }; + n.to = { + type = "path"; + path = fleetFlake.inputs.nixpkgs; + }; + } + // (lib.optionalAttrs (builtins.hasAttr "ccr" config) { + nixfleet.to = { + type = "path"; + path = "/home/${config.ccr.username}/projects/aciceri/nixfleet"; + }; + fleet.to = { + type = "path"; + path = "/home/${config.ccr.username}/projects/aciceri/nixfleet"; + }; + ccrEmacs.to = { + type = "path"; + path = "/home/${config.ccr.username}/.config/emacs"; + }; + }) + ); distributedBuilds = true; buildMachines = @@ -79,16 +89,26 @@ hostName = "sisko.fleet"; system = "aarch64-linux"; maxJobs = 7; - supportedFeatures = [ "kvm" "nixos-test" "big-parallel" "benchmark" ]; + supportedFeatures = [ + "kvm" + "nixos-test" + "big-parallel" + "benchmark" + ]; protocol = "ssh-ng"; sshUser = "root"; sshKey = "/home/${config.ccr.username}/.ssh/id_rsa"; - } ++ (lib.lists.optional (config.networking.hostName == "picard") { - hostName = - "mac.staging.mlabs.city?remote-program=/run/current-system/sw/bin/nix-store"; + } + ++ (lib.lists.optional (config.networking.hostName == "picard") { + hostName = "mac.staging.mlabs.city?remote-program=/run/current-system/sw/bin/nix-store"; system = "x86_64-darwin"; maxJobs = 4; - supportedFeatures = [ "kvm" "nixos-test" "big-parallel" "benchmark" ]; + supportedFeatures = [ + "kvm" + "nixos-test" + "big-parallel" + "benchmark" + ]; protocol = "ssh"; sshUser = "root"; sshKey = "/home/${config.ccr.username}/.ssh/id_rsa"; diff --git a/packages/emacs/packages.nix b/packages/emacs/packages.nix index 6342214..2f30f68 100644 --- a/packages/emacs/packages.nix +++ b/packages/emacs/packages.nix @@ -2,7 +2,8 @@ pkgs: epkgs: let inherit (epkgs) melpaPackages nongnuPackages elpaPackages; - buildEmacsPackage = args: + buildEmacsPackage = + args: epkgs.trivialBuild { pname = args.name; inherit (args) src; @@ -26,84 +27,100 @@ let }; # *List* containing emacs packages from (M)ELPA - mainPackages = builtins.filter - # if an extra package has the same name then give precedence to it - (package: !builtins.elem package.pname (builtins.attrNames extraPackages)) - (with melpaPackages; [ - meow - meow-tree-sitter - dracula-theme - nord-theme - catppuccin-theme - modus-themes - # solaire-mode - nerd-icons - nerd-icons-completion - nerd-icons-ibuffer - nerd-icons-dired - ligature - treemacs-nerd-icons - eshell-syntax-highlighting - fish-completion # fish completion for eshell - eshell-prompt-extras - eshell-atuin - eshell-command-not-found - clipetty - sideline - consult-eglot - # sideline-flymake - rainbow-delimiters - vertico - marginalia - consult - orderless - embark - embark-consult - magit - magit-delta - magit-todos - difftastic - with-editor - diff-hl - corfu - cape - which-key - nix-mode - nix-ts-mode - agenix - zig-mode - unisonlang-mode - purescript-mode - dhall-mode - envrc - inheritenv - popper - paredit - yaml-mode - hl-todo - markdown-mode - haskell-mode - terraform-mode - diredfl - org-modern - org-roam - org-roam-ql - org-roam-ui - visual-fill-column - consult-org-roam - pass - password-store-otp - eldoc-box - go-translate - notmuch - consult-notmuch - poly-org - casual - gptel - agenix - solidity-mode - # org-re-reveal # FIXME very not nice hash mismatch when building - # gptel # TODO uncomment when there will be a new release including GPT-4o - ]) ++ (with elpaPackages; [ delight kind-icon ef-themes indent-bars ement ]) - ++ (with nongnuPackages; [ eat corfu-terminal haskell-ts-mode ]); -in mainPackages ++ (builtins.attrValues extraPackages) + mainPackages = + builtins.filter + # if an extra package has the same name then give precedence to it + (package: !builtins.elem package.pname (builtins.attrNames extraPackages)) + ( + with melpaPackages; + [ + meow + meow-tree-sitter + dracula-theme + nord-theme + catppuccin-theme + modus-themes + # solaire-mode + nerd-icons + nerd-icons-completion + nerd-icons-ibuffer + nerd-icons-dired + ligature + treemacs-nerd-icons + eshell-syntax-highlighting + fish-completion # fish completion for eshell + eshell-prompt-extras + eshell-atuin + eshell-command-not-found + clipetty + sideline + consult-eglot + # sideline-flymake + rainbow-delimiters + vertico + marginalia + consult + orderless + embark + embark-consult + magit + magit-delta + magit-todos + difftastic + with-editor + diff-hl + corfu + cape + which-key + nix-mode + nix-ts-mode + agenix + zig-mode + unisonlang-mode + purescript-mode + dhall-mode + envrc + inheritenv + popper + paredit + yaml-mode + hl-todo + markdown-mode + haskell-mode + terraform-mode + diredfl + org-modern + org-roam + org-roam-ql + org-roam-ui + visual-fill-column + consult-org-roam + pass + password-store-otp + eldoc-box + go-translate + notmuch + consult-notmuch + poly-org + casual + gptel + agenix + solidity-mode + # org-re-reveal # FIXME very not nice hash mismatch when building + # gptel # TODO uncomment when there will be a new release including GPT-4o + ] + ) + ++ (with elpaPackages; [ + delight + kind-icon + ef-themes + indent-bars + ement + ]) + ++ (with nongnuPackages; [ + eat + corfu-terminal + haskell-ts-mode + ]); +in +mainPackages ++ (builtins.attrValues extraPackages)