diff options
-rw-r--r-- | common/commandline/htop.nix | 127 | ||||
-rw-r--r-- | common/tinc.nix | 7 | ||||
-rw-r--r-- | flake.lock | 16 | ||||
-rw-r--r-- | flake.nix | 28 | ||||
-rw-r--r-- | usecases/desktop/graphical/mpv.nix | 3 | ||||
-rw-r--r-- | usecases/desktop/graphical/sway.nix | 6 | ||||
-rw-r--r-- | usecases/desktop/pipewire.nix | 7 | ||||
-rw-r--r-- | usecases/server/hydra-server.nix | 5 | ||||
-rw-r--r-- | usecases/server/jellyfin.nix | 1 | ||||
-rw-r--r-- | usecases/server/monitoring-server.nix | 4 | ||||
-rw-r--r-- | usecases/server/radicale.nix | 9 | ||||
-rw-r--r-- | usecases/server/taskserver.nix | 3 |
12 files changed, 132 insertions, 84 deletions
diff --git a/common/commandline/htop.nix b/common/commandline/htop.nix index 95763a0..dd04405 100644 --- a/common/commandline/htop.nix +++ b/common/commandline/htop.nix | |||
@@ -3,44 +3,101 @@ inputs: | |||
3 | { config, ... }: | 3 | { config, ... }: |
4 | 4 | ||
5 | { | 5 | { |
6 | home-manager.users.minijackson = { ... }: | 6 | home-manager.users.minijackson = { config, ... }: |
7 | { | 7 | { |
8 | programs.htop = { | 8 | programs.htop = { |
9 | enable = true; | 9 | enable = true; |
10 | 10 | ||
11 | fields = [ | 11 | settings = { |
12 | "PID" "USER" | 12 | fields = with config.lib.htop.fields; [ |
13 | "PRIORITY" "NICE" | 13 | PID |
14 | "STATE" | 14 | USER |
15 | "IO_PRIORITY" "IO_READ_RATE" "IO_WRITE_RATE" | 15 | PRIORITY |
16 | "PERCENT_CPU" "PERCENT_MEM" | 16 | NICE |
17 | "TIME" | 17 | STATE |
18 | "COMM" | 18 | IO_PRIORITY |
19 | ]; | 19 | IO_READ_RATE |
20 | 20 | IO_WRITE_RATE | |
21 | hideThreads = true; | 21 | PERCENT_CPU |
22 | hideUserlandThreads = true; | 22 | PERCENT_MEM |
23 | showThreadNames = true; | 23 | TIME |
24 | shadowOtherUsers = true; | 24 | COMM |
25 | 25 | ]; | |
26 | highlightBaseName = true; | 26 | |
27 | 27 | hide_threads = true; | |
28 | # On NixOS? NO. | 28 | hide_kernel_threads = true; |
29 | showProgramPath = false; | 29 | hide_userland_threads = true; |
30 | 30 | show_thread_names = true; | |
31 | treeView = true; | 31 | shadow_other_users = true; |
32 | 32 | ||
33 | meters = { | 33 | highlight_base_name = true; |
34 | left = [ "LeftCPUs2" "Memory" "Swap" "Blank" { kind = "Battery"; mode = 1; } ]; | 34 | |
35 | right = [ "RightCPUs2" "Blank" "Tasks" "LoadAverage" "Uptime" ]; | 35 | # On NixOS? NO. |
36 | show_program_path = false; | ||
37 | |||
38 | tree_view = true; | ||
39 | |||
40 | left_meters = [ | ||
41 | "LeftCPUs" | ||
42 | "Memory" | ||
43 | "Swap" | ||
44 | "Zram" | ||
45 | "Blank" | ||
46 | "Battery" | ||
47 | ]; | ||
48 | left_meter_modes = with config.lib.htop.modes; [ | ||
49 | Bar | ||
50 | Bar | ||
51 | Bar | ||
52 | Bar | ||
53 | Text | ||
54 | Bar | ||
55 | ]; | ||
56 | |||
57 | right_meters = [ | ||
58 | "RightCPUs" | ||
59 | "Blank" | ||
60 | "Tasks" | ||
61 | "LoadAverage" | ||
62 | "Uptime" | ||
63 | "Systemd" | ||
64 | ]; | ||
65 | right_meter_modes = with config.lib.htop.modes; [ | ||
66 | Bar | ||
67 | Text | ||
68 | Text | ||
69 | Text | ||
70 | Text | ||
71 | Text | ||
72 | ]; | ||
73 | # TODO: this doesn't keep the order: | ||
74 | # https://github.com/nix-community/home-manager/issues/2060 | ||
75 | /* | ||
76 | } // (with config.lib.htop; leftMeters { | ||
77 | LeftCPUs2 = modes.Bar; | ||
78 | Memory = modes.Bar; | ||
79 | Swap = modes.Bar; | ||
80 | Blank = modes.Text; | ||
81 | Battery = modes.Bar; | ||
82 | }) // (with config.lib.htop; rightMeters { | ||
83 | RightCPUs2 = modes.Bar; | ||
84 | Blank = modes.Text; | ||
85 | Tasks = modes.Text; | ||
86 | LoadAverage = modes.Text; | ||
87 | Uptime = modes.Text; | ||
88 | }); | ||
89 | */ | ||
90 | }; | ||
36 | }; | 91 | }; |
37 | }; | 92 | }; |
38 | }; | ||
39 | 93 | ||
40 | home-manager.users.root = { ... }: | 94 | home-manager.users.root = { ... }: |
41 | { | 95 | { |
42 | programs.htop = config.home-manager.users.minijackson.programs.htop // { | 96 | programs.htop = { |
43 | shadowOtherUsers = false; | 97 | enable = true; |
98 | settings = config.home-manager.users.minijackson.programs.htop.settings // { | ||
99 | shadowOtherUsers = false; | ||
100 | }; | ||
101 | }; | ||
44 | }; | 102 | }; |
45 | }; | ||
46 | } | 103 | } |
diff --git a/common/tinc.nix b/common/tinc.nix index c77afb7..d176355 100644 --- a/common/tinc.nix +++ b/common/tinc.nix | |||
@@ -5,13 +5,6 @@ inputs: | |||
5 | with lib; | 5 | with lib; |
6 | with builtins; | 6 | with builtins; |
7 | { | 7 | { |
8 | # TODO: remove use of unstable for NixOS 21.05 | ||
9 | imports = [ | ||
10 | (inputs.nixpkgs-unstable.outPath + "/nixos/modules/services/networking/tinc.nix") | ||
11 | ]; | ||
12 | |||
13 | disabledModules = [ "services/networking/tinc.nix" ]; | ||
14 | |||
15 | options.topology = { | 8 | options.topology = { |
16 | mainVpn = { | 9 | mainVpn = { |
17 | interfaceName = mkOption { | 10 | interfaceName = mkOption { |
@@ -37,16 +37,16 @@ | |||
37 | ] | 37 | ] |
38 | }, | 38 | }, |
39 | "locked": { | 39 | "locked": { |
40 | "lastModified": 1622312678, | 40 | "lastModified": 1622312560, |
41 | "narHash": "sha256-LsVDvO6TBnSQNNoV+Dt10+jx91eS74k8hf4zIOMAyR0=", | 41 | "narHash": "sha256-xBWgiwnPaL/iZasPxw3BuvPAee/2jiToiZjKvKLs+PA=", |
42 | "owner": "nix-community", | 42 | "owner": "nix-community", |
43 | "repo": "home-manager", | 43 | "repo": "home-manager", |
44 | "rev": "49706878e1580d796cc99b63574310405935113f", | 44 | "rev": "ab64dc32493996c24607eab2cae6663466ddfb8a", |
45 | "type": "github" | 45 | "type": "github" |
46 | }, | 46 | }, |
47 | "original": { | 47 | "original": { |
48 | "owner": "nix-community", | 48 | "owner": "nix-community", |
49 | "ref": "release-20.09", | 49 | "ref": "release-21.05", |
50 | "repo": "home-manager", | 50 | "repo": "home-manager", |
51 | "type": "github" | 51 | "type": "github" |
52 | } | 52 | } |
@@ -76,16 +76,16 @@ | |||
76 | }, | 76 | }, |
77 | "nixpkgs": { | 77 | "nixpkgs": { |
78 | "locked": { | 78 | "locked": { |
79 | "lastModified": 1622559709, | 79 | "lastModified": 1622577619, |
80 | "narHash": "sha256-wnZUu3JNQTwu7q301TOsZFGxAcgBV8C3qks/aB8wztQ=", | 80 | "narHash": "sha256-ODWgeRVXJz++vvapHSNO2G7AACfRjQoWMomuLhl+OcQ=", |
81 | "owner": "NixOS", | 81 | "owner": "NixOS", |
82 | "repo": "nixpkgs", | 82 | "repo": "nixpkgs", |
83 | "rev": "cee3ca37c68dad981396365bf4b1d0c807ac4eb4", | 83 | "rev": "5237039cc1e7633a7697ed7999afd1f80d91ff14", |
84 | "type": "github" | 84 | "type": "github" |
85 | }, | 85 | }, |
86 | "original": { | 86 | "original": { |
87 | "owner": "NixOS", | 87 | "owner": "NixOS", |
88 | "ref": "nixos-20.09", | 88 | "ref": "nixos-21.05", |
89 | "repo": "nixpkgs", | 89 | "repo": "nixpkgs", |
90 | "type": "github" | 90 | "type": "github" |
91 | } | 91 | } |
@@ -1,11 +1,11 @@ | |||
1 | { | 1 | { |
2 | description = "My NixOS configurations"; | 2 | description = "My NixOS configurations"; |
3 | 3 | ||
4 | inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-20.09"; | 4 | inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-21.05"; |
5 | inputs.nixpkgs-unstable.url = "github:NixOS/nixpkgs/nixos-unstable"; | 5 | inputs.nixpkgs-unstable.url = "github:NixOS/nixpkgs/nixos-unstable"; |
6 | inputs.flake-utils.url = "github:numtide/flake-utils"; | 6 | inputs.flake-utils.url = "github:numtide/flake-utils"; |
7 | inputs.home-manager = { | 7 | inputs.home-manager = { |
8 | url = "github:nix-community/home-manager/release-20.09"; | 8 | url = "github:nix-community/home-manager/release-21.05"; |
9 | inputs.nixpkgs.follows = "nixpkgs"; | 9 | inputs.nixpkgs.follows = "nixpkgs"; |
10 | }; | 10 | }; |
11 | inputs.neovim-master = { | 11 | inputs.neovim-master = { |
@@ -26,8 +26,8 @@ | |||
26 | test = { config, ... }: { | 26 | test = { config, ... }: { |
27 | imports = [ self.nixosModules.default ]; | 27 | imports = [ self.nixosModules.default ]; |
28 | 28 | ||
29 | home-manager.users.minijackson.home.stateVersion = "20.09"; | 29 | home-manager.users.minijackson.home.stateVersion = "21.05"; |
30 | home-manager.users.root.home.stateVersion = "20.09"; | 30 | home-manager.users.root.home.stateVersion = "21.05"; |
31 | 31 | ||
32 | users.users.minijackson.initialHashedPassword = ""; | 32 | users.users.minijackson.initialHashedPassword = ""; |
33 | users.users.root.initialHashedPassword = ""; | 33 | users.users.root.initialHashedPassword = ""; |
@@ -109,6 +109,15 @@ | |||
109 | modules = [ | 109 | modules = [ |
110 | self.nixosModules.test | 110 | self.nixosModules.test |
111 | self.nixosModules.profiles.desktop | 111 | self.nixosModules.profiles.desktop |
112 | |||
113 | ({ modulesPath, ... }: { | ||
114 | imports = [ | ||
115 | (modulesPath + "/virtualisation/qemu-vm.nix") | ||
116 | ]; | ||
117 | |||
118 | virtualisation.memorySize = 1024; | ||
119 | virtualisation.qemu.options = [ "-vga none -device virtio-gpu-pci" ]; | ||
120 | }) | ||
112 | ]; | 121 | ]; |
113 | }; | 122 | }; |
114 | 123 | ||
@@ -118,6 +127,15 @@ | |||
118 | self.nixosModules.test | 127 | self.nixosModules.test |
119 | self.nixosModules.profiles.desktop | 128 | self.nixosModules.profiles.desktop |
120 | self.nixosModules.usecases.desktop.development | 129 | self.nixosModules.usecases.desktop.development |
130 | |||
131 | ({ modulesPath, ... }: { | ||
132 | imports = [ | ||
133 | (modulesPath + "/virtualisation/qemu-vm.nix") | ||
134 | ]; | ||
135 | |||
136 | virtualisation.memorySize = 1024; | ||
137 | virtualisation.qemu.options = [ "-vga none -device virtio-gpu-pci" ]; | ||
138 | }) | ||
121 | ]; | 139 | ]; |
122 | }; | 140 | }; |
123 | 141 | ||
@@ -201,8 +219,6 @@ | |||
201 | networking.hostId = "4e98920d"; | 219 | networking.hostId = "4e98920d"; |
202 | 220 | ||
203 | services.hydra = { | 221 | services.hydra = { |
204 | hydraURL = "localhost:3000"; | ||
205 | notificationSender = "hydra@localhost"; | ||
206 | secretKeyLocation = builtins.toFile | 222 | secretKeyLocation = builtins.toFile |
207 | "store-secret-key" | 223 | "store-secret-key" |
208 | "testServer:0d5jJjOxIoe6sTr2YKWkQxsM3ZcW+9GAk52yYNVxfYBUxS2nUfzfQk5Jo0OwHnT95bTLXCVNQETGV4m6KHsVCA=="; | 224 | "testServer:0d5jJjOxIoe6sTr2YKWkQxsM3ZcW+9GAk52yYNVxfYBUxS2nUfzfQk5Jo0OwHnT95bTLXCVNQETGV4m6KHsVCA=="; |
diff --git a/usecases/desktop/graphical/mpv.nix b/usecases/desktop/graphical/mpv.nix index 381b893..219c86c 100644 --- a/usecases/desktop/graphical/mpv.nix +++ b/usecases/desktop/graphical/mpv.nix | |||
@@ -9,8 +9,7 @@ inputs: | |||
9 | hwdec = "auto"; | 9 | hwdec = "auto"; |
10 | profile = "gpu-hq"; | 10 | profile = "gpu-hq"; |
11 | }; | 11 | }; |
12 | # TODO: for 21.05 | 12 | defaultProfiles = [ "gpu-hq" ]; |
13 | #defaultProfiles = [ "gpu-hq" ]; | ||
14 | scripts = with pkgs.mpvScripts; [ mpris sponsorblock ]; | 13 | scripts = with pkgs.mpvScripts; [ mpris sponsorblock ]; |
15 | }; | 14 | }; |
16 | } | 15 | } |
diff --git a/usecases/desktop/graphical/sway.nix b/usecases/desktop/graphical/sway.nix index ab04de3..ab5d997 100644 --- a/usecases/desktop/graphical/sway.nix +++ b/usecases/desktop/graphical/sway.nix | |||
@@ -171,8 +171,6 @@ in | |||
171 | }; | 171 | }; |
172 | }; | 172 | }; |
173 | 173 | ||
174 | # TODO: 21.05 | ||
175 | /* | ||
176 | services.wlsunset = { | 174 | services.wlsunset = { |
177 | enable = true; | 175 | enable = true; |
178 | latitude = "48.864716"; | 176 | latitude = "48.864716"; |
@@ -184,7 +182,6 @@ in | |||
184 | }; | 182 | }; |
185 | systemdTarget = "sway-session.target"; | 183 | systemdTarget = "sway-session.target"; |
186 | }; | 184 | }; |
187 | */ | ||
188 | 185 | ||
189 | # TODO: upstream a PR to beautify this | 186 | # TODO: upstream a PR to beautify this |
190 | xdg.configFile."swaylock/config".text = with globalConfig.theme.colors; '' | 187 | xdg.configFile."swaylock/config".text = with globalConfig.theme.colors; '' |
@@ -254,8 +251,7 @@ in | |||
254 | 251 | ||
255 | environment.systemPackages = with pkgs; [ qt5.qtwayland ]; | 252 | environment.systemPackages = with pkgs; [ qt5.qtwayland ]; |
256 | 253 | ||
257 | # TODO: in 21.05 | 254 | programs.xwayland.enable = true; |
258 | #programs.xwayland.enable = true; | ||
259 | security.pam.services.swaylock = { }; | 255 | security.pam.services.swaylock = { }; |
260 | 256 | ||
261 | xdg.portal.extraPortals = with pkgs; [ | 257 | xdg.portal.extraPortals = with pkgs; [ |
diff --git a/usecases/desktop/pipewire.nix b/usecases/desktop/pipewire.nix index e742ba9..cd327ee 100644 --- a/usecases/desktop/pipewire.nix +++ b/usecases/desktop/pipewire.nix | |||
@@ -3,13 +3,6 @@ inputs: | |||
3 | { pkgs, ... }: | 3 | { pkgs, ... }: |
4 | 4 | ||
5 | { | 5 | { |
6 | imports = [ | ||
7 | (inputs.nixpkgs-unstable.outPath + "/nixos/modules/services/desktops/pipewire/pipewire.nix") | ||
8 | (inputs.nixpkgs-unstable.outPath + "/nixos/modules/services/desktops/pipewire/pipewire-media-session.nix") | ||
9 | ]; | ||
10 | |||
11 | disabledModules = [ "services/desktops/pipewire.nix" ]; | ||
12 | |||
13 | services.pipewire = { | 6 | services.pipewire = { |
14 | enable = true; | 7 | enable = true; |
15 | package = pkgs.unstable.pipewire; | 8 | package = pkgs.unstable.pipewire; |
diff --git a/usecases/server/hydra-server.nix b/usecases/server/hydra-server.nix index 3a1d62e..db09a6e 100644 --- a/usecases/server/hydra-server.nix +++ b/usecases/server/hydra-server.nix | |||
@@ -15,9 +15,8 @@ inputs: | |||
15 | config = { | 15 | config = { |
16 | services.hydra = { | 16 | services.hydra = { |
17 | enable = true; | 17 | enable = true; |
18 | # TODO: for NixOS 21.05 | 18 | hydraURL = "https://hydra.${config.networking.fqdn}"; |
19 | #hydraURL = "https://hydra.${config.networking.fqdn}"; | 19 | notificationSender = "hydra@${config.networking.fqdn}"; |
20 | #notificationSender = "hydra@${config.networking.fqdn}"; | ||
21 | buildMachinesFiles = [ ]; | 20 | buildMachinesFiles = [ ]; |
22 | # Don't build *everything* from source | 21 | # Don't build *everything* from source |
23 | useSubstitutes = true; | 22 | useSubstitutes = true; |
diff --git a/usecases/server/jellyfin.nix b/usecases/server/jellyfin.nix index 0e0a0e4..6f62c34 100644 --- a/usecases/server/jellyfin.nix +++ b/usecases/server/jellyfin.nix | |||
@@ -3,7 +3,6 @@ inputs: | |||
3 | { config, lib, pkgs, ... }: | 3 | { config, lib, pkgs, ... }: |
4 | 4 | ||
5 | { | 5 | { |
6 | # TODO: for NixOS 21.05 | ||
7 | imports = [ | 6 | imports = [ |
8 | (inputs.nixpkgs-unstable.outPath + "/nixos/modules/services/misc/jellyfin.nix") | 7 | (inputs.nixpkgs-unstable.outPath + "/nixos/modules/services/misc/jellyfin.nix") |
9 | ]; | 8 | ]; |
diff --git a/usecases/server/monitoring-server.nix b/usecases/server/monitoring-server.nix index 823f4f9..c39b145 100644 --- a/usecases/server/monitoring-server.nix +++ b/usecases/server/monitoring-server.nix | |||
@@ -12,9 +12,7 @@ inputs: | |||
12 | 12 | ||
13 | listenAddress = "127.0.0.1"; | 13 | listenAddress = "127.0.0.1"; |
14 | 14 | ||
15 | # TODO: for NixOS 21.05 | 15 | retentionTime = "15w"; |
16 | extraFlags = [ "--storage.tsdb.retention=15w" ]; | ||
17 | #retentionTime = "15w"; | ||
18 | 16 | ||
19 | scrapeConfigs = [ | 17 | scrapeConfigs = [ |
20 | { | 18 | { |
diff --git a/usecases/server/radicale.nix b/usecases/server/radicale.nix index a998643..b20bff8 100644 --- a/usecases/server/radicale.nix +++ b/usecases/server/radicale.nix | |||
@@ -3,13 +3,12 @@ inputs: | |||
3 | { config, ... }: | 3 | { config, ... }: |
4 | 4 | ||
5 | { | 5 | { |
6 | # TODO: use RFC42 settings for NixOS 21.05 | ||
7 | services.radicale = { | 6 | services.radicale = { |
8 | enable = true; | 7 | enable = true; |
9 | config = '' | 8 | settings = { |
10 | [server] | 9 | # Bind address on VPN interface only |
11 | hosts = ${config.topology.mainVpn.currentNodeIP}:5232 | 10 | server.hosts = "[${config.topology.mainVpn.currentNodeIP}]:5232"; |
12 | ''; | 11 | }; |
13 | }; | 12 | }; |
14 | 13 | ||
15 | networking.firewall.interfaces.${config.topology.mainVpn.interfaceName}.allowedTCPPorts = [ | 14 | networking.firewall.interfaces.${config.topology.mainVpn.interfaceName}.allowedTCPPorts = [ |
diff --git a/usecases/server/taskserver.nix b/usecases/server/taskserver.nix index e459e5c..614828c 100644 --- a/usecases/server/taskserver.nix +++ b/usecases/server/taskserver.nix | |||
@@ -5,8 +5,7 @@ inputs: | |||
5 | { | 5 | { |
6 | services.taskserver = { | 6 | services.taskserver = { |
7 | enable = true; | 7 | enable = true; |
8 | # TODO: for NixOS 21.05 | 8 | fqdn = "tasks.${config.networking.fqdn}"; |
9 | #fqdn = "tasks.${config.networking.fqdn}"; | ||
10 | listenHost = config.topology.mainVpn.currentNodeIP; | 9 | listenHost = config.topology.mainVpn.currentNodeIP; |
11 | 10 | ||
12 | organisations.default.users = [ "minijackson" ]; | 11 | organisations.default.users = [ "minijackson" ]; |