Major overhaul of the nix side of things.

This commit is contained in:
r-vdp 2023-03-24 14:14:20 +01:00
parent 9aaa5e58f7
commit 9759c2da12
No known key found for this signature in database
6 changed files with 418 additions and 210 deletions

View file

@ -56,36 +56,31 @@ which should contain a `default.nix` file which functions as the entrance point.
A simple System Manager module could look something like this:
```nix
{ config, lib, pkgs, ... }:
let
etcFiles = {
"foo.conf".text = ''
launch_the_rockets = true
'';
};
{ config
, lib
, pkgs
, ... }:
services = {
foo = {
enable = true;
serviceConfig = {
Type = "oneshot";
RemainAfterExit = true;
};
wantedBy = [ "multi-user.target" ];
script = ''
echo "We launched the rockets!"
{
config.system-manager = {
environment.etc = {
"foo.conf".text = ''
launch_the_rockets = true
'';
};
};
in
{
config = {
system-manager = {
etcFiles = lib.attrNames etcFiles;
services = lib.attrNames services;
systemd.services = {
foo = {
enable = true;
serviceConfig = {
Type = "oneshot";
RemainAfterExit = true;
};
wantedBy = [ "multi-user.target" ];
script = ''
echo "We launched the rockets!"
'';
};
};
environment.etc = etcFiles;
systemd = { inherit services; };
};
}
```