Initial commit

This commit is contained in:
Ivan Petkov 2021-12-26 11:47:16 -08:00
commit 2cec871d53
No known key found for this signature in database
GPG Key ID: BB6F9EFC065832B6
7 changed files with 102 additions and 0 deletions

3
.envrc Normal file
View File

@ -0,0 +1,3 @@
watch_file flake.nix flake.lock *.nix **/*.nix
eval "$(nix print-dev-env)"

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
/result*

5
checks/default.nix Normal file
View File

@ -0,0 +1,5 @@
{ pkgs }:
{
nixpkgs-fmt = pkgs.callPackage ./nixpkgs-fmt.nix { };
}

16
checks/nixpkgs-fmt.nix Normal file
View File

@ -0,0 +1,16 @@
{ lib
, nixpkgs-fmt
, runCommand
}:
let
cleaned = lib.cleanSource ./..;
nixOnly = lib.sourceFilesBySuffices cleaned [ ".nix" ];
in
runCommand "nixpkgs-fmt"
{
nativeBuildInputs = [ nixpkgs-fmt ];
} ''
nixpkgs-fmt --check ${nixOnly}
touch $out # it worked!
''

43
flake.lock Normal file
View File

@ -0,0 +1,43 @@
{
"nodes": {
"nixpkgs": {
"locked": {
"lastModified": 1640269308,
"narHash": "sha256-vBVwv3+kPrxbNyfo48cB5cc5/4tq5zlJGas/qw8XNBE=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "0c408a087b4751c887e463e3848512c12017be25",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixpkgs-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"root": {
"inputs": {
"nixpkgs": "nixpkgs",
"utils": "utils"
}
},
"utils": {
"locked": {
"lastModified": 1638122382,
"narHash": "sha256-sQzZzAbvKEqN9s0bzWuYmRaA03v40gaJ4+iL1LXjaeI=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "74f7e4319258e287b0f9cb95426c9853b282730b",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
}
},
"root": "root",
"version": 7
}

31
flake.nix Normal file
View File

@ -0,0 +1,31 @@
{
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
utils = {
url = "github:numtide/flake-utils";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs = inputs@{ self, nixpkgs, utils, ... }: utils.lib.eachDefaultSystem (system:
let
pkgs = import nixpkgs {
inherit system;
};
lib = import ./lib {
inherit pkgs;
};
checks = import ./checks {
inherit pkgs;
};
in
{
inherit checks lib;
devShell = pkgs.mkShell {
inputsFrom = builtins.attrValues checks;
};
});
}

3
lib/default.nix Normal file
View File

@ -0,0 +1,3 @@
{ pkgs }:
{ }