-
Notifications
You must be signed in to change notification settings - Fork 19
/
flake.nix
58 lines (53 loc) · 1.6 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
{
description = "RedNix Hackable NixOS Container";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
utils.url = "github:numtide/flake-utils";
hackpkgs = {
url = "github:applePrincess/hackpkgs";
inputs.nixpkgs.follows = "nixpkgs";
inputs.flake-utils.follows = "utils";
};
chainsaw = {
url = "github:WithSecureLabs/chainsaw";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs = inputs @ {nixpkgs, ...}: let
supportedSystems = ["x86_64-linux"];
genSystems = nixpkgs.lib.genAttrs supportedSystems;
pkgs = genSystems (system:
import nixpkgs {
inherit system;
config = {
allowUnfree = true;
allowInsecurePredicate = p: true;
segger-jlink.acceptLicense = true;
};
});
in {
# auto-generated devShells
devShells = genSystems (system:
import ./shells {
pkgs = pkgs.${system};
inherit inputs;
});
packages = genSystems (system: let
inherit (nixpkgs.lib) attrValues flatten listToAttrs nameValuePair;
packages = flatten (attrValues (import ./packages.nix {
pkgs = pkgs.${system};
inherit inputs;
}));
in
listToAttrs (map (n: nameValuePair (n.pname or n.name) n) packages));
# use with nixos-container
nixosConfigurations = genSystems (system:
nixpkgs.lib.nixosSystem {
inherit system;
specialArgs = {inherit inputs;};
modules = [./container-config.nix];
});
# import into your config for declarative containers
container = ./container.nix;
};
}