mirror of
https://github.com/ipetkov/crane.git
synced 2024-12-24 16:03:42 +03:00
Initial commit
This commit is contained in:
commit
2cec871d53
3
.envrc
Normal file
3
.envrc
Normal file
@ -0,0 +1,3 @@
|
||||
watch_file flake.nix flake.lock *.nix **/*.nix
|
||||
|
||||
eval "$(nix print-dev-env)"
|
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
@ -0,0 +1 @@
|
||||
/result*
|
5
checks/default.nix
Normal file
5
checks/default.nix
Normal file
@ -0,0 +1,5 @@
|
||||
{ pkgs }:
|
||||
|
||||
{
|
||||
nixpkgs-fmt = pkgs.callPackage ./nixpkgs-fmt.nix { };
|
||||
}
|
16
checks/nixpkgs-fmt.nix
Normal file
16
checks/nixpkgs-fmt.nix
Normal 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
43
flake.lock
Normal 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
31
flake.nix
Normal 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
3
lib/default.nix
Normal file
@ -0,0 +1,3 @@
|
||||
{ pkgs }:
|
||||
|
||||
{ }
|
Loading…
Reference in New Issue
Block a user