-
Notifications
You must be signed in to change notification settings - Fork 34
/
flake.nix
69 lines (66 loc) · 2.09 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
61
62
63
64
65
66
67
68
69
{
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
flake-utils.url = "github:numtide/flake-utils";
flake-compat = {
url = "github:edolstra/flake-compat";
flake = false;
};
devshell.url = "github:numtide/devshell";
};
outputs = { self, nixpkgs, flake-utils, devshell, ... }:
flake-utils.lib.eachDefaultSystem (system: {
apps.devshell = self.outputs.devShell.${system}.flakeApp;
formatter = nixpkgs.legacyPackages.${system}.nixpkgs-fmt;
packages = {
nixosConfigurations =
let
inherit (nixpkgs.lib) nixosSystem;
in
rec {
# to build: nix build github:lucernae/nix-config#nixosConfigurations.raspberry-pi_3.config.system.build.sdImage
raspberry-pi_3 = nixosSystem {
system = "aarch64-linux";
modules = [
"${nixpkgs}/nixos/modules/installer/sd-card/sd-image-aarch64-installer.nix"
# replace this with your target configuration
./configuration.nix
# extra config for sdImage generator
{
sdImage.compressImage = false;
}
];
};
raspberry-pi_3_default = nixosSystem {
system = "aarch64-linux";
modules = [
"${nixpkgs}/nixos/modules/installer/sd-card/sd-image-aarch64-installer.nix"
# replace this with your target configuration
./configuration.default.nix
# extra config for sdImage generator
{
sdImage.compressImage = false;
}
];
};
};
};
devShell =
let
pkgs = import nixpkgs {
inherit system;
overlays = [ devshell.overlays.default ];
};
in
pkgs.devshell.mkShell {
name = "nixos-pi";
commands = [
];
packages = with pkgs; [
git
qemu
qemu_kvm
];
};
});
}