Skip to content

Commit

Permalink
move cloud: close #12
Browse files Browse the repository at this point in the history
  • Loading branch information
schonfinkel committed Nov 26, 2024
1 parent 965cbe7 commit 4aa8095
Show file tree
Hide file tree
Showing 13 changed files with 475 additions and 890 deletions.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,12 @@ terraform.rc
id_ed25519*
tfplan
output.json
inputs.tfvars

# Nix
.env*
result
*.qcow2

# Magalu CLI
mgc_cli
145 changes: 65 additions & 80 deletions .terraform.lock.hcl

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions README.org
Original file line number Diff line number Diff line change
Expand Up @@ -51,3 +51,5 @@ deploys can be done in pure Nix.

+ The Terraform-based bootstrap is a modification from the great setup found in the
[[https://github.com/Gabriella439/nixos-in-production][NixOS in Production]] book.
+ Many thanks to @Misterio77 for [[https://jaxy.discourse.group/t/criando-um-servidor-de-factorio-100-declarativo-com-nixos-e-terraform/48][figuring it out]] how to run this on Magalu cloud.

33 changes: 24 additions & 9 deletions configuration.nix
Original file line number Diff line number Diff line change
@@ -1,14 +1,29 @@
{ modulesPath, ... }:
{ modulesPath, pkgs, ... }:

{
imports = [ "${modulesPath}/virtualisation/amazon-image.nix" ];
imports = [
./hardware-configuration.nix
];

zramSwap.enable = true;
# Nix configuration
nix.settings.trusted-users = [ "@wheel" ];
nix = {
package = pkgs.nixVersions.stable;
extraOptions = ''
experimental-features = nix-command flakes
'';
# Clean up /nix/store/ after a week
gc = {
automatic = true;
dates = "weekly UTC";
options = "--delete-older-than 7d";
};
};
nixpkgs = {
hostPlatform = "x86_64-linux";
config.allowUnfree = true;
};

swapDevices = [
{
device = "/swapfile";
size = 8 * 1024;
}
];
# Don't change this!
system.stateVersion = "24.11";
}
Loading

0 comments on commit 4aa8095

Please sign in to comment.