Skip to content

Commit e0dbb0a

Browse files
fix(cloud): use root tofu flake and nixpkgs amazon image
1 parent 129cf76 commit e0dbb0a

File tree

4 files changed

+9
-54
lines changed

4 files changed

+9
-54
lines changed

cloud/cloud.sh

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,13 @@ function help {
1212

1313
# Update infrastructure with any state changes
1414
function apply {
15-
nix run .# apply
15+
nix run ..#tofu -- apply
1616
}
1717

1818
# Ensure formatting matches a statand
1919
function check {
20-
nix run .# fmt -check
21-
nix run .# validate
20+
nix run ..#tofu -- fmt -check
21+
nix run ..#tofu -- validate
2222
}
2323

2424
# Reset back to a clean directory
@@ -33,12 +33,12 @@ function clean {
3333
# Setup the current state
3434
function init {
3535
rm -f terraform.tfstate terraform.tfstate.backup
36-
nix run .# init
36+
nix run ..#tofu -- init
3737
}
3838

3939
# Preview any changes to the configurations
4040
function plan {
41-
nix run .# plan
41+
nix run ..#tofu -- plan
4242
}
4343

4444
# Hint if no command is provided

cloud/configuration.nix

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,7 @@
33
"x86_64-linux" =
44
let
55
system = "x86_64-linux";
6-
pkgs = import nixpkgs {
7-
inherit system;
8-
};
6+
pkgs = nixpkgs.legacyPackages.${system};
97
configurations =
108
{ config, ... }:
119
{
@@ -205,16 +203,15 @@
205203
};
206204
};
207205
name = "web-${system}";
208-
image = inputs.nixos-generators.nixosGenerate {
209-
inherit pkgs;
210-
format = "amazon";
206+
image = (nixpkgs.lib.nixosSystem {
207+
inherit system;
211208
modules = [
212209
configurations
213210
{
214211
image.baseName = name;
215212
}
216213
];
217-
};
214+
}).config.system.build.images.amazon;
218215
virtualization = "${image}/${name}.vhd";
219216
in
220217
{

flake.lock

Lines changed: 0 additions & 37 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

flake.nix

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,6 @@
2020
url = "github:LnL7/nix-darwin";
2121
inputs.nixpkgs.follows = "nixpkgs";
2222
};
23-
nixos-generators = {
24-
url = "github:nix-community/nixos-generators";
25-
inputs.nixpkgs.follows = "nixpkgs";
26-
};
2723
nixpkgs = {
2824
url = "github:NixOS/nixpkgs/nixos-unstable";
2925
};
@@ -68,7 +64,6 @@
6864
});
6965
packages = import ./cloud/configuration.nix {
7066
inherit nixpkgs self;
71-
inherit (inputs) nixos-generators;
7267
};
7368
darwinConfigurations = {
7469
edenzim-ltmbn8v.internal.salesforce.com = inputs.nix-darwin.lib.darwinSystem {

0 commit comments

Comments
 (0)