mirror of
https://github.com/kmein/niveum
synced 2026-03-19 19:41:08 +01:00
feat: tmpfiles.d helper function
This commit is contained in:
@@ -5,6 +5,7 @@ let
|
|||||||
indexFilename = "index";
|
indexFilename = "index";
|
||||||
flixUser = "flix";
|
flixUser = "flix";
|
||||||
flixGroup = "users";
|
flixGroup = "users";
|
||||||
|
inherit (import <niveum/lib>) tmpfilesConfig;
|
||||||
in {
|
in {
|
||||||
fileSystems.${flixLocation} = {
|
fileSystems.${flixLocation} = {
|
||||||
device = "prism.r:/export";
|
device = "prism.r:/export";
|
||||||
@@ -24,7 +25,13 @@ in {
|
|||||||
};
|
};
|
||||||
|
|
||||||
systemd.tmpfiles.rules = [
|
systemd.tmpfiles.rules = [
|
||||||
"d '${cacheLocation}' 0750 ${flixUser} ${flixGroup} - -"
|
(tmpfilesConfig {
|
||||||
|
type = "d";
|
||||||
|
path = cacheLocation;
|
||||||
|
mode = "0750";
|
||||||
|
user = flixUser;
|
||||||
|
group = flixGroup;
|
||||||
|
})
|
||||||
];
|
];
|
||||||
|
|
||||||
systemd.services.flix-index = {
|
systemd.services.flix-index = {
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{ lib, pkgs, config, ... }:
|
{ lib, pkgs, config, ... }:
|
||||||
let
|
let
|
||||||
inherit (import <niveum/lib>) nixpkgs-unstable;
|
inherit (import <niveum/lib>) nixpkgs-unstable tmpfilesConfig;
|
||||||
radioStore = "/var/lib/radio";
|
radioStore = "/var/lib/radio";
|
||||||
htgenPort = 8080;
|
htgenPort = 8080;
|
||||||
meddl = { streamPort = 8000; mpdPort = 6600; };
|
meddl = { streamPort = 8000; mpdPort = 6600; };
|
||||||
@@ -40,7 +40,13 @@ in
|
|||||||
];
|
];
|
||||||
|
|
||||||
systemd.tmpfiles.rules = [
|
systemd.tmpfiles.rules = [
|
||||||
"d '${radioStore}' 0755 ${config.users.extraUsers.radio.name} - 1d -"
|
(tmpfilesConfig {
|
||||||
|
type = "d";
|
||||||
|
path = radioStore;
|
||||||
|
mode = "0755";
|
||||||
|
user = config.users.extraUsers.radio.name;
|
||||||
|
age = "1d";
|
||||||
|
})
|
||||||
];
|
];
|
||||||
|
|
||||||
users.extraUsers.radio.isSystemUser = true;
|
users.extraUsers.radio.isSystemUser = true;
|
||||||
|
|||||||
@@ -5,6 +5,8 @@ rec {
|
|||||||
};
|
};
|
||||||
nixpkgs-unstable = import nixpkgs-src { config.allowUnfree = true; };
|
nixpkgs-unstable = import nixpkgs-src { config.allowUnfree = true; };
|
||||||
|
|
||||||
|
tmpfilesConfig = {type, path, mode ? "-", user ? "-", group ? "-", age ? "-", argument ? "-"}: "${type} '${path}' ${mode} ${user} ${group} ${age} ${argument}";
|
||||||
|
|
||||||
sshPort = 22022;
|
sshPort = 22022;
|
||||||
|
|
||||||
colours = import ./colours/mac-os.nix;
|
colours = import ./colours/mac-os.nix;
|
||||||
|
|||||||
Reference in New Issue
Block a user