diff options
26 files changed, 170 insertions, 115 deletions
@@ -1,3 +1,4 @@ result .direnv .DS_Store +.pre-commit-config.yaml @@ -111,6 +111,22 @@ "type": "github" } }, + "flake-compat_2": { + "flake": false, + "locked": { + "lastModified": 1696426674, + "narHash": "sha256-kvjfFW7WAETZlt09AgDn1MrtKzP7t90Vf7vypd3OL1U=", + "owner": "edolstra", + "repo": "flake-compat", + "rev": "0f9255e01c2351cc7d116c072cb317785dd33b33", + "type": "github" + }, + "original": { + "owner": "edolstra", + "repo": "flake-compat", + "type": "github" + } + }, "flake-parts": { "inputs": { "nixpkgs-lib": "nixpkgs-lib" @@ -198,6 +214,27 @@ "type": "github" } }, + "gitignore": { + "inputs": { + "nixpkgs": [ + "pre-commit-hooks", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1709087332, + "narHash": "sha256-HG2cCnktfHsKV0s4XW83gU3F57gaTljL9KNSuG6bnQs=", + "owner": "hercules-ci", + "repo": "gitignore.nix", + "rev": "637db329424fd7e46cf4185293b9cc8c88c95394", + "type": "github" + }, + "original": { + "owner": "hercules-ci", + "repo": "gitignore.nix", + "type": "github" + } + }, "home-manager": { "inputs": { "nixpkgs": "nixpkgs" @@ -640,6 +677,38 @@ "type": "github" } }, + "nixpkgs-stable_2": { + "locked": { + "lastModified": 1720386169, + "narHash": "sha256-NGKVY4PjzwAa4upkGtAMz1npHGoRzWotlSnVlqI40mo=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "194846768975b7ad2c4988bdb82572c00222c0d7", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-24.05", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_10": { + "locked": { + "lastModified": 1686020360, + "narHash": "sha256-Wee7lIlZ6DIZHHLiNxU5KdYZQl0iprENXa/czzI6Cj4=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "4729ffac6fd12e26e5a8de002781ffc49b0e94b7", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, "nixpkgs_2": { "locked": { "lastModified": 1724819573, @@ -754,16 +823,16 @@ }, "nixpkgs_9": { "locked": { - "lastModified": 1686020360, - "narHash": "sha256-Wee7lIlZ6DIZHHLiNxU5KdYZQl0iprENXa/czzI6Cj4=", + "lastModified": 1719082008, + "narHash": "sha256-jHJSUH619zBQ6WdC21fFAlDxHErKVDJ5fpN0Hgx4sjs=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "4729ffac6fd12e26e5a8de002781ffc49b0e94b7", + "rev": "9693852a2070b398ee123a329e68f0dab5526681", "type": "github" }, "original": { "owner": "NixOS", - "ref": "nixos-unstable", + "ref": "nixpkgs-unstable", "repo": "nixpkgs", "type": "github" } @@ -822,6 +891,27 @@ "url": "https://git.sr.ht/~rprospero/nixos-pia" } }, + "pre-commit-hooks": { + "inputs": { + "flake-compat": "flake-compat_2", + "gitignore": "gitignore", + "nixpkgs": "nixpkgs_9", + "nixpkgs-stable": "nixpkgs-stable_2" + }, + "locked": { + "lastModified": 1724857454, + "narHash": "sha256-Qyl9Q4QMTLZnnBb/8OuQ9LSkzWjBU1T5l5zIzTxkkhk=", + "owner": "cachix", + "repo": "git-hooks.nix", + "rev": "4509ca64f1084e73bc7a721b20c669a8d4c5ebe6", + "type": "github" + }, + "original": { + "owner": "cachix", + "repo": "git-hooks.nix", + "type": "github" + } + }, "root": { "inputs": { "Hyprspace": "Hyprspace", @@ -837,6 +927,7 @@ "nixpkgs-f2k": "nixpkgs-f2k", "nur": "nur", "pia": "pia", + "pre-commit-hooks": "pre-commit-hooks", "spicetify-nix": "spicetify-nix", "stable": "stable", "systems": "systems_5", @@ -863,7 +954,7 @@ "spicetify-nix": { "inputs": { "flake-utils": "flake-utils_4", - "nixpkgs": "nixpkgs_9" + "nixpkgs": "nixpkgs_10" }, "locked": { "lastModified": 1704167711, @@ -12,6 +12,7 @@ systems.url = "github:nix-systems/default-linux"; nix-thorium.url = "github:almahdi/nix-thorium"; nix-alien.url = "github:thiagokokada/nix-alien"; + pre-commit-hooks.url = "github:cachix/git-hooks.nix"; nix-index-database = { url = "github:nix-community/nix-index-database"; @@ -53,46 +54,67 @@ let inherit (self) outputs; lib = nixpkgs.lib // home-manager.lib; - # forEachSystem = f: lib.genAttrs (import systems) (system: f pkgsFor.${system}); - pkgsFor = lib.genAttrs (import systems) (system: import nixpkgs { inherit system; }); - system = "x86_64-linux"; + forAllSystems = nixpkgs.lib.genAttrs (import systems); + nixpkgsFor = forAllSystems (system: import nixpkgs { inherit system; }); secrets = builtins.fromJSON (builtins.readFile "${self}/secrets/secrets.json"); + system = builtins.currentSystem; in { inherit lib; - packages."${system}".default = home-manager.defaultPackage."${system}"; - formatter."${system}" = nixpkgs.legacyPackages."${system}".alejandra; + packages = forAllSystems (system: { + default = home-manager.defaultPackage."${system}"; + }); - nixosConfigurations = { - kansai = lib.nixosSystem { - specialArgs = { - inherit inputs outputs secrets; + formatter = forAllSystems (system: { + default = nixpkgs.legacyPackages."${system}".nixfmt-rfc-style; + }); + + checks = forAllSystems (system: { + pre-commit-check = inputs.pre-commit-hooks.lib.${system}.run { + src = ./.; + + hooks = { + deadnix.enable = true; + flake-checker.enable = true; + nixfmt-rfc-style.enable = true; + statix.enable = true; }; + }; + }); - modules = [ - home-manager.nixosModule - pia.nixosModule - nix-index-database.nixosModules.nix-index - ./hosts/kansai - ]; + devShells = forAllSystems (system: { + default = nixpkgs.legacyPackages.${system}.mkShell { + inherit (self.checks.${system}.pre-commit-check) shellHook; + buildInputs = self.checks.${system}.pre-commit-check.enabledPackages; }; + }); + + nixosConfigurations.kansai = lib.nixosSystem { + specialArgs = { + inherit inputs outputs secrets; + }; + + modules = [ + home-manager.nixosModule + pia.nixosModule + nix-index-database.nixosModules.nix-index + ./hosts/kansai + ]; }; - homeConfigurations = { - ebisu = home-manager.lib.homeManagerConfiguration { - pkgs = pkgsFor."${system}"; - modules = [ ./home/ebisu ]; + homeConfigurations.ebisu = home-manager.lib.homeManagerConfiguration { + pkgs = nixpkgsFor."${system}"; + modules = [ ./home/ebisu ]; - extraSpecialArgs = { - inherit - inputs - outputs - self - system - secrets - ; - }; + extraSpecialArgs = { + inherit + inputs + outputs + self + system + secrets + ; }; }; }; diff --git a/home/ebisu/default.nix b/home/ebisu/default.nix index d39edf9..86236f3 100644 --- a/home/ebisu/default.nix +++ b/home/ebisu/default.nix @@ -1,8 +1,4 @@ -{ - config, - inputs, - ... -}: +{ config, inputs, ... }: let username = "ebisu"; in diff --git a/home/ebisu/fortune/communication/discord/default.nix b/home/ebisu/fortune/communication/discord/default.nix index 239a89e..a978822 100644 --- a/home/ebisu/fortune/communication/discord/default.nix +++ b/home/ebisu/fortune/communication/discord/default.nix @@ -1,10 +1,4 @@ -{ pkgs, ... }: { - imports = [ - ./vesktop.nix - ]; - - home.packages = with pkgs; [ - # discord-canary - ]; + imports = [ ./vesktop.nix ]; + # home.packages = with pkgs; [ pkgs.discord-canary ]; } diff --git a/home/ebisu/fortune/communication/discord/vesktop.nix b/home/ebisu/fortune/communication/discord/vesktop.nix index 170a379..50d788f 100644 --- a/home/ebisu/fortune/communication/discord/vesktop.nix +++ b/home/ebisu/fortune/communication/discord/vesktop.nix @@ -1,9 +1,6 @@ { pkgs, ... }: { - home.packages = with pkgs; [ - vesktop - ]; - + home.packages = with pkgs; [ vesktop ]; services.arrpc.enable = false; xdg.configFile = { diff --git a/home/ebisu/fortune/desktop/clipboard.nix b/home/ebisu/fortune/desktop/clipboard.nix index e063ca5..0f99fcd 100644 --- a/home/ebisu/fortune/desktop/clipboard.nix +++ b/home/ebisu/fortune/desktop/clipboard.nix @@ -1,7 +1,4 @@ -{ - pkgs, - ... -}: +{ pkgs, ... }: { home.packages = with pkgs; [ wl-clipboard diff --git a/home/ebisu/fortune/education/default.nix b/home/ebisu/fortune/education/default.nix index 3ed4b6b..f9f54cc 100644 --- a/home/ebisu/fortune/education/default.nix +++ b/home/ebisu/fortune/education/default.nix @@ -1,8 +1,6 @@ { pkgs, ... }: { - imports = [ - ./calculator.nix - ]; + imports = [ ./calculator.nix ]; home.packages = with pkgs; [ anki-bin diff --git a/home/ebisu/fortune/multimedia/video/default.nix b/home/ebisu/fortune/multimedia/video/default.nix index 50f2a77..0746cb6 100644 --- a/home/ebisu/fortune/multimedia/video/default.nix +++ b/home/ebisu/fortune/multimedia/video/default.nix @@ -1,8 +1,6 @@ { pkgs, ... }: { - imports = [ - ./anime.nix - ]; + imports = [ ./anime.nix ]; home.packages = with pkgs; [ mplayer diff --git a/home/ebisu/fortune/network/tools/shark.nix b/home/ebisu/fortune/network/tools/shark.nix index 221ae9c..d4b8c51 100644 --- a/home/ebisu/fortune/network/tools/shark.nix +++ b/home/ebisu/fortune/network/tools/shark.nix @@ -1,7 +1,4 @@ -{ - pkgs, - ... -}: +{ pkgs, ... }: { home.packages = with pkgs; [ termshark diff --git a/home/ebisu/fortune/rice/glances.nix b/home/ebisu/fortune/rice/glances.nix index 120ed04..98ca51b 100644 --- a/home/ebisu/fortune/rice/glances.nix +++ b/home/ebisu/fortune/rice/glances.nix @@ -1,8 +1,6 @@ { pkgs, ... }: { - home.packages = with pkgs; [ - glances - ]; + home.packages = with pkgs; [ glances ]; xdg.configFile."glances/glances.conf".text = '' ############################################################################## diff --git a/home/ebisu/fortune/system/fonts/meowsans/default.nix b/home/ebisu/fortune/system/fonts/meowsans/default.nix index bfef9a8..743659d 100644 --- a/home/ebisu/fortune/system/fonts/meowsans/default.nix +++ b/home/ebisu/fortune/system/fonts/meowsans/default.nix @@ -1,3 +1 @@ -{ - home.file.".local/share/fonts/MeowSans_Font ".source = ./MeowSans_Font; -} +{ home.file.".local/share/fonts/MeowSans_Font ".source = ./MeowSans_Font; } diff --git a/home/ebisu/fortune/system/shell/fish.nix b/home/ebisu/fortune/system/shell/fish.nix index 1d6003b..8d63c29 100644 --- a/home/ebisu/fortune/system/shell/fish.nix +++ b/home/ebisu/fortune/system/shell/fish.nix @@ -7,7 +7,7 @@ if status is-interactive set fish_greeting - fish_vi_key_bindings + fish_vi_key_bindings function fish_postexec --on-event fish_postexec if test "$argv" != "clear" diff --git a/home/ebisu/fortune/system/shell/scripting/ripgrep.nix b/home/ebisu/fortune/system/shell/scripting/ripgrep.nix index 75ce241..5d221e3 100644 --- a/home/ebisu/fortune/system/shell/scripting/ripgrep.nix +++ b/home/ebisu/fortune/system/shell/scripting/ripgrep.nix @@ -1,8 +1,5 @@ { pkgs, ... }: { programs.ripgrep.enable = true; - - home.packages = with pkgs; [ - ripgrep-all - ]; + home.packages = with pkgs; [ ripgrep-all ]; } diff --git a/home/ebisu/fortune/system/shell/starship.nix b/home/ebisu/fortune/system/shell/starship.nix index 1e6510a..4daeefc 100644 --- a/home/ebisu/fortune/system/shell/starship.nix +++ b/home/ebisu/fortune/system/shell/starship.nix @@ -1,8 +1,6 @@ { pkgs, ... }: { - home.packages = with pkgs; [ - starship - ]; + home.packages = with pkgs; [ starship ]; programs.starship = { enable = true; diff --git a/modules/hardware/cpu.nix b/modules/hardware/cpu.nix index b57190a..3bbeee7 100644 --- a/modules/hardware/cpu.nix +++ b/modules/hardware/cpu.nix @@ -1,8 +1,4 @@ -{ - pkgs, - config, - ... -}: +{ pkgs, config, ... }: { hardware.cpu.amd.updateMicrocode = true; environment.systemPackages = [ pkgs.amdctl ]; diff --git a/modules/hardware/yubikey.nix b/modules/hardware/yubikey.nix index 4604480..6bd4a5c 100644 --- a/modules/hardware/yubikey.nix +++ b/modules/hardware/yubikey.nix @@ -1,7 +1,4 @@ -{ - pkgs, - ... -}: +{ pkgs, ... }: { hardware.gpgSmartcards.enable = true; diff --git a/modules/multimedia/audio/pipewire.nix b/modules/multimedia/audio/pipewire.nix index 4e914a1..2824176 100644 --- a/modules/multimedia/audio/pipewire.nix +++ b/modules/multimedia/audio/pipewire.nix @@ -3,7 +3,6 @@ # inherit (lib.modules) mkBefore; # inherit (lib.lists) singleton; # inherit (builtins) toString; - # mapOptionDefault = lib.attrsets.mapAttrs (_: lib.modules.mkOptionDefault); # quantum = toString 64; # rate = toString 48000; diff --git a/modules/multimedia/video/default.nix b/modules/multimedia/video/default.nix index 1157479..31cdfd5 100644 --- a/modules/multimedia/video/default.nix +++ b/modules/multimedia/video/default.nix @@ -7,7 +7,5 @@ ./vulkan.nix ]; - environment.systemPackages = [ - pkgs.mediastreamer-openh264 - ]; + environment.systemPackages = [ pkgs.mediastreamer-openh264 ]; } diff --git a/modules/nix/default.nix b/modules/nix/default.nix index 7461ea2..6036627 100644 --- a/modules/nix/default.nix +++ b/modules/nix/default.nix @@ -1,8 +1,6 @@ { config, ... }: { - imports = [ - ./nh.nix - ]; + imports = [ ./nh.nix ]; nixpkgs.config = { cudaSupport = true; diff --git a/modules/security/default.nix b/modules/security/default.nix index 48cc702..7a571a9 100644 --- a/modules/security/default.nix +++ b/modules/security/default.nix @@ -1,8 +1,4 @@ -{ - config, - lib, - ... -}: +{ config, lib, ... }: { imports = [ ./apparmor.nix diff --git a/modules/system/boot/default.nix b/modules/system/boot/default.nix index bafbabb..d57d14e 100644 --- a/modules/system/boot/default.nix +++ b/modules/system/boot/default.nix @@ -1,7 +1,4 @@ -{ - pkgs, - ... -}: +{ pkgs, ... }: { imports = [ ./grub.nix diff --git a/pkgs/cargo-clean-all.nix b/pkgs/cargo-clean-all.nix index 42ef354..bfa33d3 100644 --- a/pkgs/cargo-clean-all.nix +++ b/pkgs/cargo-clean-all.nix @@ -4,9 +4,7 @@ fetchFromGitHub, }: let - rustUtils = import ../lib/rust-utils.nix { - inherit lib rustPlatform fetchFromGitHub; - }; + rustUtils = import ../lib/rust-utils.nix { inherit lib rustPlatform fetchFromGitHub; }; in rustUtils.mkRustPackage { pname = "cargo-clean-all"; diff --git a/pkgs/chan-downloader.nix b/pkgs/chan-downloader.nix index 10c55c3..9de5c7c 100644 --- a/pkgs/chan-downloader.nix +++ b/pkgs/chan-downloader.nix @@ -6,9 +6,7 @@ openssl, }: let - rustUtils = import ../lib/rust-utils.nix { - inherit lib rustPlatform fetchFromGitHub; - }; + rustUtils = import ../lib/rust-utils.nix { inherit lib rustPlatform fetchFromGitHub; }; in rustUtils.mkRustPackage { pname = "chan-downloader"; diff --git a/pkgs/git-sumi.nix b/pkgs/git-sumi.nix index 488a7a0..504f1d4 100644 --- a/pkgs/git-sumi.nix +++ b/pkgs/git-sumi.nix @@ -4,9 +4,7 @@ fetchFromGitHub, }: let - rustUtils = import ../lib/rust-utils.nix { - inherit lib rustPlatform fetchFromGitHub; - }; + rustUtils = import ../lib/rust-utils.nix { inherit lib rustPlatform fetchFromGitHub; }; in rustUtils.mkRustPackage { pname = "git-sumi"; diff --git a/pkgs/swaddle.nix b/pkgs/swaddle.nix index bddb6a5..ddb5c43 100644 --- a/pkgs/swaddle.nix +++ b/pkgs/swaddle.nix @@ -6,9 +6,7 @@ pkg-config, }: let - rustUtils = import ../lib/rust-utils.nix { - inherit lib rustPlatform fetchFromGitHub; - }; + rustUtils = import ../lib/rust-utils.nix { inherit lib rustPlatform fetchFromGitHub; }; in rustUtils.mkRustPackage { pname = "swaddle"; |