From 98b4cde2e45c8b8f76e4b0638aab4f3e12680559 Mon Sep 17 00:00:00 2001 From: clerie Date: Mon, 7 Apr 2025 17:16:00 +0200 Subject: [PATCH 1/5] pkgs/git-show-link: Pass format args as dataclass --- pkgs/git-show-link/git-show-link.py | 26 +++++++++++++++++++------- 1 file changed, 19 insertions(+), 7 deletions(-) diff --git a/pkgs/git-show-link/git-show-link.py b/pkgs/git-show-link/git-show-link.py index 0364cd3..3ed4981 100755 --- a/pkgs/git-show-link/git-show-link.py +++ b/pkgs/git-show-link/git-show-link.py @@ -1,6 +1,7 @@ #!/usr/bin/env python3 import argparse +from dataclasses import dataclass import re import subprocess @@ -8,17 +9,26 @@ REMOTE_TYPES = [ { # github "match": re.compile(r'git@github.com:(?P[\w\.-]+)/(?P[\w\.-]+).git'), - "format-branch": lambda g, b: f"https://github.com/{g['username']}/{g['project']}/tree/{b}/", - "format-commit": lambda g, c: f"https://github.com/{g['username']}/{g['project']}/commit/{c}/", + "format-branch": lambda g: f"https://github.com/{g.username}/{g.project}/tree/{g.branch}/", + "format-commit": lambda g: f"https://github.com/{g.username}/{g.project}/commit/{g.commit}/", }, { # gitea "match": re.compile(r'(?P[\w\.-]+)@(?P[\w\.-]+):(?P[\w\.-]+)/(?P[\w\.-]+).git'), - "format-branch": lambda g, b: f"https://{g['host']}/{g['username']}/{g['project']}/src/branch/{b}/", - "format-commit": lambda g, c: f"https://{g['host']}/{g['username']}/{g['project']}/commit/{c}/", + "format-branch": lambda g: f"https://{g.host}/{g.username}/{g.project}/src/branch/{g.branch}/", + "format-commit": lambda g: f"https://{g.host}/{g.username}/{g.project}/commit/{g.commit}/", }, ] +@dataclass +class FormatArgs: + gituser: str = None + host: str = None + username: str = None + project: str = None + commit: str = None + branch: str = None + def get_remote_branch(): s = subprocess.run(["git", "status", "--porcelain", "-uno", "-b", "--no-ahead-behind"], capture_output=True, text=True) @@ -71,13 +81,15 @@ def main(): if m is None: continue - g = m.groupdict() + g = FormatArgs(**m.groupdict()) if args.display_branch: - print(remote_type["format-branch"](g, r["branch"])) + g.branch = r["branch"] + print(remote_type["format-branch"](g)) else: commit = get_last_commit() - print(remote_type["format-commit"](g, commit)) + g.commit = commit + print(remote_type["format-commit"](g)) break From 323018daaa7f832b03e1fccd479115e4787bcfd8 Mon Sep 17 00:00:00 2001 From: clerie Date: Mon, 7 Apr 2025 21:11:53 +0200 Subject: [PATCH 2/5] profiles/common-dns: Fix typo --- profiles/common-dns/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/profiles/common-dns/default.nix b/profiles/common-dns/default.nix index c3d4a15..3d44bfd 100644 --- a/profiles/common-dns/default.nix +++ b/profiles/common-dns/default.nix @@ -16,7 +16,7 @@ with lib; # Do not use any DNS servers as fallback services.resolved.fallbackDns = []; - networking.networkmanager.dns = "systemd-networkd"; + networking.networkmanager.dns = "systemd-resolved"; }; } From 8af0eb238639180feb6a417f5f506aae6558349e Mon Sep 17 00:00:00 2001 From: clerie Date: Mon, 7 Apr 2025 21:27:03 +0200 Subject: [PATCH 3/5] profiles/common: Make common-networking the default --- hosts/_iso/configuration.nix | 3 --- hosts/aluminium/configuration.nix | 3 --- hosts/astatine/configuration.nix | 3 --- hosts/beryllium/configuration.nix | 3 --- hosts/carbon/configuration.nix | 2 ++ hosts/clerie-backup/configuration.nix | 3 --- hosts/dn42-il-gw1/configuration.nix | 1 - hosts/dn42-il-gw5/configuration.nix | 1 - hosts/dn42-il-gw6/configuration.nix | 1 - hosts/dn42-ildix-clerie/configuration.nix | 1 - hosts/dn42-ildix-service/configuration.nix | 1 - hosts/gatekeeper/configuration.nix | 3 --- hosts/hydra-1/configuration.nix | 3 --- hosts/hydra-2/configuration.nix | 3 --- hosts/krypton/network.nix | 2 -- hosts/mail-2/configuration.nix | 3 --- hosts/monitoring-3/configuration.nix | 3 --- hosts/nonat/configuration.nix | 3 --- hosts/osmium/configuration.nix | 3 --- hosts/palladium/configuration.nix | 3 --- hosts/porter/configuration.nix | 2 -- hosts/storage-2/configuration.nix | 3 --- hosts/tungsten/configuration.nix | 3 --- hosts/web-2/configuration.nix | 3 --- hosts/zinc/configuration.nix | 2 -- profiles/common/default.nix | 5 ++--- 26 files changed, 4 insertions(+), 62 deletions(-) diff --git a/hosts/_iso/configuration.nix b/hosts/_iso/configuration.nix index b4af756..9d267aa 100644 --- a/hosts/_iso/configuration.nix +++ b/hosts/_iso/configuration.nix @@ -13,9 +13,6 @@ # https://github.com/NixOS/nixpkgs/issues/327187 boot.initrd.systemd.enable = false; - networking.useDHCP = false; - systemd.network.enable = true; - networking.hostName = "isowo"; isoImage.isoBaseName = lib.mkForce "nixos-isowo"; diff --git a/hosts/aluminium/configuration.nix b/hosts/aluminium/configuration.nix index 87d0aa0..a753a9c 100644 --- a/hosts/aluminium/configuration.nix +++ b/hosts/aluminium/configuration.nix @@ -18,9 +18,6 @@ terminal_output serial "; - networking.useDHCP = false; - systemd.network.enable = true; - profiles.clerie.wg-clerie = { enable = true; ipv6s = [ "2a01:4f8:c0c:15f1::8106/128" ]; diff --git a/hosts/astatine/configuration.nix b/hosts/astatine/configuration.nix index 72ad6bd..74fed00 100644 --- a/hosts/astatine/configuration.nix +++ b/hosts/astatine/configuration.nix @@ -18,9 +18,6 @@ terminal_output serial "; - networking.useDHCP = false; - systemd.network.enable = true; - profiles.clerie.wg-clerie = { enable = true; ipv6s = [ "2a01:4f8:c0c:15f1::8108/128" ]; diff --git a/hosts/beryllium/configuration.nix b/hosts/beryllium/configuration.nix index 274d44c..4a6fd4c 100644 --- a/hosts/beryllium/configuration.nix +++ b/hosts/beryllium/configuration.nix @@ -20,9 +20,6 @@ networking.hostName = "beryllium"; - networking.useDHCP = false; - systemd.network.enable = true; - networking.firewall.enable = false; profiles.clerie.wg-clerie = { diff --git a/hosts/carbon/configuration.nix b/hosts/carbon/configuration.nix index 0f6387b..5bf6cf3 100644 --- a/hosts/carbon/configuration.nix +++ b/hosts/carbon/configuration.nix @@ -22,6 +22,8 @@ ./wg-clerie.nix ]; + profiles.clerie.common-networking.enable = false; + boot.kernelParams = [ "console=ttyS0,115200n8" ]; boot.loader.grub.enable = true; diff --git a/hosts/clerie-backup/configuration.nix b/hosts/clerie-backup/configuration.nix index bca9dd8..0fd7e09 100644 --- a/hosts/clerie-backup/configuration.nix +++ b/hosts/clerie-backup/configuration.nix @@ -13,9 +13,6 @@ boot.loader.grub.enable = true; boot.loader.grub.device = "/dev/vda"; - networking.useDHCP = false; - systemd.network.enable = true; - systemd.network.networks."10-wan" = { matchConfig.Name = "ens18"; address = [ diff --git a/hosts/dn42-il-gw1/configuration.nix b/hosts/dn42-il-gw1/configuration.nix index 6eb8ea2..f447802 100644 --- a/hosts/dn42-il-gw1/configuration.nix +++ b/hosts/dn42-il-gw1/configuration.nix @@ -7,7 +7,6 @@ ]; profiles.clerie.mercury-vm.enable = true; - profiles.clerie.common-networking.enable = true; boot.loader.grub.enable = true; boot.loader.grub.device = "/dev/vda"; diff --git a/hosts/dn42-il-gw5/configuration.nix b/hosts/dn42-il-gw5/configuration.nix index 73c43e6..c6befb3 100644 --- a/hosts/dn42-il-gw5/configuration.nix +++ b/hosts/dn42-il-gw5/configuration.nix @@ -7,7 +7,6 @@ ]; profiles.clerie.mercury-vm.enable = true; - profiles.clerie.common-networking.enable = true; boot.loader.grub.enable = true; boot.loader.grub.device = "/dev/vda"; diff --git a/hosts/dn42-il-gw6/configuration.nix b/hosts/dn42-il-gw6/configuration.nix index 1615e77..4e9354f 100644 --- a/hosts/dn42-il-gw6/configuration.nix +++ b/hosts/dn42-il-gw6/configuration.nix @@ -7,7 +7,6 @@ ]; profiles.clerie.cybercluster-vm.enable = true; - profiles.clerie.common-networking.enable = true; boot.loader.grub.enable = true; boot.loader.grub.device = "/dev/vda"; diff --git a/hosts/dn42-ildix-clerie/configuration.nix b/hosts/dn42-ildix-clerie/configuration.nix index c51fb69..be9fd50 100644 --- a/hosts/dn42-ildix-clerie/configuration.nix +++ b/hosts/dn42-ildix-clerie/configuration.nix @@ -7,7 +7,6 @@ ]; profiles.clerie.mercury-vm.enable = true; - profiles.clerie.common-networking.enable = true; boot.loader.grub.enable = true; boot.loader.grub.device = "/dev/vda"; diff --git a/hosts/dn42-ildix-service/configuration.nix b/hosts/dn42-ildix-service/configuration.nix index 8c1b997..15c21b5 100644 --- a/hosts/dn42-ildix-service/configuration.nix +++ b/hosts/dn42-ildix-service/configuration.nix @@ -10,7 +10,6 @@ ]; profiles.clerie.mercury-vm.enable = true; - profiles.clerie.common-networking.enable = true; # Use the GRUB 2 boot loader. boot.loader.grub.enable = true; diff --git a/hosts/gatekeeper/configuration.nix b/hosts/gatekeeper/configuration.nix index 4c7eee9..3af79d9 100644 --- a/hosts/gatekeeper/configuration.nix +++ b/hosts/gatekeeper/configuration.nix @@ -12,9 +12,6 @@ boot.loader.grub.enable = true; boot.loader.grub.device = "/dev/sda"; - networking.useDHCP = false; - systemd.network.enable = true; - systemd.network.networks."10-wan" = { address = [ "2a01:4f8:c0c:15f1::1/64" diff --git a/hosts/hydra-1/configuration.nix b/hosts/hydra-1/configuration.nix index 9788887..c4d58d6 100644 --- a/hosts/hydra-1/configuration.nix +++ b/hosts/hydra-1/configuration.nix @@ -22,9 +22,6 @@ "aarch64-linux" ]; - networking.useDHCP = false; - systemd.network.enable = true; - systemd.network.networks."10-wan" = { matchConfig.Name = "ens18"; address = [ diff --git a/hosts/hydra-2/configuration.nix b/hosts/hydra-2/configuration.nix index 8b32cc2..870701c 100644 --- a/hosts/hydra-2/configuration.nix +++ b/hosts/hydra-2/configuration.nix @@ -18,9 +18,6 @@ "aarch64-linux" ]; - networking.useDHCP = false; - systemd.network.enable = true; - systemd.network.networks."10-wan" = { matchConfig.Name = "ens18"; address = [ diff --git a/hosts/krypton/network.nix b/hosts/krypton/network.nix index fb71faf..fe7db13 100644 --- a/hosts/krypton/network.nix +++ b/hosts/krypton/network.nix @@ -1,8 +1,6 @@ { ... }: { - profiles.clerie.common-networking.enable = true; - profiles.clerie.wg-clerie = { enable = true; ipv6s = [ "2a01:4f8:c0c:15f1::8011/128" ]; diff --git a/hosts/mail-2/configuration.nix b/hosts/mail-2/configuration.nix index 0086f74..eeaea85 100644 --- a/hosts/mail-2/configuration.nix +++ b/hosts/mail-2/configuration.nix @@ -13,9 +13,6 @@ boot.loader.grub.enable = true; boot.loader.grub.device = "/dev/sda"; - networking.useDHCP = false; - systemd.network.enable = true; - systemd.network.networks."10-wan" = { address = [ "2a01:4f8:1c1c:9577::1/64" diff --git a/hosts/monitoring-3/configuration.nix b/hosts/monitoring-3/configuration.nix index 54ff328..e7c3e8e 100644 --- a/hosts/monitoring-3/configuration.nix +++ b/hosts/monitoring-3/configuration.nix @@ -18,9 +18,6 @@ boot.loader.grub.enable = true; boot.loader.grub.device = "/dev/sda"; - networking.useDHCP = false; - systemd.network.enable = true; - systemd.network.networks."10-wan" = { matchConfig.Name = "ens19"; address = [ diff --git a/hosts/nonat/configuration.nix b/hosts/nonat/configuration.nix index 741055c..47d7495 100644 --- a/hosts/nonat/configuration.nix +++ b/hosts/nonat/configuration.nix @@ -12,9 +12,6 @@ boot.loader.grub.enable = true; boot.loader.grub.device = "/dev/vda"; - networking.useDHCP = false; - systemd.network.enable = true; - systemd.network.networks."10-wan" = { matchConfig.Name = "ens18"; address = [ diff --git a/hosts/osmium/configuration.nix b/hosts/osmium/configuration.nix index 83aae36..0203384 100644 --- a/hosts/osmium/configuration.nix +++ b/hosts/osmium/configuration.nix @@ -20,9 +20,6 @@ "aarch64-linux" ]; - networking.useDHCP = false; - systemd.network.enable = true; - systemd.network.networks."10-wan" = { matchConfig.Name = "ens19"; address = [ diff --git a/hosts/palladium/configuration.nix b/hosts/palladium/configuration.nix index 7ac2f64..7790fce 100644 --- a/hosts/palladium/configuration.nix +++ b/hosts/palladium/configuration.nix @@ -30,9 +30,6 @@ boot.swraid.enable = true; - networking.useDHCP = false; - systemd.network.enable = true; - systemd.network.networks."10-wan" = { matchConfig.Name = "enp3s0"; address = [ diff --git a/hosts/porter/configuration.nix b/hosts/porter/configuration.nix index 7974fb1..30d3851 100644 --- a/hosts/porter/configuration.nix +++ b/hosts/porter/configuration.nix @@ -12,8 +12,6 @@ boot.loader.grub.enable = true; boot.loader.grub.device = "/dev/sda"; - networking.useDHCP = false; - systemd.network.enable = true; systemd.network.networks."10-wan" = { matchConfig.Name = "ens3"; address = [ diff --git a/hosts/storage-2/configuration.nix b/hosts/storage-2/configuration.nix index 403171f..88f13cc 100644 --- a/hosts/storage-2/configuration.nix +++ b/hosts/storage-2/configuration.nix @@ -15,9 +15,6 @@ boot.loader.grub.enable = true; boot.loader.grub.device = "/dev/vda"; - networking.useDHCP = false; - systemd.network.enable = true; - systemd.network.networks."10-wan" = { matchConfig.Name = "ens18"; address = [ diff --git a/hosts/tungsten/configuration.nix b/hosts/tungsten/configuration.nix index 2751f57..9906604 100644 --- a/hosts/tungsten/configuration.nix +++ b/hosts/tungsten/configuration.nix @@ -18,9 +18,6 @@ terminal_output serial "; - networking.useDHCP = false; - systemd.network.enable = true; - networking.hostName = "tungsten"; profiles.clerie.wg-clerie = { diff --git a/hosts/web-2/configuration.nix b/hosts/web-2/configuration.nix index 93ea4f5..fd45575 100644 --- a/hosts/web-2/configuration.nix +++ b/hosts/web-2/configuration.nix @@ -33,9 +33,6 @@ boot.loader.grub.enable = true; boot.loader.grub.device = "/dev/sda"; - networking.useDHCP = false; - systemd.network.enable = true; - systemd.network.networks."10-wan" = { address = [ "2a01:4f8:c0c:c580::1/64" diff --git a/hosts/zinc/configuration.nix b/hosts/zinc/configuration.nix index 07c0747..4567591 100644 --- a/hosts/zinc/configuration.nix +++ b/hosts/zinc/configuration.nix @@ -11,8 +11,6 @@ ./programs.nix ]; - profiles.clerie.common-networking.enable = true; - # Use the systemd-boot EFI boot loader. boot.loader.systemd-boot.enable = true; boot.loader.efi.canTouchEfiVariables = true; diff --git a/profiles/common/default.nix b/profiles/common/default.nix index 7cf3a64..186683c 100644 --- a/profiles/common/default.nix +++ b/profiles/common/default.nix @@ -10,10 +10,9 @@ with lib; config = mkIf config.profiles.clerie.common.enable { - profiles.clerie.common-dns.enable = true; + profiles.clerie.common-dns.enable = mkDefault true; - # Disabled while we are still in transition - #profiles.clerie.common-network.enable = true; + profiles.clerie.common-networking.enable = mkDefault true; }; } From 32ec59e303af3b19c2d4b362873b8c2909304c08 Mon Sep 17 00:00:00 2001 From: clerie Date: Mon, 7 Apr 2025 21:37:47 +0200 Subject: [PATCH 4/5] pkgs/clerie-update-nixfiles: Add script to delete old update-nixfiles branches --- .../clerie-update-nixfiles/clerie-cleanup-branches.nix | 10 ++++++++++ pkgs/clerie-update-nixfiles/clerie-cleanup-branches.sh | 7 +++++++ pkgs/pkgs.nix | 1 + 3 files changed, 18 insertions(+) create mode 100644 pkgs/clerie-update-nixfiles/clerie-cleanup-branches.nix create mode 100755 pkgs/clerie-update-nixfiles/clerie-cleanup-branches.sh diff --git a/pkgs/clerie-update-nixfiles/clerie-cleanup-branches.nix b/pkgs/clerie-update-nixfiles/clerie-cleanup-branches.nix new file mode 100644 index 0000000..4b3aa15 --- /dev/null +++ b/pkgs/clerie-update-nixfiles/clerie-cleanup-branches.nix @@ -0,0 +1,10 @@ +{ pkgs, ... }: + +pkgs.writeShellApplication { + name = "clerie-cleanup-branches"; + text = builtins.readFile ./clerie-cleanup-branches.sh; + runtimeInputs = with pkgs; [ + git + ]; +} + diff --git a/pkgs/clerie-update-nixfiles/clerie-cleanup-branches.sh b/pkgs/clerie-update-nixfiles/clerie-cleanup-branches.sh new file mode 100755 index 0000000..a3fa8a1 --- /dev/null +++ b/pkgs/clerie-update-nixfiles/clerie-cleanup-branches.sh @@ -0,0 +1,7 @@ +#!/usr/bin/env bash + +# Removes all branches from origin starting with updated-inputs-* except the 8 newest ones + +git fetch origin --prune + +git branch -r | sed "s/^ *//g" | grep "^origin/updated-inputs-" | sort | head -n -8 | sed "s/^origin\///g" | xargs git push origin --delete diff --git a/pkgs/pkgs.nix b/pkgs/pkgs.nix index 2b70d54..5e8c91d 100644 --- a/pkgs/pkgs.nix +++ b/pkgs/pkgs.nix @@ -1,5 +1,6 @@ { clerie-backup = final: prev: final.callPackage ./clerie-backup {}; + clerie-cleanup-branches = final: prev: final.callPackage ./clerie-update-nixfiles/clerie-cleanup-branches.nix {}; clerie-keys = final: prev: final.callPackage ./clerie-keys {}; clerie-system-remote-install = final: prev: final.callPackage ./clerie-system-remote-install {}; clerie-system-upgrade = final: prev: final.callPackage ./clerie-system-upgrade/clerie-system-upgrade.nix {}; From d14f4d80281fe61394301b23d07bb197a54cd44b Mon Sep 17 00:00:00 2001 From: Flake Update Bot Date: Tue, 8 Apr 2025 03:03:51 +0200 Subject: [PATCH 5/5] Update nixpkgs 2025-04-08-01-03 --- flake.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/flake.lock b/flake.lock index e7345fc..424bb53 100644 --- a/flake.lock +++ b/flake.lock @@ -533,11 +533,11 @@ }, "nixpkgs_3": { "locked": { - "lastModified": 1742069588, - "narHash": "sha256-C7jVfohcGzdZRF6DO+ybyG/sqpo1h6bZi9T56sxLy+k=", + "lastModified": 1743964447, + "narHash": "sha256-nEo1t3Q0F+0jQ36HJfbJtiRU4OI+/0jX/iITURKe3EE=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "c80f6a7e10b39afcc1894e02ef785b1ad0b0d7e5", + "rev": "063dece00c5a77e4a0ea24e5e5a5bd75232806f8", "type": "github" }, "original": {