diff options
author | Gregor Kleen <gkleen@yggdrasil.li> | 2024-08-01 10:31:11 +0200 |
---|---|---|
committer | Gregor Kleen <gkleen@yggdrasil.li> | 2024-08-01 10:31:11 +0200 |
commit | 48f8d3c11d9117f10e6ca5b76a08b91cef5c861b (patch) | |
tree | 1c0aed455c6cd4d73a390463e0ed40582fc481c4 | |
parent | 3c203b2eb88055d4e8a6cffecf257b9f1a2009d9 (diff) | |
download | nixos-48f8d3c11d9117f10e6ca5b76a08b91cef5c861b.tar nixos-48f8d3c11d9117f10e6ca5b76a08b91cef5c861b.tar.gz nixos-48f8d3c11d9117f10e6ca5b76a08b91cef5c861b.tar.bz2 nixos-48f8d3c11d9117f10e6ca5b76a08b91cef5c861b.tar.xz nixos-48f8d3c11d9117f10e6ca5b76a08b91cef5c861b.zip |
...
-rw-r--r-- | hosts/sif/default.nix | 16 | ||||
-rw-r--r-- | hosts/sif/hw.nix | 76 | ||||
-rw-r--r-- | overlays/radicale.nix | 13 | ||||
-rwxr-xr-x | overlays/worktime/worktime/__main__.py | 4 | ||||
-rw-r--r-- | user-profiles/yt-dlp.nix | 2 |
5 files changed, 69 insertions, 42 deletions
diff --git a/hosts/sif/default.nix b/hosts/sif/default.nix index 87c0f3bf..96cd66cc 100644 --- a/hosts/sif/default.nix +++ b/hosts/sif/default.nix | |||
@@ -31,7 +31,7 @@ in { | |||
31 | boot = { | 31 | boot = { |
32 | initrd = { | 32 | initrd = { |
33 | systemd = { | 33 | systemd = { |
34 | enable = true; | 34 | enable = false; |
35 | emergencyAccess = config.users.users.root.hashedPassword; | 35 | emergencyAccess = config.users.users.root.hashedPassword; |
36 | }; | 36 | }; |
37 | luks.devices = { | 37 | luks.devices = { |
@@ -423,6 +423,17 @@ in { | |||
423 | }; | 423 | }; |
424 | }; | 424 | }; |
425 | 425 | ||
426 | systemd.tmpfiles.rules = [ | ||
427 | "d /var/lib/lightdm/.cache/lightdm-gtk-greeter 1770 lightdm lightdm -" | ||
428 | "L /var/lib/lightdm/.cache/lightdm-gtk-greeter/state - - - - ${pkgs.writeText "state" '' | ||
429 | [greeter] | ||
430 | last-user=gkleen | ||
431 | last-session=none+xmonad | ||
432 | ''}" | ||
433 | |||
434 | "L /etc/localtime - - - - /.bcachefs/etc/localtime" | ||
435 | ]; | ||
436 | |||
426 | users = { | 437 | users = { |
427 | users.gkleen.extraGroups = [ "media" "plugdev" "input" "rtkit" ]; | 438 | users.gkleen.extraGroups = [ "media" "plugdev" "input" "rtkit" ]; |
428 | groups.media = {}; | 439 | groups.media = {}; |
@@ -444,6 +455,7 @@ in { | |||
444 | "log.level" = 2; | 455 | "log.level" = 2; |
445 | "core.daemon" = true; | 456 | "core.daemon" = true; |
446 | "core.name" = "pipewire-0"; | 457 | "core.name" = "pipewire-0"; |
458 | "module.x11.bell" = false; | ||
447 | }; | 459 | }; |
448 | "context.modules" = [ | 460 | "context.modules" = [ |
449 | { | 461 | { |
@@ -623,7 +635,7 @@ in { | |||
623 | zramSwap = { | 635 | zramSwap = { |
624 | enable = true; | 636 | enable = true; |
625 | algorithm = "zstd"; | 637 | algorithm = "zstd"; |
626 | writebackDevice = "/dev/disk/by-uuid/50f3f856-cc17-4614-846a-34a14d5006ec"; | 638 | writebackDevice = "/dev/disk/by-label/swap"; |
627 | }; | 639 | }; |
628 | 640 | ||
629 | services.pcscd.enable = true; | 641 | services.pcscd.enable = true; |
diff --git a/hosts/sif/hw.nix b/hosts/sif/hw.nix index a2991def..d01582e0 100644 --- a/hosts/sif/hw.nix +++ b/hosts/sif/hw.nix | |||
@@ -7,87 +7,89 @@ | |||
7 | fsType = "vfat"; | 7 | fsType = "vfat"; |
8 | options = [ "fmask=0033" "dmask=0022" ]; | 8 | options = [ "fmask=0033" "dmask=0022" ]; |
9 | }; | 9 | }; |
10 | # "/.bcachefs" = | 10 | "/.bcachefs" = |
11 | # { device = "/dev/mapper/sif-nvm0:/dev/mapper/sif-nvm1"; | 11 | { device = "/dev/mapper/sif-nvm0:/dev/mapper/sif-nvm1"; |
12 | # fsType = "bcachefs"; | 12 | fsType = "bcachefs"; |
13 | # neededForBoot = true; | 13 | neededForBoot = true; |
14 | # }; | 14 | }; |
15 | "/nix" = | 15 | "/nix" = |
16 | { device = "/.bcachefs/nix"; | 16 | { device = "/.bcachefs/nix"; |
17 | fsType = "none"; | 17 | fsType = "none"; |
18 | options = [ "bind" "x-systemd.after=bcachefs.service" "x-systemd.requires=bcachefs.service" ]; | 18 | options = [ "bind" ]; # "x-systemd.after=bcachefs.service" "x-systemd.requires=bcachefs.service" "x-systemd.after=\\x2ebcachefs.mount" "x-systemd.requires=\\x2ebcachefs.mount" ]; |
19 | }; | 19 | }; |
20 | "/root" = | 20 | "/root" = |
21 | { device = "/.bcachefs/root"; | 21 | { device = "/.bcachefs/root"; |
22 | fsType = "none"; | 22 | fsType = "none"; |
23 | options = [ "bind" ]; | 23 | options = [ "bind" ]; # "x-systemd.after=\\x2ebcachefs.mount" "x-systemd.requires=\\x2ebcachefs.mount" ]; |
24 | }; | 24 | }; |
25 | "/var/log" = | 25 | "/var/log" = |
26 | { device = "/.bcachefs/var/log"; | 26 | { device = "/.bcachefs/var/log"; |
27 | fsType = "none"; | 27 | fsType = "none"; |
28 | options = [ "bind" "x-systemd.after=bcachefs.service" "x-systemd.requires=bcachefs.service" ]; | 28 | options = [ "bind" ]; # "x-systemd.after=bcachefs.service" "x-systemd.requires=bcachefs.service" "x-systemd.after=\\x2ebcachefs.mount" "x-systemd.requires=\\x2ebcachefs.mount" ]; |
29 | }; | 29 | }; |
30 | "/var/lib/sops-nix" = | 30 | "/var/lib/sops-nix" = |
31 | { device = "/.bcachefs/var/lib/sops-nix"; | 31 | { device = "/.bcachefs/var/lib/sops-nix"; |
32 | fsType = "none"; | 32 | fsType = "none"; |
33 | options = [ "bind" "x-systemd.after=bcachefs.service" "x-systemd.requires=bcachefs.service" ]; | 33 | options = [ "bind" ]; # "x-systemd.after=bcachefs.service" "x-systemd.requires=bcachefs.service" "x-systemd.after=\\x2ebcachefs.mount" "x-systemd.requires=\\x2ebcachefs.mount" ]; |
34 | neededForBoot = true; | 34 | neededForBoot = true; |
35 | }; | 35 | }; |
36 | "/var/lib/nixos" = | 36 | "/var/lib/nixos" = |
37 | { device = "/.bcachefs/var/lib/nixos"; | 37 | { device = "/.bcachefs/var/lib/nixos"; |
38 | fsType = "none"; | 38 | fsType = "none"; |
39 | options = [ "bind" "x-systemd.after=bcachefs.service" "x-systemd.requires=bcachefs.service" ]; | 39 | options = [ "bind" ]; # "x-systemd.after=bcachefs.service" "x-systemd.requires=bcachefs.service" "x-systemd.after=\\x2ebcachefs.mount" "x-systemd.requires=\\x2ebcachefs.mount" ]; |
40 | }; | 40 | }; |
41 | "/var/lib/chrony" = | 41 | "/var/lib/chrony" = |
42 | { device = "/.bcachefs/var/lib/chrony"; | 42 | { device = "/.bcachefs/var/lib/chrony"; |
43 | fsType = "none"; | 43 | fsType = "none"; |
44 | options = [ "bind" ]; | 44 | options = [ "bind" ]; # "x-systemd.after=\\x2ebcachefs.mount" "x-systemd.requires=\\x2ebcachefs.mount" ]; |
45 | }; | 45 | }; |
46 | "/var/lib/fprint" = | 46 | "/var/lib/fprint" = |
47 | { device = "/.bcachefs/var/lib/fprint"; | 47 | { device = "/.bcachefs/var/lib/fprint"; |
48 | fsType = "none"; | 48 | fsType = "none"; |
49 | options = [ "bind" ]; | 49 | options = [ "bind" ]; # "x-systemd.after=\\x2ebcachefs.mount" "x-systemd.requires=\\x2ebcachefs.mount" ]; |
50 | }; | 50 | }; |
51 | "/var/lib/systemd" = | 51 | "/var/lib/systemd" = |
52 | { device = "/.bcachefs/var/lib/systemd"; | 52 | { device = "/.bcachefs/var/lib/systemd"; |
53 | fsType = "none"; | 53 | fsType = "none"; |
54 | options = [ "bind" "x-systemd.after=bcachefs.service" "x-systemd.requires=bcachefs.service" ]; | 54 | options = [ "bind" ]; # "x-systemd.after=bcachefs.service" "x-systemd.requires=bcachefs.service" "x-systemd.after=\\x2ebcachefs.mount" "x-systemd.requires=\\x2ebcachefs.mount" ]; |
55 | neededForBoot = true; | 55 | neededForBoot = true; |
56 | }; | 56 | }; |
57 | "/home" = | 57 | "/home" = |
58 | { device = "/.bcachefs/home"; | 58 | { device = "/.bcachefs/home"; |
59 | fsType = "none"; | 59 | fsType = "none"; |
60 | options = [ "bind" ]; | 60 | options = [ "bind" ]; # "x-systemd.after=\\x2ebcachefs.mount" "x-systemd.requires=\\x2ebcachefs.mount" ]; |
61 | }; | 61 | }; |
62 | "/etc/NetworkManager/system-connections" = | 62 | "/etc/NetworkManager/system-connections" = |
63 | { device = "/.bcachefs/etc/NetworkManager/system-connections"; | 63 | { device = "/.bcachefs/etc/NetworkManager/system-connections"; |
64 | fsType = "none"; | 64 | fsType = "none"; |
65 | options = [ "bind" ]; | 65 | options = [ "bind" ]; # "x-systemd.after=\\x2ebcachefs.mount" "x-systemd.requires=\\x2ebcachefs.mount" ]; |
66 | }; | 66 | }; |
67 | }; | 67 | }; |
68 | 68 | ||
69 | boot.initrd.supportedFilesystems.bcachefs = true; | 69 | # boot.initrd.supportedFilesystems.bcachefs = true; |
70 | boot.initrd.systemd.units."dev-sif-nvm0:-dev-sif-nvm1.device".enable = false; | 70 | # boot.initrd.systemd.units."dev-sif-nvm0:-dev-sif-nvm1.device".enable = false; |
71 | systemd.units."dev-sif-nvm0:-dev-sif-nvm1.device".enable = false; | 71 | # systemd.units."dev-sif-nvm0:-dev-sif-nvm1.device".enable = false; |
72 | boot.initrd.systemd.services."bcachefs" = { | 72 | # boot.initrd.systemd.services."bcachefs" = { |
73 | before = [ "initrd-fs.target" ]; | 73 | # before = [ "initrd-fs.target" ]; |
74 | after = [ "local-fs-pre.target" "dev-sif-nvm0.device" "dev-sif-nvm1.device" ]; | 74 | # after = [ "local-fs-pre.target" "dev-sif-nvm0.device" "dev-sif-nvm1.device" ]; |
75 | requires = [ "dev-sif-nvm0.device" "dev-sif-nvm1.device" ]; | 75 | # requires = [ "dev-sif-nvm0.device" "dev-sif-nvm1.device" ]; |
76 | wantedBy = [ "initrd-fs.target" ]; | 76 | # wantedBy = [ "initrd-fs.target" ]; |
77 | unitConfig = { | 77 | # unitConfig = { |
78 | DefaultDependencies = false; | 78 | # DefaultDependencies = false; |
79 | StopPropagatedFrom = [ "dev-sif-nvm0.device" "dev-sif-nvm1.device" ]; | 79 | # StopPropagatedFrom = [ "dev-sif-nvm0.device" "dev-sif-nvm1.device" ]; |
80 | }; | 80 | # }; |
81 | serviceConfig = { | 81 | # serviceConfig = { |
82 | Type = "oneshot"; | 82 | # Type = "oneshot"; |
83 | ExecStart = "/bin/mount -o X-mount.mkdir -t bcachefs /dev/sif/nvm0:/dev/sif/nvm1 /sysroot/.bcachefs"; | 83 | # ExecStart = "/bin/mount -o X-mount.mkdir -t bcachefs /dev/sif/nvm0:/dev/sif/nvm1 /sysroot/.bcachefs"; |
84 | RemainAfterExit = true; | 84 | # RemainAfterExit = true; |
85 | }; | 85 | # }; |
86 | }; | 86 | # }; |
87 | 87 | # systemd.services."bcachefs" = { | |
88 | swapDevices = [ | 88 | # serviceConfig = { |
89 | { label = "swap"; } | 89 | # Type = "oneshot"; |
90 | ]; | 90 | # ExecStart = "${pkgs.coreutils}/bin/true"; |
91 | # }; | ||
92 | # }; | ||
91 | 93 | ||
92 | nix.settings.max-jobs = 12; | 94 | nix.settings.max-jobs = 12; |
93 | # High-DPI console | 95 | # High-DPI console |
diff --git a/overlays/radicale.nix b/overlays/radicale.nix new file mode 100644 index 00000000..a4179295 --- /dev/null +++ b/overlays/radicale.nix | |||
@@ -0,0 +1,13 @@ | |||
1 | { prev, ... }: | ||
2 | let | ||
3 | nixpkgs = prev.fetchFromGitHub { | ||
4 | owner = "NixOS"; | ||
5 | repo = "nixpkgs"; | ||
6 | rev = "5fa4d405272ea98dab145f0c9f7ea1dbb9c87c31"; | ||
7 | hash = "sha256-Qwwbt4vbqwllUJElZomSybbZkbmhsuIac3gqrl+GVUs="; | ||
8 | }; | ||
9 | pkgs = (import (nixpkgs + "/pkgs/top-level")) { localSystem = prev.stdenv.buildPlatform.system; }; | ||
10 | in rec { | ||
11 | radicale3 = radicale; | ||
12 | inherit (pkgs) radicale; | ||
13 | } | ||
diff --git a/overlays/worktime/worktime/__main__.py b/overlays/worktime/worktime/__main__.py index 5630837b..0df226fa 100755 --- a/overlays/worktime/worktime/__main__.py +++ b/overlays/worktime/worktime/__main__.py | |||
@@ -42,7 +42,7 @@ class TogglAPISection(Enum): | |||
42 | REPORTS = '/reports/api/v2' | 42 | REPORTS = '/reports/api/v2' |
43 | 43 | ||
44 | class TogglAPIError(Exception): | 44 | class TogglAPIError(Exception): |
45 | def __init__(self, http_error, response): | 45 | def __init__(self, response, *, http_error=None): |
46 | self.http_error = http_error | 46 | self.http_error = http_error |
47 | self.response = response | 47 | self.response = response |
48 | 48 | ||
@@ -179,7 +179,7 @@ class TogglAPI(object): | |||
179 | url = self._make_url(api = TogglAPISection.TOGGL, section = ['me', 'time_entries', 'current']) | 179 | url = self._make_url(api = TogglAPISection.TOGGL, section = ['me', 'time_entries', 'current']) |
180 | r = self._query(url = url, method='GET') | 180 | r = self._query(url = url, method='GET') |
181 | 181 | ||
182 | if not r or not r.json(): | 182 | if not r or (not r.json() and r.json() is not None): |
183 | raise TogglAPIError(r) | 183 | raise TogglAPIError(r) |
184 | 184 | ||
185 | if not r.json() or not r.json()['billable']: | 185 | if not r.json() or not r.json()['billable']: |
diff --git a/user-profiles/yt-dlp.nix b/user-profiles/yt-dlp.nix index 005f56ff..7d2a1082 100644 --- a/user-profiles/yt-dlp.nix +++ b/user-profiles/yt-dlp.nix | |||
@@ -19,7 +19,7 @@ | |||
19 | concurrent-fragments = 12; | 19 | concurrent-fragments = 12; |
20 | buffer-size = "16K"; | 20 | buffer-size = "16K"; |
21 | sponsorblock-mark = "all"; | 21 | sponsorblock-mark = "all"; |
22 | restrict-filenames = true; | 22 | # restrict-filenames = true; |
23 | # extractor-args = lib.concatStringsSep ";" [ | 23 | # extractor-args = lib.concatStringsSep ";" [ |
24 | # "youtube:player-client=android,web" | 24 | # "youtube:player-client=android,web" |
25 | # "youtube:formats=dashy" | 25 | # "youtube:formats=dashy" |