summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGregor Kleen <gkleen@yggdrasil.li>2024-08-22 14:48:24 +0200
committerGregor Kleen <gkleen@yggdrasil.li>2024-08-22 14:48:24 +0200
commit567c22812fe1fbe525f1732661d253b3902710a9 (patch)
treeb78ce8007f265ed9d542f7992beca14a12327dec
parentd88404d51a6acd082e9917467862105ff1266367 (diff)
downloadnixos-567c22812fe1fbe525f1732661d253b3902710a9.tar
nixos-567c22812fe1fbe525f1732661d253b3902710a9.tar.gz
nixos-567c22812fe1fbe525f1732661d253b3902710a9.tar.bz2
nixos-567c22812fe1fbe525f1732661d253b3902710a9.tar.xz
nixos-567c22812fe1fbe525f1732661d253b3902710a9.zip
...
-rw-r--r--accounts/gkleen@sif/default.nix25
-rw-r--r--accounts/gkleen@sif/emacs.el6
-rw-r--r--accounts/gkleen@sif/hyprland.nix3
-rw-r--r--accounts/gkleen@sif/libvirt/default.nix13
-rw-r--r--flake.lock37
-rw-r--r--flake.nix4
-rw-r--r--hosts/sif/default.nix9
-rw-r--r--hosts/sif/libvirt/default.nix38
-rw-r--r--system-profiles/core/default.nix10
-rw-r--r--user-profiles/core.nix14
-rw-r--r--user-profiles/mpv/default.nix1
11 files changed, 135 insertions, 25 deletions
diff --git a/accounts/gkleen@sif/default.nix b/accounts/gkleen@sif/default.nix
index 09864bb2..61769adb 100644
--- a/accounts/gkleen@sif/default.nix
+++ b/accounts/gkleen@sif/default.nix
@@ -99,6 +99,7 @@ in {
99 99
100 home-manager.users.${userName} = { 100 home-manager.users.${userName} = {
101 imports = [ 101 imports = [
102 ./libvirt
102 flakeInputs.nix-index-database.hmModules.nix-index 103 flakeInputs.nix-index-database.hmModules.nix-index
103 flakeInputs.impermanence.nixosModules.home-manager.impermanence 104 flakeInputs.impermanence.nixosModules.home-manager.impermanence
104 ]; 105 ];
@@ -171,7 +172,7 @@ in {
171 edit-server mediawiki editorconfig typescript-mode 172 edit-server mediawiki editorconfig typescript-mode
172 markdown-mode nftables-mode rustic lsp-mode lsp-ui 173 markdown-mode nftables-mode rustic lsp-mode lsp-ui
173 direnv company projectile tomorrow-night-paradise-theme 174 direnv company projectile tomorrow-night-paradise-theme
174 treesit-grammars.with-all-grammars 175 treesit-grammars.with-all-grammars magit-delta
175 ]; 176 ];
176 overrides = self: super: { 177 overrides = self: super: {
177 tomorrow-night-paradise-theme = super.trivialBuild { 178 tomorrow-night-paradise-theme = super.trivialBuild {
@@ -275,7 +276,7 @@ in {
275 output = "eDP-1"; 276 output = "eDP-1";
276 modules-left = [ "hyprland/workspaces" ]; 277 modules-left = [ "hyprland/workspaces" ];
277 modules-center = [ "hyprland/window" ]; 278 modules-center = [ "hyprland/window" ];
278 modules-right = [ "custom/weather" "custom/keymap" "clock" "privacy" "tray" "wireplumber" "backlight" "battery" "idle_inhibitor" ]; 279 modules-right = [ "custom/weather" "custom/keymap" "privacy" "tray" "wireplumber" "backlight" "battery" "idle_inhibitor" "clock" ];
279 280
280 "custom/weather" = { 281 "custom/weather" = {
281 format = "{}"; 282 format = "{}";
@@ -301,7 +302,7 @@ in {
301 if keymap == "English (programmer Dvorak)": 302 if keymap == "English (programmer Dvorak)":
302 short = "dvp" 303 short = "dvp"
303 elif keymap == "English (US)": 304 elif keymap == "English (US)":
304 short = "us" 305 short = "<span color=\"#ffffff\">us</span>"
305 print(json.dumps({'text': short, 'tooltip': keymap}, separators=(',', ':')), flush=True) # noqa: E501 306 print(json.dumps({'text': short, 'tooltip': keymap}, separators=(',', ':')), flush=True) # noqa: E501
306 307
307 308
@@ -471,6 +472,13 @@ in {
471 472
472 #custom-weather, #custom-keymap { 473 #custom-weather, #custom-keymap {
473 color: @grey; 474 color: @grey;
475 margin: 0 5px;
476 }
477 #custom-weather {
478 margin-right: 3px;
479 }
480 #custom-keymap {
481 margin-left: 3px;
474 } 482 }
475 483
476 #tray { 484 #tray {
@@ -480,6 +488,13 @@ in {
480 color: @grey; 488 color: @grey;
481 margin: 0 5px 0 2px; 489 margin: 0 5px 0 2px;
482 } 490 }
491 #idle_inhibitor {
492 margin-right: 2px;
493 margin-left: 3px;
494 }
495 #battery {
496 margin-right: 3px;
497 }
483 #battery.discharging { 498 #battery.discharging {
484 color: @white; 499 color: @white;
485 } 500 }
@@ -505,7 +520,7 @@ in {
505 margin: -1px 2px 0px 5px; 520 margin: -1px 2px 0px 5px;
506 } 521 }
507 #clock { 522 #clock {
508 margin-right: 5px; 523 /* margin-right: 5px; */
509 } 524 }
510 ''; 525 '';
511 }; 526 };
@@ -691,7 +706,6 @@ in {
691 ]; 706 ];
692 707
693 file = { 708 file = {
694 ".emacs.d/init.el".source = ./emacs.el;
695 ".backup-munin".source = ./backup-patterns; 709 ".backup-munin".source = ./backup-patterns;
696 ".mozilla/firefox/default/chrome/userChrome.css".source = ./firefox-chrome.css; 710 ".mozilla/firefox/default/chrome/userChrome.css".source = ./firefox-chrome.css;
697 ".mozilla/firefox/default/chrome/userContent.css".source = ./firefox-content.css; 711 ".mozilla/firefox/default/chrome/userContent.css".source = ./firefox-content.css;
@@ -757,6 +771,7 @@ in {
757 }; 771 };
758 }; 772 };
759 }; 773 };
774 "emacs/init.el".source = ./emacs.el;
760 }; 775 };
761 776
762 xdg.dataFile = { 777 xdg.dataFile = {
diff --git a/accounts/gkleen@sif/emacs.el b/accounts/gkleen@sif/emacs.el
index 7a8eb8f5..b1b1b198 100644
--- a/accounts/gkleen@sif/emacs.el
+++ b/accounts/gkleen@sif/emacs.el
@@ -38,6 +38,8 @@
38 38
39(evil-set-undo-system 'undo-tree) 39(evil-set-undo-system 'undo-tree)
40 40
41(add-hook 'magit-mode-hook (lambda () (magit-delta-mode +1)))
42
41(global-set-key (kbd "RET") 'newline-and-indent) 43(global-set-key (kbd "RET") 'newline-and-indent)
42(global-set-key (kbd "M-g") 'magit-status) 44(global-set-key (kbd "M-g") 'magit-status)
43(global-set-key (kbd "M-?") 'vc-git-grep) 45(global-set-key (kbd "M-?") 'vc-git-grep)
@@ -54,8 +56,8 @@
54 56
55(global-set-key (kbd "C-x K") 'kill-current-buffer) 57(global-set-key (kbd "C-x K") 'kill-current-buffer)
56 58
57(setq backup-directory-alist `(("." . "~/.saves"))) 59(setq backup-directory-alist `(("." . "~/.local/state/emacs/saves")))
58(setq undo-tree-history-directory-alist `(("." . "~/.undo"))) 60(setq undo-tree-history-directory-alist `(("." . "~/.local/state/emacs/undo")))
59(setq delete-old-versions t 61(setq delete-old-versions t
60 kept-new-versions 6 62 kept-new-versions 6
61 kept-old-versions 2 63 kept-old-versions 2
diff --git a/accounts/gkleen@sif/hyprland.nix b/accounts/gkleen@sif/hyprland.nix
index 9c33fda1..3b2f8879 100644
--- a/accounts/gkleen@sif/hyprland.nix
+++ b/accounts/gkleen@sif/hyprland.nix
@@ -297,6 +297,9 @@ in {
297 "workspace 4, class:^imv$" 297 "workspace 4, class:^imv$"
298 "workspace 4, class:^org\.pwmt\.zathura$" 298 "workspace 4, class:^org\.pwmt\.zathura$"
299 "workspace 10, class:^mpv$" 299 "workspace 10, class:^mpv$"
300 "workspace 1, class:^Element$"
301 "workspace 1, class:^thunderbird$"
302 "workspace 5, class:^virt-manager$"
300 "float, class:^org\.keepassxc\.KeePassXC$, title:Access Request$" 303 "float, class:^org\.keepassxc\.KeePassXC$, title:Access Request$"
301 "center, class:^org\.keepassxc\.KeePassXC$, title:Access Request$" 304 "center, class:^org\.keepassxc\.KeePassXC$, title:Access Request$"
302 "float, class:^org\.keepassxc\.KeePassXC$, title:^Unlock Database" 305 "float, class:^org\.keepassxc\.KeePassXC$, title:^Unlock Database"
diff --git a/accounts/gkleen@sif/libvirt/default.nix b/accounts/gkleen@sif/libvirt/default.nix
new file mode 100644
index 00000000..a93a2266
--- /dev/null
+++ b/accounts/gkleen@sif/libvirt/default.nix
@@ -0,0 +1,13 @@
1{ flakeInputs, ... }:
2
3with flakeInputs.nixVirt.lib;
4
5{
6 config = {
7 virtualisation.libvirt = {
8 enable = true;
9 connections."qemu:///session" = {
10 };
11 };
12 };
13}
diff --git a/flake.lock b/flake.lock
index 8d277b69..e659fdd1 100644
--- a/flake.lock
+++ b/flake.lock
@@ -450,6 +450,26 @@
450 "type": "github" 450 "type": "github"
451 } 451 }
452 }, 452 },
453 "nixVirt": {
454 "inputs": {
455 "nixpkgs": [
456 "nixpkgs"
457 ],
458 "nixpkgs-ovmf": "nixpkgs-ovmf"
459 },
460 "locked": {
461 "lastModified": 1712439808,
462 "narHash": "sha256-QoONoZPBpNTw5cia05QSvDlaxXo3moKAJQOw7c5hMXA=",
463 "rev": "9f1cdca730d92461075709e867c1e9ad93d58a8d",
464 "revCount": 284,
465 "type": "tarball",
466 "url": "https://api.flakehub.com/f/pinned/AshleyYakeley/NixVirt/0.5.0/018eb55e-7beb-75c5-919f-5b5b26136e06/source.tar.gz"
467 },
468 "original": {
469 "type": "tarball",
470 "url": "https://flakehub.com/f/AshleyYakeley/NixVirt/%2A.tar.gz"
471 }
472 },
453 "nixos-hardware": { 473 "nixos-hardware": {
454 "locked": { 474 "locked": {
455 "lastModified": 1722332872, 475 "lastModified": 1722332872,
@@ -552,6 +572,22 @@
552 "type": "github" 572 "type": "github"
553 } 573 }
554 }, 574 },
575 "nixpkgs-ovmf": {
576 "locked": {
577 "lastModified": 1708984720,
578 "narHash": "sha256-gJctErLbXx4QZBBbGp78PxtOOzsDaQ+yw1ylNQBuSUY=",
579 "owner": "NixOS",
580 "repo": "nixpkgs",
581 "rev": "13aff9b34cc32e59d35c62ac9356e4a41198a538",
582 "type": "github"
583 },
584 "original": {
585 "owner": "NixOS",
586 "ref": "nixos-unstable",
587 "repo": "nixpkgs",
588 "type": "github"
589 }
590 },
555 "nixpkgs-pgbackrest": { 591 "nixpkgs-pgbackrest": {
556 "locked": { 592 "locked": {
557 "lastModified": 1685566663, 593 "lastModified": 1685566663,
@@ -812,6 +848,7 @@
812 "home-manager-eostre": "home-manager-eostre", 848 "home-manager-eostre": "home-manager-eostre",
813 "impermanence": "impermanence", 849 "impermanence": "impermanence",
814 "nix-index-database": "nix-index-database", 850 "nix-index-database": "nix-index-database",
851 "nixVirt": "nixVirt",
815 "nixos-hardware": "nixos-hardware", 852 "nixos-hardware": "nixos-hardware",
816 "nixpkgs": "nixpkgs_2", 853 "nixpkgs": "nixpkgs_2",
817 "nixpkgs-eostre": "nixpkgs-eostre", 854 "nixpkgs-eostre": "nixpkgs-eostre",
diff --git a/flake.nix b/flake.nix
index 909d9da3..a5bcc93c 100644
--- a/flake.nix
+++ b/flake.nix
@@ -179,6 +179,10 @@
179 flake-compat.follows = "flake-compat"; 179 flake-compat.follows = "flake-compat";
180 }; 180 };
181 }; 181 };
182 nixVirt = {
183 url = "https://flakehub.com/f/AshleyYakeley/NixVirt/*.tar.gz";
184 inputs.nixpkgs.follows = "nixpkgs";
185 };
182 }; 186 };
183 187
184 outputs = { self, nixpkgs, home-manager, sops-nix, deploy-rs, nvfetcher, ... }@inputs: 188 outputs = { self, nixpkgs, home-manager, sops-nix, deploy-rs, nvfetcher, ... }@inputs:
diff --git a/hosts/sif/default.nix b/hosts/sif/default.nix
index e3becb4b..d2902f95 100644
--- a/hosts/sif/default.nix
+++ b/hosts/sif/default.nix
@@ -12,11 +12,12 @@ let
12in { 12in {
13 imports = with flake.nixosModules.systemProfiles; [ 13 imports = with flake.nixosModules.systemProfiles; [
14 ./hw.nix 14 ./hw.nix
15 ./mail 15 ./mail ./libvirt
16 tmpfs-root bcachefs initrd-all-crypto-modules default-locale openssh rebuild-machines 16 tmpfs-root bcachefs initrd-all-crypto-modules default-locale openssh rebuild-machines
17 networkmanager 17 networkmanager
18 flakeInputs.nixos-hardware.nixosModules.lenovo-thinkpad-p1 18 flakeInputs.nixos-hardware.nixosModules.lenovo-thinkpad-p1
19 flakeInputs.impermanence.nixosModules.impermanence 19 flakeInputs.impermanence.nixosModules.impermanence
20 flakeInputs.nixVirt.nixosModules.default
20 ]; 21 ];
21 22
22 config = { 23 config = {
@@ -627,10 +628,6 @@ in {
627 dconf.enable = true; 628 dconf.enable = true;
628 }; 629 };
629 630
630 virtualisation.libvirtd = {
631 enable = true;
632 };
633
634 zramSwap = { 631 zramSwap = {
635 enable = true; 632 enable = true;
636 algorithm = "zstd"; 633 algorithm = "zstd";
@@ -704,6 +701,8 @@ in {
704 701
705 security.pam.services.gtklock = {}; 702 security.pam.services.gtklock = {};
706 703
704 home-manager.sharedModules = [ flakeInputs.nixVirt.homeModules.default ];
705
707 system.stateVersion = "24.11"; 706 system.stateVersion = "24.11";
708 }; 707 };
709} 708}
diff --git a/hosts/sif/libvirt/default.nix b/hosts/sif/libvirt/default.nix
new file mode 100644
index 00000000..b5d95996
--- /dev/null
+++ b/hosts/sif/libvirt/default.nix
@@ -0,0 +1,38 @@
1{ flakeInputs, ... }:
2
3with flakeInputs.nixVirt.lib;
4
5{
6 config = {
7 virtualisation.libvirtd.qemu.swtpm.enable = true;
8 virtualisation.libvirt = {
9 enable = true;
10 swtpm.enable = true;
11 connections."qemu:///system" = {
12 networks = [
13 { active = null;
14 definition = network.writeXML {
15 name = "default";
16 uuid = "012bfad7-4408-4345-8747-041853ef84c6";
17 forward.mode = "nat";
18 bridge = {
19 name = "virbr0";
20 stp = true;
21 delay = 0;
22 };
23 mac.address = "52:54:00:ad:34:af";
24 ip = {
25 address = "192.168.122.1";
26 netmask = "255.255.255.0";
27 dhcp.range = {
28 start = "192.168.122.2";
29 end = "192.168.122.254";
30 };
31 };
32 };
33 }
34 ];
35 };
36 };
37 };
38}
diff --git a/system-profiles/core/default.nix b/system-profiles/core/default.nix
index 63b9a2b5..fede386b 100644
--- a/system-profiles/core/default.nix
+++ b/system-profiles/core/default.nix
@@ -160,7 +160,17 @@ in {
160 home-manager = { 160 home-manager = {
161 useGlobalPkgs = true; # Otherwise home-manager would only work impurely 161 useGlobalPkgs = true; # Otherwise home-manager would only work impurely
162 useUserPackages = false; 162 useUserPackages = false;
163 useUserService = true;
163 backupFileExtension = "bak"; 164 backupFileExtension = "bak";
165 sharedModules = lib.attrValues flake.homeModules ++ [
166 {
167 manual.manpages.enable = true;
168 systemd.user.startServices = "sd-switch";
169
170 programs.ssh.internallyManaged = mkForce true;
171 }
172 ];
173 extraSpecialArgs = { inherit flake flakeInputs path; };
164 }; 174 };
165 175
166 sops = mkIf hasSops { 176 sops = mkIf hasSops {
diff --git a/user-profiles/core.nix b/user-profiles/core.nix
index ea782a4b..a8af48b3 100644
--- a/user-profiles/core.nix
+++ b/user-profiles/core.nix
@@ -5,19 +5,7 @@ with lib;
5{ 5{
6 config = { 6 config = {
7 users.users.${userName} = {}; # Just make sure the user is created 7 users.users.${userName} = {}; # Just make sure the user is created
8 8 home-manager.users.${userName} = {};
9 home-manager.useUserService = true;
10 home-manager.extraSpecialArgs = { inherit flake flakeInputs path; };
11 home-manager.users.${userName} = {
12 imports = lib.attrValues flake.homeModules;
13
14 config = {
15 manual.manpages.enable = true;
16 systemd.user.startServices = "sd-switch";
17
18 programs.ssh.internallyManaged = mkForce true;
19 };
20 };
21 9
22 systemd.services."home-manager-${utils.escapeSystemdPath userName}" = lib.mkIf (!config.home-manager.enableSystemd) { 10 systemd.services."home-manager-${utils.escapeSystemdPath userName}" = lib.mkIf (!config.home-manager.enableSystemd) {
23 restartIfChanged = false; # only run once on startup, deploy to running system with deploy-rs 11 restartIfChanged = false; # only run once on startup, deploy to running system with deploy-rs
diff --git a/user-profiles/mpv/default.nix b/user-profiles/mpv/default.nix
index 7c8fc603..065b44ac 100644
--- a/user-profiles/mpv/default.nix
+++ b/user-profiles/mpv/default.nix
@@ -54,6 +54,7 @@
54 } 54 }
55 ])}" 55 ])}"
56 ]; 56 ];
57 watch-later-options = lib.concatStringsSep "," [ "start" ];
57 }; 58 };
58 scripts = [ 59 scripts = [
59 (pkgs.stdenv.mkDerivation (sources.mpv-reload // rec { 60 (pkgs.stdenv.mkDerivation (sources.mpv-reload // rec {