aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlex Auvolat <alex@adnab.me>2022-11-28 11:01:08 +0100
committerAlex Auvolat <alex@adnab.me>2022-11-28 11:01:08 +0100
commitc4f0343e32d20956e0290cc5bd16e4a39570cac5 (patch)
tree4842983e4ae3cc720e2784ba4a56fa90699eebb0
parenta327876e253b464c049faeafeb24ab2687425014 (diff)
downloadnixcfg-c4f0343e32d20956e0290cc5bd16e4a39570cac5.tar.gz
nixcfg-c4f0343e32d20956e0290cc5bd16e4a39570cac5.zip
flake testmore-nix
-rw-r--r--cluster/staging/app/garage/deploy/garage-nix.hcl17
-rw-r--r--flake.nix52
2 files changed, 61 insertions, 8 deletions
diff --git a/cluster/staging/app/garage/deploy/garage-nix.hcl b/cluster/staging/app/garage/deploy/garage-nix.hcl
index 373fd10..f2bae20 100644
--- a/cluster/staging/app/garage/deploy/garage-nix.hcl
+++ b/cluster/staging/app/garage/deploy/garage-nix.hcl
@@ -60,14 +60,15 @@ job "garage-staging" {
driver = "nix"
config {
- packages = [
- "git+https://git.deuxfleurs.fr/Deuxfleurs/garage.git?ref=nix-remove-system&rev=60c26fbc628d7b450ae39214b578ab6a30583d5c"
- ]
- command = [ "/bin/garage", "server" ]
- bind = {
- "/mnt/storage/garage-staging/data" = "/data",
- "/mnt/ssd/garage-staging/meta" = "/meta",
- }
+ #packages = [
+ # "git+https://git.deuxfleurs.fr/Deuxfleurs/garage.git?ref=nix-remove-system&rev=60c26fbc628d7b450ae39214b578ab6a30583d5c"
+ #]
+ #command = [ "/bin/garage", "server" ]
+ #bind = {
+ # "/mnt/storage/garage-staging/data" = "/data",
+ # "/mnt/ssd/garage-staging/meta" = "/meta",
+ #}
+ nixos = "git+https://git.deuxfleurs.fr/Deuxfleurs/nixcfg.git?ref=more-nix#nixosConfigurations.garage"
}
template {
diff --git a/flake.nix b/flake.nix
new file mode 100644
index 0000000..8c8d079
--- /dev/null
+++ b/flake.nix
@@ -0,0 +1,52 @@
+{
+ description = "Flake for running Garage as a NixOS container";
+
+ inputs = {
+ nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable";
+ nomad-driver-nix.url = "github:input-output-hk/nomad-driver-nix";
+ garage.url = "git+https://git.deuxfleurs.fr/Deuxfleurs/garage.git?ref=nix-remove-system&rev=60c26fbc628d7b450ae39214b578ab6a30583d5c";
+ };
+
+ outputs = { self, nixpkgs, nomad-driver-nix, garage }: {
+ nixosConfigurations = {
+ garage = nixpkgs.lib.nixosSystem {
+ system = "x86_64-linux";
+ specialArgs.self = self;
+ modules = [
+ nomad-driver-nix.nixosModules.nix-driver-nomad
+ (nixpkgs + /nixos/modules/profiles/headless.nix)
+ (nixpkgs + /nixos/modules/profiles/minimal.nix)
+ (nixpkgs + /nixos/modules/misc/version.nix)
+ ({ lib, pkgs, self, config, ... }: {
+ nixpkgs.overlays = [ nomad-driver-nix.overlay ];
+ networking.hostName = lib.mkDefault "garage-nixos";
+
+ nix = {
+ settings.system-features = [ "recursive-nix" "nixos-test" ];
+ extraOptions = ''
+ experimental-features = nix-command flakes ca-references recursive-nix
+ '';
+ };
+
+ users.users = {
+ nixos = {
+ isNormalUser = true;
+ extraGroups = [ "wheel" ];
+ initialHashedPassword = "";
+ };
+
+ root.initialHashedPassword = "";
+ };
+
+ security.sudo = {
+ enable = lib.mkDefault true;
+ wheelNeedsPassword = lib.mkForce false;
+ };
+
+ system.stateVersion = "22.11";
+ })
+ ];
+ };
+ };
+ };
+}