-
-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Flake organization improvements (#376)
- Loading branch information
1 parent
cb8e7d8
commit 96bd37d
Showing
18 changed files
with
306 additions
and
204 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
if ! has nix_direnv_version || ! nix_direnv_version 2.2.0; then | ||
source_url "https://raw.githubusercontent.com/nix-community/nix-direnv/2.2.0/direnvrc" "sha256-5EwyKnkJNQeXrRkYbwwRBcXbibosCJqyIUuz9Xq+LRc=" | ||
fi | ||
nix_direnv_watch_file ./nix/shell.nix | ||
nix_direnv_watch_file ./flake-shell.nix | ||
use flake |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
{inputs, ...}: { | ||
perSystem = { | ||
pkgs, | ||
config, | ||
... | ||
}: { | ||
checks = let | ||
devour-flake = pkgs.callPackage inputs.devour-flake {}; | ||
in | ||
{ | ||
nix-build-all = pkgs.writeShellApplication { | ||
name = "nix-build-all"; | ||
runtimeInputs = [ | ||
pkgs.nix | ||
devour-flake | ||
]; | ||
text = '' | ||
# Make sure that flake.lock is sync | ||
nix flake lock --no-update-lock-file | ||
# Do a full nix build (all outputs) | ||
devour-flake . "$@" | ||
''; | ||
}; | ||
} | ||
# mix in tests | ||
// config.testing.checks; | ||
|
||
devshells.default.commands = [ | ||
{ | ||
category = "Tools"; | ||
name = "check"; | ||
help = "Checks the source tree"; | ||
command = "nix flake check"; | ||
} | ||
]; | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,4 @@ | ||
{system ? builtins.currentSystem}: let | ||
lock = builtins.fromJSON (builtins.readFile ./flake.lock); | ||
|
||
inherit (lock.nodes.flake-compat.locked) owner repo rev narHash; | ||
|
||
flake-compat = fetchTarball { | ||
url = "https://github.com/${owner}/${repo}/archive/${rev}.tar.gz"; | ||
sha256 = narHash; | ||
}; | ||
|
||
flake = import flake-compat { | ||
inherit system; | ||
src = ./.; | ||
}; | ||
let | ||
flake = import ./flake-compat.nix {}; | ||
in | ||
flake.defaultNix |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
{ | ||
system ? builtins.currentSystem, | ||
flakeLockPath ? ./flake.lock, | ||
src ? ./., | ||
}: let | ||
lock = builtins.fromJSON (builtins.readFile flakeLockPath); | ||
inherit (lock.nodes.flake-compat.locked) owner repo rev narHash; | ||
|
||
flake-compat = fetchTarball { | ||
url = "https://github.com/${owner}/${repo}/archive/${rev}.tar.gz"; | ||
sha256 = narHash; | ||
}; | ||
in | ||
import flake-compat { | ||
inherit system src; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.