commit 7da720d81c37df5af690773f5de3bcc7d0017beb parent 6efc8042cf678bf71f4982e4eeea3937439af137 Author: Francesco Saccone <francesco@francescosaccone.com> Date: Sat, 17 May 2025 17:50:34 +0200 style: reformat with 'nix fmt' Signed-off-by: Francesco Saccone <francesco@francescosaccone.com> Diffstat:
26 files changed, 49 insertions(+), 161 deletions(-)
diff --git a/flake.nix b/flake.nix @@ -73,17 +73,11 @@ ); packages = lib.forEachSystem ( - { - system, - }: - import ./packages inputs.nixpkgs.legacyPackages.${system} + { system }: import ./packages inputs.nixpkgs.legacyPackages.${system} ); formatter = lib.forEachSystem ( - { - system, - }: - treefmtEval.${system}.config.build.wrapper + { system }: treefmtEval.${system}.config.build.wrapper ); overlays.default = final: prev: import ./packages final.pkgs; @@ -95,19 +89,13 @@ nixosConfigurations = { "laptop" = lib.makeHost "laptop" { - additionalModules = [ - inputs.home-manager.nixosModules.home-manager - ]; + additionalModules = [ inputs.home-manager.nixosModules.home-manager ]; }; "git-server" = lib.makeHost "git-server" { - additionalModules = [ - inputs.disko.nixosModules.disko - ]; + additionalModules = [ inputs.disko.nixosModules.disko ]; }; "main-server" = lib.makeHost "main-server" { - additionalModules = [ - inputs.disko.nixosModules.disko - ]; + additionalModules = [ inputs.disko.nixosModules.disko ]; }; }; }; diff --git a/hardware/git-server/default.nix b/hardware/git-server/default.nix @@ -10,9 +10,7 @@ }: { - imports = [ - (modulesPath + "/profiles/qemu-guest.nix") - ]; + imports = [ (modulesPath + "/profiles/qemu-guest.nix") ]; boot.initrd.availableKernelModules = [ "ata_piix" diff --git a/hardware/laptop/default.nix b/hardware/laptop/default.nix @@ -10,9 +10,7 @@ }: { - imports = [ - (modulesPath + "/installer/scan/not-detected.nix") - ]; + imports = [ (modulesPath + "/installer/scan/not-detected.nix") ]; boot.initrd.availableKernelModules = [ "xhci_pci" diff --git a/hardware/main-server/default.nix b/hardware/main-server/default.nix @@ -10,9 +10,7 @@ }: { - imports = [ - (modulesPath + "/profiles/qemu-guest.nix") - ]; + imports = [ (modulesPath + "/profiles/qemu-guest.nix") ]; boot.initrd.availableKernelModules = [ "ata_piix" diff --git a/hosts/common/default.nix b/hosts/common/default.nix @@ -39,9 +39,7 @@ environment = { defaultPackages = lib.mkForce [ ]; - systemPackages = [ - (lib.meta.hiPrio pkgs.sbase) - ]; + systemPackages = [ (lib.meta.hiPrio pkgs.sbase) ]; }; i18n.defaultLocale = "en_GB.UTF-8"; @@ -55,9 +53,7 @@ "flakes" "pipe-operators" ]; - trusted-users = [ - "root" - ]; + trusted-users = [ "root" ]; }; gc = { automatic = true; diff --git a/hosts/git-server/default.nix b/hosts/git-server/default.nix @@ -18,9 +18,7 @@ let }; in { - imports = [ - ./disk-config.nix - ]; + imports = [ ./disk-config.nix ]; services = { dns = { @@ -60,9 +58,7 @@ in ${stagitCreateAndChown} ''; in - [ - fullScript - ]; + [ fullScript ]; }; acme = { enable = true; @@ -129,9 +125,7 @@ in enable = true; port = 22; authorizedKeyFiles = rec { - root = [ - "${mainServer}/ssh/francescosaccone.pub" - ]; + root = [ "${mainServer}/ssh/francescosaccone.pub" ]; git = root; }; }; diff --git a/hosts/git-server/disk-config.nix b/hosts/git-server/disk-config.nix @@ -1,8 +1,4 @@ -{ - config, - lib, - ... -}: +{ config, lib, ... }: { disko.devices = { disk.disk1 = { @@ -47,9 +43,7 @@ type = "filesystem"; format = "ext4"; mountpoint = "/"; - mountOptions = [ - "defaults" - ]; + mountOptions = [ "defaults" ]; }; }; }; diff --git a/hosts/git-server/scripts.nix b/hosts/git-server/scripts.nix @@ -75,9 +75,7 @@ in httpBaseUrl, }: let - createIndex = stagit.createIndex { - inherit destDir reposDir; - }; + createIndex = stagit.createIndex { inherit destDir reposDir; }; createRepositories = config.services.git.repositories |> builtins.attrNames @@ -109,9 +107,7 @@ in httpBaseUrl, }: let - createIndex = stagit.createIndex { - inherit destDir reposDir; - }; + createIndex = stagit.createIndex { inherit destDir reposDir; }; createRepositories = stagit.createRepository { inherit destDir diff --git a/hosts/laptop/default.nix b/hosts/laptop/default.nix @@ -52,9 +52,7 @@ jack.enable = true; }; - fonts.packages = [ - pkgs.ibm-plex - ]; + fonts.packages = [ pkgs.ibm-plex ]; users.users."francesco" = { description = "Francesco Saccone"; @@ -79,9 +77,7 @@ useUserPackages = true; backupFileExtension = "bkp"; - extraSpecialArgs = { - inherit inputs; - }; + extraSpecialArgs = { inherit inputs; }; users.francesco = { ... }: diff --git a/hosts/main-server/default.nix b/hosts/main-server/default.nix @@ -8,9 +8,7 @@ let domain = import ./domain.nix; in rec { - imports = [ - ./disk-config.nix - ]; + imports = [ ./disk-config.nix ]; services = { dns = { @@ -83,13 +81,9 @@ rec { enable = true; port = 22; authorizedKeyFiles = rec { - root = [ - ./ssh/francescosaccone.pub - ]; + root = [ ./ssh/francescosaccone.pub ]; }; }; - networking = { - inherit domain; - }; + networking = { inherit domain; }; } diff --git a/hosts/main-server/disk-config.nix b/hosts/main-server/disk-config.nix @@ -1,8 +1,4 @@ -{ - config, - lib, - ... -}: +{ config, lib, ... }: { disko.devices = { disk.disk1 = { @@ -47,9 +43,7 @@ type = "filesystem"; format = "ext4"; mountpoint = "/"; - mountOptions = [ - "defaults" - ]; + mountOptions = [ "defaults" ]; }; }; }; diff --git a/lib/for-each-system-pkgs.nix b/lib/for-each-system-pkgs.nix @@ -15,6 +15,4 @@ f: pkgs = getPkgs { inherit system; }; } ) -|> forEachSystem { - inherit nixpkgs systems; -} +|> forEachSystem { inherit nixpkgs systems; } diff --git a/lib/for-each-system.nix b/lib/for-each-system.nix @@ -1,5 +1,2 @@ -{ - nixpkgs, - systems, -}: +{ nixpkgs, systems }: f: (system: f { inherit system; }) |> nixpkgs.lib.genAttrs systems diff --git a/lib/get-pkgs.nix b/lib/get-pkgs.nix @@ -1,12 +1,8 @@ { nixpkgs, inputs }: -{ - system, -}: +{ system }: import nixpkgs { inherit system; - overlays = [ - inputs.self.outputs.overlays.default - ]; + overlays = [ inputs.self.outputs.overlays.default ]; config = { allowBroken = false; allowUnfree = false; diff --git a/lib/make-host.nix b/lib/make-host.nix @@ -4,24 +4,17 @@ host: additionalModules ? [ ], }: nixpkgs.lib.nixosSystem { - specialArgs = { - inherit inputs; - }; + specialArgs = { inherit inputs; }; modules = [ (../hosts + "/${host}") (../hardware + "/${host}") ../hosts/common inputs.self.outputs.nixosModules.default ( - { - config, - ... - }: + { config, ... }: { networking.hostName = "fs-${host}"; - nixpkgs.overlays = [ - inputs.self.outputs.overlays.default - ]; + nixpkgs.overlays = [ inputs.self.outputs.overlays.default ]; } ) ] ++ additionalModules; diff --git a/modules/home-manager/default.nix b/modules/home-manager/default.nix @@ -1,6 +1,4 @@ -{ - ... -}: +{ ... }: { imports = [ ./aerc diff --git a/modules/home-manager/pass/default.nix b/modules/home-manager/pass/default.nix @@ -29,9 +29,7 @@ config = lib.mkIf config.modules.pass.enable { programs.password-store = { enable = true; - package = pkgs.pass.withExtensions (exts: [ - exts.pass-otp - ]); + package = pkgs.pass.withExtensions (exts: [ exts.pass-otp ]); settings = { PASSWORD_STORE_DIR = config.modules.pass.directory; PASSWORD_STORE_CLIP_TIME = "15"; diff --git a/modules/home-manager/sway/bar/default.nix b/modules/home-manager/sway/bar/default.nix @@ -32,9 +32,7 @@ extraConfig = "separator_symbol \" \""; fonts = { - names = [ - config.modules.sway.fonts.monospace - ]; + names = [ config.modules.sway.fonts.monospace ]; style = "Regular"; size = 12.0; }; diff --git a/modules/home-manager/sway/default.nix b/modules/home-manager/sway/default.nix @@ -6,9 +6,7 @@ ... }: { - imports = [ - ./bar - ]; + imports = [ ./bar ]; options.modules.sway = { enable = lib.mkOption { @@ -121,9 +119,7 @@ xwayland = true; config = { fonts = { - names = [ - config.modules.sway.fonts.monospace - ]; + names = [ config.modules.sway.fonts.monospace ]; style = "Regular"; size = 12.0; }; @@ -154,10 +150,7 @@ focusedInactive = default; unfocused = default; urgent = { - inherit (default) - background - text - ; + inherit (default) background text; border = colors.red; }; } diff --git a/modules/home-manager/vis/default.nix b/modules/home-manager/vis/default.nix @@ -17,9 +17,7 @@ config = lib.mkIf config.modules.vis.enable { home = { - packages = [ - pkgs.vis - ]; + packages = [ pkgs.vis ]; file = { ".mkshrc".text = "export EDITOR=${pkgs.vis}/bin/vis"; ".config/vis/visrc.lua".source = ./visrc.lua; diff --git a/modules/nixos/programs/default.nix b/modules/nixos/programs/default.nix @@ -1,6 +1,4 @@ { ... }: { - imports = [ - ./monero - ]; + imports = [ ./monero ]; } diff --git a/modules/nixos/security/default.nix b/modules/nixos/security/default.nix @@ -1,6 +1,4 @@ { ... }: { - imports = [ - ./openssh - ]; + imports = [ ./openssh ]; } diff --git a/modules/nixos/security/openssh/default.nix b/modules/nixos/security/openssh/default.nix @@ -40,10 +40,7 @@ config = let - inherit (config.security.openssh) - agent - listen - ; + inherit (config.security.openssh) agent listen; in { programs.ssh = lib.mkIf agent.enable { @@ -53,29 +50,19 @@ services.openssh = lib.mkIf listen.enable { enable = true; - ports = [ - listen.port - ]; + ports = [ listen.port ]; settings = { PasswordAuthentication = false; }; }; - networking.firewall.allowedTCPPorts = lib.mkIf listen.enable [ - listen.port - ]; + networking.firewall.allowedTCPPorts = lib.mkIf listen.enable [ listen.port ]; users.users = lib.mkIf listen.enable ( listen.authorizedKeyFiles - |> builtins.mapAttrs ( - user: files: { - openssh.authorizedKeys.keyFiles = files; - } - ) + |> builtins.mapAttrs (user: files: { openssh.authorizedKeys.keyFiles = files; }) ); - services.sshguard = lib.mkIf listen.enable { - enable = true; - }; + services.sshguard = lib.mkIf listen.enable { enable = true; }; }; } diff --git a/modules/nixos/services/git/default.nix b/modules/nixos/services/git/default.nix @@ -6,9 +6,7 @@ ... }: { - imports = [ - ./daemon - ]; + imports = [ ./daemon ]; options.services.git = { enable = lib.mkOption { @@ -95,10 +93,7 @@ repositories |> builtins.mapAttrs ( name: - { - additionalFiles, - hooks, - }: + { additionalFiles, hooks }: '' ${pkgs.git}/bin/git init -q --bare -b master \ ${directory}/${name} diff --git a/modules/nixos/services/quark/tls/default.nix b/modules/nixos/services/quark/tls/default.nix @@ -41,9 +41,7 @@ systemd.services.hitch = { enable = true; wantedBy = [ "multi-user.target" ]; - after = [ - "acme.service" - ]; + after = [ "acme.service" ]; serviceConfig = let script = pkgs.writeShellScriptBin "script" '' diff --git a/treefmt.nix b/treefmt.nix @@ -1,7 +1,4 @@ -{ - pkgs, - ... -}: +{ pkgs, ... }: { projectRootFile = "flake.nix";