Configuration for my NixOS based systems and Home Manager
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

ADD: shell hooks

+97 -4
+1
.envrc
··· 1 1 use nix 2 + use flake
+75 -1
flake.lock
··· 1 1 { 2 2 "nodes": { 3 + "flake-compat": { 4 + "flake": false, 5 + "locked": { 6 + "lastModified": 1696426674, 7 + "narHash": "sha256-kvjfFW7WAETZlt09AgDn1MrtKzP7t90Vf7vypd3OL1U=", 8 + "owner": "edolstra", 9 + "repo": "flake-compat", 10 + "rev": "0f9255e01c2351cc7d116c072cb317785dd33b33", 11 + "type": "github" 12 + }, 13 + "original": { 14 + "owner": "edolstra", 15 + "repo": "flake-compat", 16 + "type": "github" 17 + } 18 + }, 19 + "gitignore": { 20 + "inputs": { 21 + "nixpkgs": [ 22 + "pre-commit-hooks", 23 + "nixpkgs" 24 + ] 25 + }, 26 + "locked": { 27 + "lastModified": 1709087332, 28 + "narHash": "sha256-HG2cCnktfHsKV0s4XW83gU3F57gaTljL9KNSuG6bnQs=", 29 + "owner": "hercules-ci", 30 + "repo": "gitignore.nix", 31 + "rev": "637db329424fd7e46cf4185293b9cc8c88c95394", 32 + "type": "github" 33 + }, 34 + "original": { 35 + "owner": "hercules-ci", 36 + "repo": "gitignore.nix", 37 + "type": "github" 38 + } 39 + }, 3 40 "home-manager": { 4 41 "inputs": { 5 42 "nixpkgs": [ ··· 53 90 "type": "github" 54 91 } 55 92 }, 93 + "nixpkgs_2": { 94 + "locked": { 95 + "lastModified": 1730768919, 96 + "narHash": "sha256-8AKquNnnSaJRXZxc5YmF/WfmxiHX6MMZZasRP6RRQkE=", 97 + "owner": "NixOS", 98 + "repo": "nixpkgs", 99 + "rev": "a04d33c0c3f1a59a2c1cb0c6e34cd24500e5a1dc", 100 + "type": "github" 101 + }, 102 + "original": { 103 + "owner": "NixOS", 104 + "ref": "nixpkgs-unstable", 105 + "repo": "nixpkgs", 106 + "type": "github" 107 + } 108 + }, 109 + "pre-commit-hooks": { 110 + "inputs": { 111 + "flake-compat": "flake-compat", 112 + "gitignore": "gitignore", 113 + "nixpkgs": "nixpkgs_2" 114 + }, 115 + "locked": { 116 + "lastModified": 1742649964, 117 + "narHash": "sha256-DwOTp7nvfi8mRfuL1escHDXabVXFGT1VlPD1JHrtrco=", 118 + "owner": "cachix", 119 + "repo": "git-hooks.nix", 120 + "rev": "dcf5072734cb576d2b0c59b2ac44f5050b5eac82", 121 + "type": "github" 122 + }, 123 + "original": { 124 + "owner": "cachix", 125 + "repo": "git-hooks.nix", 126 + "type": "github" 127 + } 128 + }, 56 129 "root": { 57 130 "inputs": { 58 131 "home-manager": "home-manager", 59 132 "nixpkgs": "nixpkgs", 60 - "nixpkgs-unstable": "nixpkgs-unstable" 133 + "nixpkgs-unstable": "nixpkgs-unstable", 134 + "pre-commit-hooks": "pre-commit-hooks" 61 135 } 62 136 } 63 137 },
+21 -3
flake.nix
··· 9 9 url = "github:nix-community/home-manager/release-24.11"; 10 10 inputs.nixpkgs.follows = "nixpkgs"; 11 11 }; 12 + pre-commit-hooks.url = "github:cachix/git-hooks.nix"; 12 13 }; 13 14 14 - outputs = { nixpkgs, nixpkgs-unstable, home-manager, ... }: 15 + outputs = { self, nixpkgs, nixpkgs-unstable, home-manager, pre-commit-hooks, ... }: 15 16 let 16 17 system = "aarch64-darwin"; 17 18 pkgs = nixpkgs.legacyPackages.${system}; 18 19 unstable-pkgs = nixpkgs-unstable.legacyPackages.${system}; 19 - in { 20 + in 21 + { 20 22 homeConfigurations."noah" = home-manager.lib.homeManagerConfiguration { 21 23 inherit pkgs; 22 24 ··· 27 29 # Optionally use extraSpecialArgs 28 30 # to pass through arguments to home.nix 29 31 extraSpecialArgs = { 30 - unstable = unstable-pkgs; 32 + unstable = unstable-pkgs; 31 33 }; 34 + }; 35 + checks.${system}.pre-commit-check = pre-commit-hooks.lib.${system}.run { 36 + src = ./.; 37 + # If your hooks are intrusive, avoid running on each commit with a default_states like this: 38 + # default_stages = ["manual" "push"]; 39 + hooks = { 40 + nixpkgs-fmt.enable = true; 41 + nil.enable = true; 42 + luacheck.enable = true; 43 + }; 44 + }; 45 + devShells.${system}.default = pkgs.mkShell { 46 + inherit (self.checks.${system}.pre-commit-check) shellHook; 47 + #packages = with pkgs; [ nil lua-language-server nixpkgs-fmt ]; 48 + buildInputs = self.checks.${system}.pre-commit-check.enabledPackages; 49 + 32 50 }; 33 51 }; 34 52 }