1
0
mirror of https://github.com/kmein/niveum synced 2026-03-16 10:11:08 +01:00

feat: tmpfiles.d helper function

This commit is contained in:
2021-03-23 21:00:21 +01:00
parent e3f3e4045a
commit b8967c8e5c
3 changed files with 18 additions and 3 deletions

View File

@@ -5,6 +5,7 @@ let
indexFilename = "index";
flixUser = "flix";
flixGroup = "users";
inherit (import <niveum/lib>) tmpfilesConfig;
in {
fileSystems.${flixLocation} = {
device = "prism.r:/export";
@@ -24,7 +25,13 @@ in {
};
systemd.tmpfiles.rules = [
"d '${cacheLocation}' 0750 ${flixUser} ${flixGroup} - -"
(tmpfilesConfig {
type = "d";
path = cacheLocation;
mode = "0750";
user = flixUser;
group = flixGroup;
})
];
systemd.services.flix-index = {

View File

@@ -1,6 +1,6 @@
{ lib, pkgs, config, ... }:
let
inherit (import <niveum/lib>) nixpkgs-unstable;
inherit (import <niveum/lib>) nixpkgs-unstable tmpfilesConfig;
radioStore = "/var/lib/radio";
htgenPort = 8080;
meddl = { streamPort = 8000; mpdPort = 6600; };
@@ -40,7 +40,13 @@ in
];
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;

View File

@@ -5,6 +5,8 @@ rec {
};
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;
colours = import ./colours/mac-os.nix;