-
-
Notifications
You must be signed in to change notification settings - Fork 43
Expand file tree
/
Copy pathflake.nix
More file actions
63 lines (55 loc) · 1.31 KB
/
flake.nix
File metadata and controls
63 lines (55 loc) · 1.31 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
{
description = "Tux";
inputs = {
nixpkgs = {
type = "github";
owner = "NixOS";
repo = "nixpkgs";
ref = "nixos-unstable";
};
flake-parts = {
type = "github";
owner = "hercules-ci";
repo = "flake-parts";
ref = "main";
};
};
outputs = inputs@{
self,
nixpkgs,
flake-parts,
...
}:
flake-parts.lib.mkFlake { inherit inputs; } {
systems = [
"x86_64-linux"
"x86_64-darwin"
"aarch64-linux"
"aarch64-darwin"
];
perSystem = { pkgs, self', system, ... }: {
devShells = {
default = self'.devShells.tux;
tux = pkgs.callPackage ./shell.nix { inherit pkgs self; };
};
apps.envrc = {
type = "app";
program = self'.packages.envrc;
};
# Creates .envrc if does not exist
packages.envrc = pkgs.writeShellScriptBin "envrc" ''
echo
if [ ! -e ".envrc" ]; then
echo "Creating .envrc"
printf "use flake .\n\n\n" | cat - .env.example > .envrc
echo
echo "The directory is now set up for direnv usage."
echo
else
echo "Please delete .envrc if you wish to recreate it."
echo
fi
'';
};
};
}