-
Notifications
You must be signed in to change notification settings - Fork 0
/
flake.nix
60 lines (47 loc) · 1.63 KB
/
flake.nix
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
{
description = "This is a nix with flakes package";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs";
flake-utils.url = "github:numtide/flake-utils";
podman-rootless.url = "github:ES-Nix/podman-rootless/from-nixpkgs";
podman-rootless.inputs.nixpkgs.follows = "nixpkgs";
};
outputs = attrs@{
self,
nixpkgs,
flake-utils,
podman-rootless
}:
flake-utils.lib.eachDefaultSystem (system:
let
pkgsAllowUnfree = import nixpkgs {
inherit system;
config = { allowUnfree = true; };
};
# https://gist.github.com/tpwrules/34db43e0e2e9d0b72d30534ad2cda66d#file-flake-nix-L28
pleaseKeepMyInputs = pkgsAllowUnfree.writeTextDir "bin/.please-keep-my-inputs"
(builtins.concatStringsSep " " (builtins.attrValues attrs));
in
{
# nix fmt
formatter = pkgsAllowUnfree.nixpkgs-fmt;
devShells.default = pkgsAllowUnfree.mkShell {
buildInputs = with pkgsAllowUnfree; [
bashInteractive
coreutils
gnumake
podman-rootless.packages.${system}.podman
pleaseKeepMyInputs
];
shellHook = ''
export TMPDIR=/tmp
test -d .profiles || mkdir -v .profiles
test -L .profiles/dev \
|| nix develop .# --profile .profiles/dev --command echo
test -L .profiles/dev-shell-default \
|| nix build $(nix eval --impure --raw .#devShells."$system".default.drvPath) --out-link .profiles/dev-shell-"$system"-default
echo "Entering the nix devShell"
'';
};
});
}