diff options
| -rw-r--r-- | .envrc | 1 | ||||
| -rw-r--r-- | .gitignore | 2 | ||||
| -rw-r--r-- | PACKAGES.md | 2 | ||||
| -rw-r--r-- | README.md | 17 | ||||
| -rw-r--r-- | flake.lock | 80 | ||||
| -rw-r--r-- | flake.nix | 27 |
6 files changed, 122 insertions, 7 deletions
@@ -0,0 +1 @@ +use flake @@ -1 +1,3 @@ result +.direnv/ +.pre-commit-config.yaml diff --git a/PACKAGES.md b/PACKAGES.md index 6fb2800..e516b76 100644 --- a/PACKAGES.md +++ b/PACKAGES.md @@ -1,3 +1,5 @@ +# packages list + ## original packages - [treefetch](https://github.com/angelofallars/treefetch) @@ -8,7 +8,7 @@ see [PACKAGES.md](https://github.com/getchoo/overlay/blob/main/PACKAGES.md) ## how to use -### flake configuration: +### flake configuration ```nix { @@ -38,7 +38,7 @@ see [PACKAGES.md](https://github.com/getchoo/overlay/blob/main/PACKAGES.md) } ``` -### home-manager: +### home-manager ```nix { @@ -49,7 +49,7 @@ see [PACKAGES.md](https://github.com/getchoo/overlay/blob/main/PACKAGES.md) } ``` -### `configuration.nix`: +### `configuration.nix` ```nix _: let @@ -61,17 +61,20 @@ in { ### cli support -`nixpkgs.overlays` does not configure overlays for tools such as `nix(-)run`, `nix(-)shell`, etc. -the best way to make this overlay available to them is to add it to your flake registry or `~/.config/nixpkgs/overlays.nix`. +`nixpkgs.overlays` does not configure overlays for tools +such as `nix(-)run`, `nix(-)shell`, etc. -#### flake registry: +the best way to make this overlay available to them is to +add it to your flake registry or `~/.config/nixpkgs/overlays.nix`. + +#### flake registry ```shell nix registry add getchoo github:getchoo/overlay nix run getchoo#treefetch ``` -#### overlays.nix: +#### overlays.nix in `~/.config/nixpkgs/overlays.nix` (or a nix file in `~/.config/nixpkgs/overlays/`): @@ -1,5 +1,42 @@ { "nodes": { + "flake-compat": { + "flake": false, + "locked": { + "lastModified": 1673956053, + "narHash": "sha256-4gtG9iQuiKITOjNQQeQIpoIB6b16fm+504Ch3sNKLd8=", + "owner": "edolstra", + "repo": "flake-compat", + "rev": "35bb57c0c8d8b62bbfd284272c928ceb64ddbde9", + "type": "github" + }, + "original": { + "owner": "edolstra", + "repo": "flake-compat", + "type": "github" + } + }, + "gitignore": { + "inputs": { + "nixpkgs": [ + "pre-commit-hooks", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1660459072, + "narHash": "sha256-8DFJjXG8zqoONA1vXtgeKXy68KdJL5UaXR8NtVMUbx8=", + "owner": "hercules-ci", + "repo": "gitignore.nix", + "rev": "a20de23b925fd8264fd7fad6454652e142fd7f73", + "type": "github" + }, + "original": { + "owner": "hercules-ci", + "repo": "gitignore.nix", + "type": "github" + } + }, "naersk": { "inputs": { "nixpkgs": [ @@ -34,10 +71,53 @@ "type": "indirect" } }, + "nixpkgs-stable": { + "locked": { + "lastModified": 1673800717, + "narHash": "sha256-SFHraUqLSu5cC6IxTprex/nTsI81ZQAtDvlBvGDWfnA=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "2f9fd351ec37f5d479556cd48be4ca340da59b8f", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-22.11", + "repo": "nixpkgs", + "type": "github" + } + }, + "pre-commit-hooks": { + "inputs": { + "flake-compat": "flake-compat", + "flake-utils": [ + "utils" + ], + "gitignore": "gitignore", + "nixpkgs": [ + "nixpkgs" + ], + "nixpkgs-stable": "nixpkgs-stable" + }, + "locked": { + "lastModified": 1677832802, + "narHash": "sha256-XQf+k6mBYTiQUjWRf/0fozy5InAs03O1b30adCpWeXs=", + "owner": "cachix", + "repo": "pre-commit-hooks.nix", + "rev": "382bee738397ca005206eefa36922cc10df8a21c", + "type": "github" + }, + "original": { + "owner": "cachix", + "repo": "pre-commit-hooks.nix", + "type": "github" + } + }, "root": { "inputs": { "naersk": "naersk", "nixpkgs": "nixpkgs", + "pre-commit-hooks": "pre-commit-hooks", "utils": "utils" } }, @@ -5,12 +5,19 @@ url = "github:nix-community/naersk"; inputs.nixpkgs.follows = "nixpkgs"; }; + pre-commit-hooks = { + url = "github:cachix/pre-commit-hooks.nix"; + inputs.nixpkgs.follows = "nixpkgs"; + inputs.flake-utils.follows = "utils"; + }; }; outputs = { + self, nixpkgs, utils, naersk, + pre-commit-hooks, ... }: let supportedSystsems = with utils.lib.system; [ @@ -32,7 +39,27 @@ utils.lib.eachSystem supportedSystsems (system: let pkgs = import nixpkgs {inherit system;}; in { + checks = { + pre-commit-check = pre-commit-hooks.lib.${system}.run { + src = ./.; + hooks = { + # formatting is taken care of by gh actions :) + deadnix.enable = true; + markdownlint.enable = true; + }; + }; + }; + + devShells.default = pkgs.mkShell { + inherit (self.checks.${system}.pre-commit-check) shellHook; + packages = with pkgs; [ + nodePackages.markdownlint-cli + deadnix + ]; + }; + formatter = pkgs.alejandra; + packages = let p = packageSet pkgs; in |
