Skip to content

Commit 98f9d6e

Browse files
committed
build image via flake config
1 parent 3719b0f commit 98f9d6e

File tree

3 files changed

+13
-7
lines changed

3 files changed

+13
-7
lines changed

flake.nix

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,5 +90,15 @@
9090
./nix/hosts/clawdinator-1.nix
9191
];
9292
};
93+
94+
nixosConfigurations.clawdinator-1-image = nixpkgs.lib.nixosSystem {
95+
system = "x86_64-linux";
96+
specialArgs = { inherit secrets; };
97+
modules = [
98+
({ ... }: { nixpkgs.overlays = [ self.overlays.default ]; })
99+
agenix.nixosModules.default
100+
./nix/hosts/clawdinator-1-image.nix
101+
];
102+
};
93103
};
94104
}

nix/hosts/clawdinator-1-image.nix

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,7 @@
1-
{ modulesPath, config, ... }:
2-
let
3-
agenix = builtins.fetchTarball "https://github.com/ryantm/agenix/archive/refs/tags/0.15.0.tar.gz";
4-
in {
1+
{ modulesPath, config, ... }: {
52
imports = [
63
(modulesPath + "/virtualisation/ec2-data.nix")
74
(modulesPath + "/virtualisation/amazon-init.nix")
8-
"${agenix}/modules/age.nix"
95
../modules/clawdinator.nix
106
./clawdinator-1-common.nix
117
];

scripts/build-image.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
#!/usr/bin/env bash
22
set -euo pipefail
33

4-
config_path="${CONFIG_PATH:-nix/hosts/clawdinator-1-image.nix}"
54
out_dir="${OUT_DIR:-dist}"
65
format="${IMAGE_FORMAT:-raw}"
6+
flake_ref=".#clawdinator-1-image"
77

88
if [ -e "${out_dir}" ]; then
99
rm -rf "${out_dir}"
1010
fi
1111

12-
nix run github:nix-community/nixos-generators -- -f "${format}" -c "${config_path}" -o "${out_dir}"
12+
nix run github:nix-community/nixos-generators -- --flake "${flake_ref}" -f "${format}" -o "${out_dir}"
1313

1414
out_real="${out_dir}"
1515
if [ -L "${out_dir}" ]; then

0 commit comments

Comments
 (0)