From 6422669548ccb6ef9cf2c955d45ade28a8671510 Mon Sep 17 00:00:00 2001 From: Petru Paler Date: Sun, 2 Jul 2023 06:48:41 +0100 Subject: [PATCH] Install seaweedfs from unstable on compute nodes. --- flake.lock | 19 ++++++++++++++++++- flake.nix | 13 +++++++++++-- hosts/common/compute-node.nix | 1 + hosts/common/seaweedfs.nix | 14 ++++++++++++++ 4 files changed, 44 insertions(+), 3 deletions(-) create mode 100644 hosts/common/seaweedfs.nix diff --git a/flake.lock b/flake.lock index 6d4ae43..d011125 100644 --- a/flake.lock +++ b/flake.lock @@ -69,11 +69,28 @@ "type": "github" } }, + "nixpkgs-unstable": { + "locked": { + "lastModified": 1688049487, + "narHash": "sha256-100g4iaKC9MalDjUW9iN6Jl/OocTDtXdeAj7pEGIRh4=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "4bc72cae107788bf3f24f30db2e2f685c9298dc9", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, "root": { "inputs": { "deploy-rs": "deploy-rs", "impermanence": "impermanence", - "nixpkgs": "nixpkgs" + "nixpkgs": "nixpkgs", + "nixpkgs-unstable": "nixpkgs-unstable" } }, "utils": { diff --git a/flake.nix b/flake.nix index b397143..c24ca56 100644 --- a/flake.nix +++ b/flake.nix @@ -6,13 +6,22 @@ deploy-rs.inputs.nixpkgs.follows = "nixpkgs"; impermanence.url = "github:nix-community/impermanence"; nixpkgs.url = "github:NixOS/nixpkgs/nixos-23.05"; + nixpkgs-unstable.url = "github:NixOS/nixpkgs/nixos-unstable"; }; - outputs = { self, nixpkgs, deploy-rs, ... }@inputs: + outputs = { self, nixpkgs, nixpkgs-unstable, deploy-rs, ... }@inputs: let inherit (self); + system = "x86_64-linux"; + + overlay-unstable = final: prev: { + unstable = nixpkgs-unstable.legacyPackages.${prev.system}; + }; + mkNixos = modules: nixpkgs.lib.nixosSystem { - inherit modules; + modules = [ + ({ config, pkgs, ... }: { nixpkgs.overlays = [ overlay-unstable ]; }) + ] ++ modules; specialArgs = { inherit inputs self; }; }; in { diff --git a/hosts/common/compute-node.nix b/hosts/common/compute-node.nix index e804b15..34566d8 100644 --- a/hosts/common/compute-node.nix +++ b/hosts/common/compute-node.nix @@ -3,6 +3,7 @@ imports = [ ./impermanence.nix ./nomad.nix + ./seaweedfs.nix ./sshd.nix ./user-ppetru.nix ./unattended-encryption.nix diff --git a/hosts/common/seaweedfs.nix b/hosts/common/seaweedfs.nix new file mode 100644 index 0000000..8ba32b2 --- /dev/null +++ b/hosts/common/seaweedfs.nix @@ -0,0 +1,14 @@ +{ pkgs, ... }: +{ + environment.persistence."/persist".directories = [ + ]; + + environment.systemPackages = [ + pkgs.unstable.seaweedfs + ]; + + networking.firewall = { + allowedTCPPorts = [ ]; + allowedUDPPorts = [ ]; + }; +}