aaa
This commit is contained in:
parent
70489ddf74
commit
6c6ec142a8
2 changed files with 34 additions and 23 deletions
35
flake.nix
35
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 @@
|
|||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
}
|
22
package.nix
22
package.nix
|
@ -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; [ ];
|
||||
}
|
Reference in a new issue