From 6c6ec142a862a2a1cc81960ef2c1c53ba1f305e8 Mon Sep 17 00:00:00 2001 From: Hamcha Date: Tue, 28 Nov 2023 20:54:04 +0100 Subject: [PATCH] aaa --- flake.nix | 35 ++++++++++++++++++++++++++++++++++- package.nix | 22 ---------------------- 2 files changed, 34 insertions(+), 23 deletions(-) delete mode 100644 package.nix diff --git a/flake.nix b/flake.nix index 7382774..9657bbc 100644 --- a/flake.nix +++ b/flake.nix @@ -21,6 +21,39 @@ systems = [ "x86_64-linux" ]; + flake = with nixpkgs.lib; { + nixosModules.staxman = { + options = { + enable = mkEnableOption "staxman"; + stackDir = mkOption { + type = types.path; + defaultText = "/stacks"; + example = "/stacks"; + description = '' + Directory containing Arion stacks + ''; + }; + }; + config = mkIf cfg.enable { + systemd.services.staxman = { + description = "Scatting system management"; + after = [ "network-online.target" ]; + wantedBy = [ "multi-user.target" ]; + environment.STAX_ARION_BIN = "${getBin nixpkgs.arion}"; + environment.STAX_DIR = cfg.stackDir; + + serviceConfig = { + User = "root"; + Group = "root"; + Restart = "always"; + ExecStart = "${getBin nixpkgs.staxman}/bin/staxman"; + }; + StateDirectory = "staxman"; + StateDirectoryMode = "0750"; + }; + }; + }; + }; perSystem = { system, pkgs, ... }: let overlays = [ (import rust-overlay) @@ -47,4 +80,4 @@ }; }; }; -} +} \ No newline at end of file diff --git a/package.nix b/package.nix deleted file mode 100644 index dcfbf02..0000000 --- a/package.nix +++ /dev/null @@ -1,22 +0,0 @@ -{ naersk -, version -, pkgs -, ... -}: - -naersk.buildPackage { - name = "staxman"; - inherit version; - - src = ./.; - - nativeBuildInputs = with pkgs; [ - clang - mold - zlib - libgit2 - pkg-config - ]; - - buildInputs = with pkgs; [ ]; -} \ No newline at end of file