This repository was archived by the owner on Jun 27, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathflake.nix
More file actions
58 lines (51 loc) · 1.79 KB
/
flake.nix
File metadata and controls
58 lines (51 loc) · 1.79 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
{
description = "Deploy Linglong anywhere";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
flake-utils.url = "github:numtide/flake-utils";
};
outputs = { self, nixpkgs, flake-utils }:
flake-utils.lib.eachSystem [ "x86_64-linux" ]
(system:
{
packages = flake-utils.lib.flattenTree (
import ./. { pkgs = nixpkgs.legacyPackages.${system}; }
);
nixosModules = { config, lib, ... }:
with lib;
with self.packages.${system};
let cfg = config.services.linglong; in
{
options = {
services.linglong = {
enable = mkEnableOption "linglong" // {
default = true;
};
};
};
config = mkIf cfg.enable {
environment = {
profiles = [ "${linglong}/etc/profile.d" ];
sessionVariables.LINGLONG_ROOT = "/var/lib/linglong";
systemPackages = [ linglong ];
};
services.dbus.packages = [ linglong ];
systemd = {
packages = [ linglong ];
tmpfiles.rules = [
"C /var/lib/linglong 0775 deepin-linglong deepin-linglong - ${linglong-root}"
"Z /var/lib/linglong 0775 deepin-linglong deepin-linglong - -"
"d /var/log/linglong 0757 root root - -"
];
};
users = {
groups.deepin-linglong = { };
users.deepin-linglong = {
group = "deepin-linglong";
isSystemUser = true;
};
};
};
};
});
}