Compare commits
	
		
			1 Commits
		
	
	
		
			a3870a4293
			...
			e8090b2915
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| e8090b2915 | 
							
								
								
									
										54
									
								
								flake.lock
									
									
									
										generated
									
									
									
								
							
							
						
						
									
										54
									
								
								flake.lock
									
									
									
										generated
									
									
									
								
							@@ -193,11 +193,11 @@
 | 
				
			|||||||
        ]
 | 
					        ]
 | 
				
			||||||
      },
 | 
					      },
 | 
				
			||||||
      "locked": {
 | 
					      "locked": {
 | 
				
			||||||
        "lastModified": 1728330715,
 | 
					        "lastModified": 1735644329,
 | 
				
			||||||
        "narHash": "sha256-xRJ2nPOXb//u1jaBnDP56M7v5ldavjbtR6lfGqSvcKg=",
 | 
					        "narHash": "sha256-tO3HrHriyLvipc4xr+Ewtdlo7wM1OjXNjlWRgmM7peY=",
 | 
				
			||||||
        "owner": "numtide",
 | 
					        "owner": "numtide",
 | 
				
			||||||
        "repo": "devshell",
 | 
					        "repo": "devshell",
 | 
				
			||||||
        "rev": "dd6b80932022cea34a019e2bb32f6fa9e494dfef",
 | 
					        "rev": "f7795ede5b02664b57035b3b757876703e2c3eac",
 | 
				
			||||||
        "type": "github"
 | 
					        "type": "github"
 | 
				
			||||||
      },
 | 
					      },
 | 
				
			||||||
      "original": {
 | 
					      "original": {
 | 
				
			||||||
@@ -437,11 +437,11 @@
 | 
				
			|||||||
        ]
 | 
					        ]
 | 
				
			||||||
      },
 | 
					      },
 | 
				
			||||||
      "locked": {
 | 
					      "locked": {
 | 
				
			||||||
        "lastModified": 1732466619,
 | 
					        "lastModified": 1739757849,
 | 
				
			||||||
        "narHash": "sha256-T1e5oceypZu3Q8vzICjv1X/sGs9XfJRMW5OuXHgpB3c=",
 | 
					        "narHash": "sha256-Gs076ot1YuAAsYVcyidLKUMIc4ooOaRGO0PqTY7sBzA=",
 | 
				
			||||||
        "owner": "nix-community",
 | 
					        "owner": "nix-community",
 | 
				
			||||||
        "repo": "home-manager",
 | 
					        "repo": "home-manager",
 | 
				
			||||||
        "rev": "f3111f62a23451114433888902a55cf0692b408d",
 | 
					        "rev": "9d3d080aec2a35e05a15cedd281c2384767c2cfe",
 | 
				
			||||||
        "type": "github"
 | 
					        "type": "github"
 | 
				
			||||||
      },
 | 
					      },
 | 
				
			||||||
      "original": {
 | 
					      "original": {
 | 
				
			||||||
@@ -457,11 +457,11 @@
 | 
				
			|||||||
        ]
 | 
					        ]
 | 
				
			||||||
      },
 | 
					      },
 | 
				
			||||||
      "locked": {
 | 
					      "locked": {
 | 
				
			||||||
        "lastModified": 1732884235,
 | 
					        "lastModified": 1741457641,
 | 
				
			||||||
        "narHash": "sha256-r8j6R3nrvwbT1aUp4EPQ1KC7gm0pu9VcV1aNaB+XG6Q=",
 | 
					        "narHash": "sha256-HIoSAfme6BReJI8wbtZxSuALfI21OqagDPlbGkeVX0c=",
 | 
				
			||||||
        "owner": "nix-community",
 | 
					        "owner": "nix-community",
 | 
				
			||||||
        "repo": "home-manager",
 | 
					        "repo": "home-manager",
 | 
				
			||||||
        "rev": "819f682269f4e002884702b87e445c82840c68f2",
 | 
					        "rev": "2c87a6475fba12c9eb04ccb7375da0e32da48dc1",
 | 
				
			||||||
        "type": "github"
 | 
					        "type": "github"
 | 
				
			||||||
      },
 | 
					      },
 | 
				
			||||||
      "original": {
 | 
					      "original": {
 | 
				
			||||||
@@ -471,11 +471,11 @@
 | 
				
			|||||||
    },
 | 
					    },
 | 
				
			||||||
    "impermanence": {
 | 
					    "impermanence": {
 | 
				
			||||||
      "locked": {
 | 
					      "locked": {
 | 
				
			||||||
        "lastModified": 1731242966,
 | 
					        "lastModified": 1737831083,
 | 
				
			||||||
        "narHash": "sha256-B3C3JLbGw0FtLSWCjBxU961gLNv+BOOBC6WvstKLYMw=",
 | 
					        "narHash": "sha256-LJggUHbpyeDvNagTUrdhe/pRVp4pnS6wVKALS782gRI=",
 | 
				
			||||||
        "owner": "nix-community",
 | 
					        "owner": "nix-community",
 | 
				
			||||||
        "repo": "impermanence",
 | 
					        "repo": "impermanence",
 | 
				
			||||||
        "rev": "3ed3f0eaae9fcc0a8331e77e9319c8a4abd8a71a",
 | 
					        "rev": "4b3e914cdf97a5b536a889e939fb2fd2b043a170",
 | 
				
			||||||
        "type": "github"
 | 
					        "type": "github"
 | 
				
			||||||
      },
 | 
					      },
 | 
				
			||||||
      "original": {
 | 
					      "original": {
 | 
				
			||||||
@@ -545,11 +545,11 @@
 | 
				
			|||||||
    },
 | 
					    },
 | 
				
			||||||
    "nixpkgs-mine": {
 | 
					    "nixpkgs-mine": {
 | 
				
			||||||
      "locked": {
 | 
					      "locked": {
 | 
				
			||||||
        "lastModified": 1738258527,
 | 
					        "lastModified": 1741543477,
 | 
				
			||||||
        "narHash": "sha256-qMRx0rK9VDEdd69Vdjmh8opSAtQGcE8qz0goQ+qt7Jk=",
 | 
					        "narHash": "sha256-CIXkalXwVcUFxb2TF33j45GlWWVHGmHu0GaMvVM/f6M=",
 | 
				
			||||||
        "owner": "devplayer0",
 | 
					        "owner": "devplayer0",
 | 
				
			||||||
        "repo": "nixpkgs",
 | 
					        "repo": "nixpkgs",
 | 
				
			||||||
        "rev": "fcf13e28c9c9aacfde5096ef45c55491eeb233e9",
 | 
					        "rev": "811543d59a6dec53bd025bb17be0896f3c37c03a",
 | 
				
			||||||
        "type": "github"
 | 
					        "type": "github"
 | 
				
			||||||
      },
 | 
					      },
 | 
				
			||||||
      "original": {
 | 
					      "original": {
 | 
				
			||||||
@@ -561,11 +561,11 @@
 | 
				
			|||||||
    },
 | 
					    },
 | 
				
			||||||
    "nixpkgs-mine-stable": {
 | 
					    "nixpkgs-mine-stable": {
 | 
				
			||||||
      "locked": {
 | 
					      "locked": {
 | 
				
			||||||
        "lastModified": 1732985894,
 | 
					        "lastModified": 1741456679,
 | 
				
			||||||
        "narHash": "sha256-YYuQQCcSF6KjgtAenZJiBmqt5jqP3UvYgC424VQ+22s=",
 | 
					        "narHash": "sha256-5f6f3yFT4+KDV02PXlKxhJ7ig++oa+NzGwlW8vxWPHk=",
 | 
				
			||||||
        "owner": "devplayer0",
 | 
					        "owner": "devplayer0",
 | 
				
			||||||
        "repo": "nixpkgs",
 | 
					        "repo": "nixpkgs",
 | 
				
			||||||
        "rev": "e0a3f4e2bbc5f7b681e344b389dcbab23f2e92a8",
 | 
					        "rev": "c82613e3e6a22d4cc1e80e1e91bea15c601dbbe7",
 | 
				
			||||||
        "type": "github"
 | 
					        "type": "github"
 | 
				
			||||||
      },
 | 
					      },
 | 
				
			||||||
      "original": {
 | 
					      "original": {
 | 
				
			||||||
@@ -577,11 +577,11 @@
 | 
				
			|||||||
    },
 | 
					    },
 | 
				
			||||||
    "nixpkgs-stable": {
 | 
					    "nixpkgs-stable": {
 | 
				
			||||||
      "locked": {
 | 
					      "locked": {
 | 
				
			||||||
        "lastModified": 1732824227,
 | 
					        "lastModified": 1741332913,
 | 
				
			||||||
        "narHash": "sha256-fYNXgpu1AEeLyd3fQt4Ym0tcVP7cdJ8wRoqJ+CtTRyY=",
 | 
					        "narHash": "sha256-ri1e8ZliWS3Jnp9yqpKApHaOo7KBN33W8ECAKA4teAQ=",
 | 
				
			||||||
        "owner": "NixOS",
 | 
					        "owner": "NixOS",
 | 
				
			||||||
        "repo": "nixpkgs",
 | 
					        "repo": "nixpkgs",
 | 
				
			||||||
        "rev": "c71ad5c34d51dcbda4c15f44ea4e4aa6bb6ac1e9",
 | 
					        "rev": "20755fa05115c84be00b04690630cb38f0a203ad",
 | 
				
			||||||
        "type": "github"
 | 
					        "type": "github"
 | 
				
			||||||
      },
 | 
					      },
 | 
				
			||||||
      "original": {
 | 
					      "original": {
 | 
				
			||||||
@@ -592,11 +592,11 @@
 | 
				
			|||||||
    },
 | 
					    },
 | 
				
			||||||
    "nixpkgs-unstable": {
 | 
					    "nixpkgs-unstable": {
 | 
				
			||||||
      "locked": {
 | 
					      "locked": {
 | 
				
			||||||
        "lastModified": 1732758367,
 | 
					        "lastModified": 1741246872,
 | 
				
			||||||
        "narHash": "sha256-RzaI1RO0UXqLjydtz3GAXSTzHkpb/lLD1JD8a0W4Wpo=",
 | 
					        "narHash": "sha256-Q6pMP4a9ed636qilcYX8XUguvKl/0/LGXhHcRI91p0U=",
 | 
				
			||||||
        "owner": "NixOS",
 | 
					        "owner": "NixOS",
 | 
				
			||||||
        "repo": "nixpkgs",
 | 
					        "repo": "nixpkgs",
 | 
				
			||||||
        "rev": "fa42b5a5f401aab8a32bd33c9a4de0738180dc59",
 | 
					        "rev": "10069ef4cf863633f57238f179a0297de84bd8d3",
 | 
				
			||||||
        "type": "github"
 | 
					        "type": "github"
 | 
				
			||||||
      },
 | 
					      },
 | 
				
			||||||
      "original": {
 | 
					      "original": {
 | 
				
			||||||
@@ -785,11 +785,11 @@
 | 
				
			|||||||
        "sbt": "sbt"
 | 
					        "sbt": "sbt"
 | 
				
			||||||
      },
 | 
					      },
 | 
				
			||||||
      "locked": {
 | 
					      "locked": {
 | 
				
			||||||
        "lastModified": 1720592125,
 | 
					        "lastModified": 1741328331,
 | 
				
			||||||
        "narHash": "sha256-vR89LefkY8mBPWxDTQ8SNg6Z7/J6Yga80T4kSb6MNdk=",
 | 
					        "narHash": "sha256-OtsHm9ykxfAOMRcgFDsqFBBy5Wu0ag7eq1qmTIluVcw=",
 | 
				
			||||||
        "owner": "eikek",
 | 
					        "owner": "eikek",
 | 
				
			||||||
        "repo": "sharry",
 | 
					        "repo": "sharry",
 | 
				
			||||||
        "rev": "604b20517150599cb05dbe178cd35cd10659aa4c",
 | 
					        "rev": "6203b90f9a76357d75c108a27ad00f323d45c1d0",
 | 
				
			||||||
        "type": "github"
 | 
					        "type": "github"
 | 
				
			||||||
      },
 | 
					      },
 | 
				
			||||||
      "original": {
 | 
					      "original": {
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -27,8 +27,8 @@ rec {
 | 
				
			|||||||
  };
 | 
					  };
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  kernel = {
 | 
					  kernel = {
 | 
				
			||||||
    lts = pkgs: pkgs.linuxKernel.packages.linux_6_6;
 | 
					    lts = pkgs: pkgs.linuxKernel.packages.linux_6_12;
 | 
				
			||||||
    latest = pkgs: pkgs.linuxKernel.packages.linux_6_12;
 | 
					    latest = pkgs: pkgs.linuxKernel.packages.linux_6_13;
 | 
				
			||||||
  };
 | 
					  };
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  nginx = rec {
 | 
					  nginx = rec {
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -53,7 +53,7 @@ rec {
 | 
				
			|||||||
    in mkApp "${app}/bin/${app.meta.mainProgram}";
 | 
					    in mkApp "${app}/bin/${app.meta.mainProgram}";
 | 
				
			||||||
  flakePackageOverlay' = flake: pkg: system: (final: prev:
 | 
					  flakePackageOverlay' = flake: pkg: system: (final: prev:
 | 
				
			||||||
    let
 | 
					    let
 | 
				
			||||||
      pkg' = if pkg != null then flake.packages.${system}.${pkg} else flake.defaultPackage.${system};
 | 
					      pkg' = if pkg != null then flake.packages.${system}.${pkg} else flake.packages.${system}.default;
 | 
				
			||||||
      name = if pkg != null then pkg else pkg'.name;
 | 
					      name = if pkg != null then pkg else pkg'.name;
 | 
				
			||||||
    in
 | 
					    in
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
@@ -248,8 +248,8 @@ rec {
 | 
				
			|||||||
  in
 | 
					  in
 | 
				
			||||||
  {
 | 
					  {
 | 
				
			||||||
    trivial = prev.trivial // {
 | 
					    trivial = prev.trivial // {
 | 
				
			||||||
      release = "24.12:u-${prev.trivial.release}";
 | 
					      release = "25.03:u-${prev.trivial.release}";
 | 
				
			||||||
      codeName = "Epic";
 | 
					      codeName = "Frick";
 | 
				
			||||||
      revisionWithDefault = default: self.rev or default;
 | 
					      revisionWithDefault = default: self.rev or default;
 | 
				
			||||||
      versionSuffix = ".${date}.${revCode self}:u-${revCode pkgsFlake}";
 | 
					      versionSuffix = ".${date}.${revCode self}:u-${revCode pkgsFlake}";
 | 
				
			||||||
    };
 | 
					    };
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -11,23 +11,24 @@ in
 | 
				
			|||||||
  config = {
 | 
					  config = {
 | 
				
			||||||
    my = {
 | 
					    my = {
 | 
				
			||||||
      secrets.files."britway/bgp-password-vultr.conf" = {
 | 
					      secrets.files."britway/bgp-password-vultr.conf" = {
 | 
				
			||||||
        owner = "bird2";
 | 
					        owner = "bird";
 | 
				
			||||||
        group = "bird2";
 | 
					        group = "bird";
 | 
				
			||||||
      };
 | 
					      };
 | 
				
			||||||
    };
 | 
					    };
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    environment.etc."bird/vultr-password.conf".source = config.age.secrets."britway/bgp-password-vultr.conf".path;
 | 
					    environment.etc."bird/vultr-password.conf".source = config.age.secrets."britway/bgp-password-vultr.conf".path;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    systemd = {
 | 
					    systemd = {
 | 
				
			||||||
      services.bird2.after = [ "systemd-networkd-wait-online@veth0.service" ];
 | 
					      services.bird.after = [ "systemd-networkd-wait-online@veth0.service" ];
 | 
				
			||||||
      network = {
 | 
					      network = {
 | 
				
			||||||
        config.networkConfig.ManageForeignRoutes = false;
 | 
					        config.networkConfig.ManageForeignRoutes = false;
 | 
				
			||||||
      };
 | 
					      };
 | 
				
			||||||
    };
 | 
					    };
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    services = {
 | 
					    services = {
 | 
				
			||||||
      bird2 = {
 | 
					      bird = {
 | 
				
			||||||
        enable = true;
 | 
					        enable = true;
 | 
				
			||||||
 | 
					        package = pkgs.bird2;
 | 
				
			||||||
        preCheckConfig = ''
 | 
					        preCheckConfig = ''
 | 
				
			||||||
          echo '"dummy"' > vultr-password.conf
 | 
					          echo '"dummy"' > vultr-password.conf
 | 
				
			||||||
        '';
 | 
					        '';
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -8,8 +8,9 @@ in
 | 
				
			|||||||
{
 | 
					{
 | 
				
			||||||
  config = {
 | 
					  config = {
 | 
				
			||||||
    services = {
 | 
					    services = {
 | 
				
			||||||
      bird2 = {
 | 
					      bird = {
 | 
				
			||||||
        enable = true;
 | 
					        enable = true;
 | 
				
			||||||
 | 
					        package = pkgs.bird2;
 | 
				
			||||||
        # TODO: Clean up and modularise
 | 
					        # TODO: Clean up and modularise
 | 
				
			||||||
        config = ''
 | 
					        config = ''
 | 
				
			||||||
          define OWNAS = 211024;
 | 
					          define OWNAS = 211024;
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -141,7 +141,7 @@ in
 | 
				
			|||||||
          containers.instances =
 | 
					          containers.instances =
 | 
				
			||||||
          let
 | 
					          let
 | 
				
			||||||
            instances = {
 | 
					            instances = {
 | 
				
			||||||
              unifi = {};
 | 
					              # unifi = {};
 | 
				
			||||||
            };
 | 
					            };
 | 
				
			||||||
          in
 | 
					          in
 | 
				
			||||||
          mkMerge [
 | 
					          mkMerge [
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -2,7 +2,7 @@
 | 
				
			|||||||
import argparse
 | 
					import argparse
 | 
				
			||||||
import subprocess
 | 
					import subprocess
 | 
				
			||||||
 | 
					
 | 
				
			||||||
import CloudFlare
 | 
					import cloudflare
 | 
				
			||||||
 | 
					
 | 
				
			||||||
def main():
 | 
					def main():
 | 
				
			||||||
    parser = argparse.ArgumentParser(description='Cloudflare DNS update script')
 | 
					    parser = argparse.ArgumentParser(description='Cloudflare DNS update script')
 | 
				
			||||||
@@ -19,17 +19,22 @@ def main():
 | 
				
			|||||||
    if args.api_token_file:
 | 
					    if args.api_token_file:
 | 
				
			||||||
        with open(args.api_token_file) as f:
 | 
					        with open(args.api_token_file) as f:
 | 
				
			||||||
            cf_token = f.readline().strip()
 | 
					            cf_token = f.readline().strip()
 | 
				
			||||||
 | 
					    cf = cloudflare.Cloudflare(api_token=cf_token)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    cf = CloudFlare.CloudFlare(token=cf_token)
 | 
					    zones = list(cf.zones.list(name=args.zone))
 | 
				
			||||||
    zones = cf.zones.get(params={'name': args.zone})
 | 
					 | 
				
			||||||
    assert zones, f'Zone {args.zone} not found'
 | 
					    assert zones, f'Zone {args.zone} not found'
 | 
				
			||||||
    records = cf.zones.dns_records.get(zones[0]['id'], params={'name': args.record})
 | 
					    assert len(zones) == 1, f'More than one zone found for {args.zone}'
 | 
				
			||||||
 | 
					    zone = zones[0]
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    records = list(cf.dns.records.list(zone_id=zone.id, name=args.record, type='A'))
 | 
				
			||||||
    assert records, f'Record {args.record} not found in zone {args.zone}'
 | 
					    assert records, f'Record {args.record} not found in zone {args.zone}'
 | 
				
			||||||
 | 
					    assert len(records) == 1, f'More than one record found for {args.record}'
 | 
				
			||||||
 | 
					    record = records[0]
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    print(f'Updating {args.record} -> {address}')
 | 
					    print(f'Updating {args.record} -> {address}')
 | 
				
			||||||
    cf.zones.dns_records.patch(
 | 
					    cf.dns.records.edit(
 | 
				
			||||||
        zones[0]['id'], records[0]['id'],
 | 
					        zone_id=zone.id, dns_record_id=record.id,
 | 
				
			||||||
        data={'type': 'A', 'name': args.record, 'content': address})
 | 
					        type='A', content=address)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
if __name__ == '__main__':
 | 
					if __name__ == '__main__':
 | 
				
			||||||
    main()
 | 
					    main()
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -98,6 +98,7 @@ in
 | 
				
			|||||||
            https = true;
 | 
					            https = true;
 | 
				
			||||||
            config = {
 | 
					            config = {
 | 
				
			||||||
              adminpassFile = config.age.secrets."kelder/nextcloud-root.txt".path;
 | 
					              adminpassFile = config.age.secrets."kelder/nextcloud-root.txt".path;
 | 
				
			||||||
 | 
					              dbtype = "sqlite";
 | 
				
			||||||
            };
 | 
					            };
 | 
				
			||||||
            settings = {
 | 
					            settings = {
 | 
				
			||||||
              updatechecker = false;
 | 
					              updatechecker = false;
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -23,7 +23,7 @@ let
 | 
				
			|||||||
      pkgs = pkgs'.${config'.nixpkgs}.${config'.system};
 | 
					      pkgs = pkgs'.${config'.nixpkgs}.${config'.system};
 | 
				
			||||||
      allPkgs = mapAttrs (_: p: p.${config'.system}) pkgs';
 | 
					      allPkgs = mapAttrs (_: p: p.${config'.system}) pkgs';
 | 
				
			||||||
 | 
					
 | 
				
			||||||
      modules' = [ hmFlakes.${config'.home-manager}.nixosModule ] ++ (attrValues cfg.modules);
 | 
					      modules' = [ hmFlakes.${config'.home-manager}.nixosModules.default ] ++ (attrValues cfg.modules);
 | 
				
			||||||
    in
 | 
					    in
 | 
				
			||||||
    # Import eval-config ourselves since the flake now force-sets lib
 | 
					    # Import eval-config ourselves since the flake now force-sets lib
 | 
				
			||||||
    import "${pkgsFlake}/nixos/lib/eval-config.nix" {
 | 
					    import "${pkgsFlake}/nixos/lib/eval-config.nix" {
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -5,6 +5,7 @@ let
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
  cfg = config.my.netboot;
 | 
					  cfg = config.my.netboot;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  # Newer releases don't boot on desktop?
 | 
				
			||||||
  ipxe = pkgs.ipxe.overrideAttrs (o: rec {
 | 
					  ipxe = pkgs.ipxe.overrideAttrs (o: rec {
 | 
				
			||||||
    version = "1.21.1-unstable-2024-06-27";
 | 
					    version = "1.21.1-unstable-2024-06-27";
 | 
				
			||||||
    src = pkgs.fetchFromGitHub {
 | 
					    src = pkgs.fetchFromGitHub {
 | 
				
			||||||
@@ -13,6 +14,9 @@ let
 | 
				
			|||||||
      rev = "b66e27d9b29a172a097c737ab4d378d60fe01b05";
 | 
					      rev = "b66e27d9b29a172a097c737ab4d378d60fe01b05";
 | 
				
			||||||
      hash = "sha256-TKZ4WjNV2oZIYNefch7E7m1JpeoC/d7O1kofoNv8G40=";
 | 
					      hash = "sha256-TKZ4WjNV2oZIYNefch7E7m1JpeoC/d7O1kofoNv8G40=";
 | 
				
			||||||
    };
 | 
					    };
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    # Newer GCC requires this upstream patch
 | 
				
			||||||
 | 
					    patches = (if (o ? patches) then o.patches else [ ]) ++ [ ./fix-uninitialised-var.patch ];
 | 
				
			||||||
  });
 | 
					  });
 | 
				
			||||||
  tftpRoot = pkgs.linkFarm "tftp-root" [
 | 
					  tftpRoot = pkgs.linkFarm "tftp-root" [
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										48
									
								
								nixos/modules/netboot/fix-uninitialised-var.patch
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										48
									
								
								nixos/modules/netboot/fix-uninitialised-var.patch
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,48 @@
 | 
				
			|||||||
 | 
					From 7f75d320f6d8ac7ec5185b2145da87f698aec273 Mon Sep 17 00:00:00 2001
 | 
				
			||||||
 | 
					From: Michael Brown <mcb30@ipxe.org>
 | 
				
			||||||
 | 
					Date: Mon, 2 Sep 2024 12:24:57 +0100
 | 
				
			||||||
 | 
					Subject: [PATCH] [etherfabric] Fix use of uninitialised variable in
 | 
				
			||||||
 | 
					 falcon_xaui_link_ok()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					The link status check in falcon_xaui_link_ok() reads from the
 | 
				
			||||||
 | 
					FCN_XX_CORE_STAT_REG_MAC register only on production hardware (where
 | 
				
			||||||
 | 
					the FPGA version reads as zero), but modifies the value and writes
 | 
				
			||||||
 | 
					back to this register unconditionally.  This triggers an uninitialised
 | 
				
			||||||
 | 
					variable warning on newer versions of gcc.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					Fix by assuming that the register exists only on production hardware,
 | 
				
			||||||
 | 
					and so moving the "modify-write" portion of the "read-modify-write"
 | 
				
			||||||
 | 
					operation to also be covered by the same conditional check.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					Signed-off-by: Michael Brown <mcb30@ipxe.org>
 | 
				
			||||||
 | 
					---
 | 
				
			||||||
 | 
					 src/drivers/net/etherfabric.c | 15 +++++++++------
 | 
				
			||||||
 | 
					 1 file changed, 9 insertions(+), 6 deletions(-)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					diff --git a/src/drivers/net/etherfabric.c b/src/drivers/net/etherfabric.c
 | 
				
			||||||
 | 
					index b40596beae7..be30b71f79f 100644
 | 
				
			||||||
 | 
					--- a/src/drivers/net/etherfabric.c
 | 
				
			||||||
 | 
					+++ b/src/drivers/net/etherfabric.c
 | 
				
			||||||
 | 
					@@ -2225,13 +2225,16 @@ falcon_xaui_link_ok ( struct efab_nic *efab )
 | 
				
			||||||
 | 
					 		sync = ( sync == FCN_XX_SYNC_STAT_DECODE_SYNCED );
 | 
				
			||||||
 | 
					 		
 | 
				
			||||||
 | 
					 		link_ok = align_done && sync;
 | 
				
			||||||
 | 
					-	}
 | 
				
			||||||
 | 
					 
 | 
				
			||||||
 | 
					-	/* Clear link status ready for next read */
 | 
				
			||||||
 | 
					-	EFAB_SET_DWORD_FIELD ( reg, FCN_XX_COMMA_DET, FCN_XX_COMMA_DET_RESET );
 | 
				
			||||||
 | 
					-	EFAB_SET_DWORD_FIELD ( reg, FCN_XX_CHARERR, FCN_XX_CHARERR_RESET);
 | 
				
			||||||
 | 
					-	EFAB_SET_DWORD_FIELD ( reg, FCN_XX_DISPERR, FCN_XX_DISPERR_RESET);
 | 
				
			||||||
 | 
					-	falcon_xmac_writel ( efab, ®, FCN_XX_CORE_STAT_REG_MAC );
 | 
				
			||||||
 | 
					+		/* Clear link status ready for next read */
 | 
				
			||||||
 | 
					+		EFAB_SET_DWORD_FIELD ( reg, FCN_XX_COMMA_DET,
 | 
				
			||||||
 | 
					+				       FCN_XX_COMMA_DET_RESET );
 | 
				
			||||||
 | 
					+		EFAB_SET_DWORD_FIELD ( reg, FCN_XX_CHARERR,
 | 
				
			||||||
 | 
					+				       FCN_XX_CHARERR_RESET );
 | 
				
			||||||
 | 
					+		EFAB_SET_DWORD_FIELD ( reg, FCN_XX_DISPERR,
 | 
				
			||||||
 | 
					+				       FCN_XX_DISPERR_RESET );
 | 
				
			||||||
 | 
					+		falcon_xmac_writel ( efab, ®, FCN_XX_CORE_STAT_REG_MAC );
 | 
				
			||||||
 | 
					+	}
 | 
				
			||||||
 | 
					 
 | 
				
			||||||
 | 
					 	has_phyxs = ( efab->phy_op->mmds & ( 1 << MDIO_MMD_PHYXS ) );
 | 
				
			||||||
 | 
					 	if ( link_ok && has_phyxs ) {
 | 
				
			||||||
@@ -1,6 +1,6 @@
 | 
				
			|||||||
{ lib, pkgs, config, ... }:
 | 
					{ lib, pkgs, config, ... }:
 | 
				
			||||||
let
 | 
					let
 | 
				
			||||||
  inherit (lib) flatten optional mkIf mkDefault mkMerge;
 | 
					  inherit (lib) flatten optional mkIf mkDefault mkMerge versionAtLeast;
 | 
				
			||||||
in
 | 
					in
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
  config = mkMerge [
 | 
					  config = mkMerge [
 | 
				
			||||||
@@ -13,9 +13,11 @@ in
 | 
				
			|||||||
      };
 | 
					      };
 | 
				
			||||||
 | 
					
 | 
				
			||||||
      systemd = {
 | 
					      systemd = {
 | 
				
			||||||
        additionalUpstreamSystemUnits = [
 | 
					        additionalUpstreamSystemUnits = mkIf (config.system.nixos.release == "24.12:u-24.11") [
 | 
				
			||||||
          # TODO: NixOS has its own version of this, but with `network` instead of `networkd`. Is this just a typo? It
 | 
					          # TODO: NixOS has its own version of this, but with `network` instead of `networkd`. Is this just a typo? It
 | 
				
			||||||
          # hasn't been updated in 2 years...
 | 
					          # hasn't been updated in 2 years...
 | 
				
			||||||
 | 
					          # This has been done upstream now :)
 | 
				
			||||||
 | 
					          # TODO: Remove when 25.05 releases
 | 
				
			||||||
          "systemd-networkd-wait-online@.service"
 | 
					          "systemd-networkd-wait-online@.service"
 | 
				
			||||||
        ];
 | 
					        ];
 | 
				
			||||||
      };
 | 
					      };
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -551,7 +551,7 @@ in
 | 
				
			|||||||
          ];
 | 
					          ];
 | 
				
			||||||
        });
 | 
					        });
 | 
				
			||||||
      })
 | 
					      })
 | 
				
			||||||
      (mkIf config.services.pds.enable {
 | 
					      (mkIf (config.services ? "pds" && config.services.pds.enable) {
 | 
				
			||||||
        my.tmproot.persistence.config.directories = [
 | 
					        my.tmproot.persistence.config.directories = [
 | 
				
			||||||
          {
 | 
					          {
 | 
				
			||||||
            directory = "/var/lib/pds";
 | 
					            directory = "/var/lib/pds";
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user