-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathflake.nix
More file actions
79 lines (70 loc) · 2.03 KB
/
flake.nix
File metadata and controls
79 lines (70 loc) · 2.03 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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
{
description = "Interactive Installer Menu for Flake-based NixOS Disko Configurations";
inputs = {
# for flake structure
flake-parts = {
url = "github:hercules-ci/flake-parts";
inputs.nixpkgs-lib.follows = "nixpkgs"; # have full nixpkgs.lib
};
# for package
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
# for testing
disko = {
url = "github:nix-community/disko";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs =
{ nixpkgs, flake-parts, ... }@inputs:
flake-parts.lib.mkFlake { inherit inputs; } (
{ self, lib, ... }@top:
let
inherit (lib.lists) singleton;
in
{
imports = [
./support/default.nix
./tests/default.nix
];
systems = [
"x86_64-linux"
];
flake = {
nixosModules = rec {
# with package already provided (allowing easier use)
default.imports = [
disko-install-menu
package
];
# raw module exported (assuming package being available in system’s pkgs)
disko-install-menu = {
imports = [ ./module ];
};
# package as overlay & especially built for the given NixOS version
package.nixpkgs.overlays = singleton (
pkgs: _: {
inherit (inputs.disko.packages.${pkgs.system}) disko;
disko-install-menu = pkgs.callPackage ./package.nix { };
}
);
};
};
perSystem =
{ pkgs, system, ... }:
{
devShells = rec {
default = test-config;
test-config = pkgs.mkShell {
shellHook = ''
export CONFIG_PATH=./test_config
'';
};
};
packages = rec {
default = disko-install-menu;
disko-install-menu = pkgs.callPackage ./package.nix { };
};
};
}
);
}