-
Notifications
You must be signed in to change notification settings - Fork 0
/
flake.nix
78 lines (74 loc) · 2.36 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
70
71
72
73
74
75
76
77
78
# This flake was initially generated by fh, the CLI for FlakeHub (version 0.1.10)
{
description = "Development environment for remote usage";
inputs = {
agenix.url = "github:ryantm/agenix";
flake-schemas.url = "https://flakehub.com/f/DeterminateSystems/flake-schemas/*.tar.gz";
home-manager = {
url = "github:nix-community/home-manager/master";
inputs.nixpkgs.follows = "nixpkgs";
};
disko = {
url = "github:nix-community/disko";
inputs.nixpkgs.follows = "nixpkgs";
};
persist-retro.url = "github:Geometer1729/persist-retro";
impermanence.url = "github:nix-community/impermanence";
nixpkgs.url = "https://flakehub.com/f/NixOS/nixpkgs/0.1.*.tar.gz";
};
outputs =
{ self
, flake-schemas
, nixpkgs
, disko
, home-manager
, impermanence
, agenix
, persist-retro
} @ inputs:
let
supportedSystems = [ "x86_64-linux" "aarch64-darwin" "x86_64-darwin" "aarch64-linux" ];
forEachSupportedSystem = f: nixpkgs.lib.genAttrs supportedSystems (system: f {
pkgs = import nixpkgs { inherit system; };
});
mkSystem = hostName: system: device: nixpkgs.lib.nixosSystem {
inherit system;
specialArgs = {
inherit inputs;
};
modules = [
inputs.disko.nixosModules.disko
inputs.impermanence.nixosModules.impermanence
inputs.persist-retro.nixosModules.persist-retro
inputs.agenix.nixosModules.default
inputs.home-manager.nixosModules.home-manager
(import ./nixos/disko-config.nix { inherit device; })
./nixos/configuration/${hostName}.nix
];
};
in
{
schemas = flake-schemas.schemas;
nixosConfigurations = rec {
default = antarctica;
antarctica = mkSystem "antarctica" "x86_64-linux" "/dev/sda";
};
packages = forEachSupportedSystem ({ pkgs }: rec {
default = task;
task = pkgs.writeShellScriptBin "go-task-runner" ''
${pkgs.go-task}/bin/task -t ${./Taskfile.yaml} "$@"
'';
});
formatter = forEachSupportedSystem ({ pkgs }: pkgs.nixpkgs-fmt);
devShells = forEachSupportedSystem ({ pkgs }: {
default = pkgs.mkShell {
packages = with pkgs; [
curl
jq
nixpkgs-fmt
go-task
];
};
});
};
}