-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathflake.nix
53 lines (51 loc) · 1.57 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
{
description = "flakey-profile with system level deps needed by all devs at rhino.fi";
inputs = {
flakey-profile.url = "github:lf-/flakey-profile";
nixpkgs.url = "github:nixos/nixpkgs?rev=95ea544c84ebed84a31896b0ecea2570e5e0e236";
flake-utils.url = "github:numtide/flake-utils";
};
outputs =
{
nixpkgs,
flake-utils,
flakey-profile,
...
}:
flake-utils.lib.eachDefaultSystem (
system:
let
pkgs = import nixpkgs {
inherit system;
};
nix = pkgs.nixVersions.nix_2_25;
in
{
# Any extra arguments to mkProfile are forwarded directly to pkgs.buildEnv.
#
# Usage:
# Switch to this flake:
# nix run .#profile.switch
# Revert a profile change (note: does not revert pins):
# nix run .#profile.rollback
# Build, without switching:
# nix build .#profile
# Pin nixpkgs in the flake registry and in NIX_PATH, so that
# `nix run nixpkgs#hello` and `nix-shell -p hello --run hello` will
# resolve to the same hello as below [should probably be run as root, see README caveats]:
# sudo nix run .#profile.pin
packages.profile = flakey-profile.lib.mkProfile {
inherit pkgs;
# Specifies things to pin in the flake registry and in NIX_PATH.
pinned = {
nixpkgs = toString nixpkgs;
};
paths = with pkgs; [
nix
direnv
(nix-direnv.override { inherit nix; })
];
};
}
);
}