Compare commits
	
		
			3 Commits
		
	
	
		
			9fa8299b71
			...
			e70b5b67d5
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| e70b5b67d5 | |||
| 22bf75d0a0 | |||
| 318972a086 | 
@@ -24,20 +24,27 @@ jobs:
 | 
				
			|||||||
            extra-substituters = https://nix-cache.nul.ie/main
 | 
					            extra-substituters = https://nix-cache.nul.ie/main
 | 
				
			||||||
            extra-trusted-public-keys = main:mMChkG8LwXrFirVfudqjSHasK1jV31OVElYD3eImYl8=
 | 
					            extra-trusted-public-keys = main:mMChkG8LwXrFirVfudqjSHasK1jV31OVElYD3eImYl8=
 | 
				
			||||||
      - name: Set up attic
 | 
					      - name: Set up attic
 | 
				
			||||||
 | 
					        id: setup
 | 
				
			||||||
        run: |
 | 
					        run: |
 | 
				
			||||||
          nix run .#nixpkgs.mine.x86_64-linux.attic-client -- \
 | 
					          nix run .#nixpkgs.mine.x86_64-linux.attic-client -- \
 | 
				
			||||||
            login --set-default colony https://nix-cache.nul.ie "${{ secrets.NIX_CACHE_TOKEN }}"
 | 
					            login --set-default colony https://nix-cache.nul.ie "${{ secrets.NIX_CACHE_TOKEN }}"
 | 
				
			||||||
 | 
					          echo "short_rev=$(git rev-parse --short HEAD)" >> "$GITHUB_OUTPUT"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
      - name: Build installer ISO
 | 
					      - name: Build installer ISO
 | 
				
			||||||
        id: build
 | 
					 | 
				
			||||||
        run: |
 | 
					        run: |
 | 
				
			||||||
          nix build .#nixosConfigurations.installer.config.my.buildAs.iso
 | 
					          nix build .#nixosConfigurations.installer.config.my.buildAs.iso
 | 
				
			||||||
          short_rev="$(git rev-parse --short HEAD)"
 | 
					          ln -s "$(readlink result)"/iso/nixos-installer-devplayer0.iso \
 | 
				
			||||||
          ln -s result/iso/nixos-installer-devplayer0.iso nixos-installer-devplayer0-$short_rev.iso
 | 
					            nixos-installer-devplayer0-${{ steps.setup.outputs.short_rev }}.iso
 | 
				
			||||||
          echo "short_rev=$short_rev" >> "$GITHUB_OUTPUT"
 | 
					      - name: Build installer netboot archive
 | 
				
			||||||
      - name: Create release for ISO
 | 
					        run:
 | 
				
			||||||
 | 
					          nix build .#nixosConfigurations.installer.config.my.buildAs.netbootArchive
 | 
				
			||||||
 | 
					          ln -s "$(readlink result)" \
 | 
				
			||||||
 | 
					            nixos-installer-devplayer0-netboot-${{ steps.setup.outputs.short_rev }}.tar
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					      - name: Create release
 | 
				
			||||||
        uses: https://gitea.com/actions/release-action@main
 | 
					        uses: https://gitea.com/actions/release-action@main
 | 
				
			||||||
        with:
 | 
					        with:
 | 
				
			||||||
          title: Latest installer
 | 
					          title: Latest installer
 | 
				
			||||||
          files: |
 | 
					          files: |
 | 
				
			||||||
            nixos-installer-devplayer0-${{ steps.build.outputs.short_rev }}.iso
 | 
					            nixos-installer-devplayer0-${{ steps.setup.outputs.short_rev }}.iso
 | 
				
			||||||
 | 
					            nixos-installer-devplayer0-netboot-${{ steps.setup.outputs.short_rev }}.tar
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -47,8 +47,8 @@ in
 | 
				
			|||||||
          (nodesFor homes)
 | 
					          (nodesFor homes)
 | 
				
			||||||
        );
 | 
					        );
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        autoRollback = true;
 | 
					        autoRollback = false;
 | 
				
			||||||
        magicRollback = true;
 | 
					        magicRollback = false;
 | 
				
			||||||
      };
 | 
					      };
 | 
				
			||||||
 | 
					
 | 
				
			||||||
      # Filter out null values so deploy merges overriding options correctly
 | 
					      # Filter out null values so deploy merges overriding options correctly
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -97,6 +97,18 @@ in
 | 
				
			|||||||
      help = "Build NixOS configuration into an ISO";
 | 
					      help = "Build NixOS configuration into an ISO";
 | 
				
			||||||
      command = ''nix build "''${@:2}" ".#nixfiles.config.nixos.systems.\"$1\".configuration.config.my.buildAs.iso"'';
 | 
					      command = ''nix build "''${@:2}" ".#nixfiles.config.nixos.systems.\"$1\".configuration.config.my.buildAs.iso"'';
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					    {
 | 
				
			||||||
 | 
					      name = "build-kexec";
 | 
				
			||||||
 | 
					      category = "tasks";
 | 
				
			||||||
 | 
					      help = "Build NixOS configuration as kexec tree";
 | 
				
			||||||
 | 
					      command = ''nix build "''${@:2}" ".#nixfiles.config.nixos.systems.\"$1\".configuration.config.my.buildAs.kexecTree"'';
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					    {
 | 
				
			||||||
 | 
					      name = "build-netboot";
 | 
				
			||||||
 | 
					      category = "tasks";
 | 
				
			||||||
 | 
					      help = "Build NixOS configuration as netboot archive";
 | 
				
			||||||
 | 
					      command = ''nix build "''${@:2}" ".#nixfiles.config.nixos.systems.\"$1\".configuration.config.my.buildAs.netbootArchive"'';
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
      name = "build-home";
 | 
					      name = "build-home";
 | 
				
			||||||
      category = "tasks";
 | 
					      category = "tasks";
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -24,7 +24,9 @@ in
 | 
				
			|||||||
    coreutils
 | 
					    coreutils
 | 
				
			||||||
    nixVersions.stable
 | 
					    nixVersions.stable
 | 
				
			||||||
    rage
 | 
					    rage
 | 
				
			||||||
    deploy-rs.deploy-rs
 | 
					    (pkgs.writeShellScriptBin "deploy" ''
 | 
				
			||||||
 | 
					      exec ${deploy-rs.deploy-rs}/bin/deploy --skip-checks "$@"
 | 
				
			||||||
 | 
					    '')
 | 
				
			||||||
    home-manager
 | 
					    home-manager
 | 
				
			||||||
    attic-client
 | 
					    attic-client
 | 
				
			||||||
  ];
 | 
					  ];
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -229,12 +229,6 @@ in
 | 
				
			|||||||
                    DHCP = "ipv4";
 | 
					                    DHCP = "ipv4";
 | 
				
			||||||
                    dns = [ "127.0.0.1" "::1" ];
 | 
					                    dns = [ "127.0.0.1" "::1" ];
 | 
				
			||||||
                    dhcpV4Config.UseDNS = false;
 | 
					                    dhcpV4Config.UseDNS = false;
 | 
				
			||||||
                    routes = map (r: { routeConfig = r; }) [
 | 
					 | 
				
			||||||
                      # {
 | 
					 | 
				
			||||||
                      #   Destination = prefixes.ctrs.v4;
 | 
					 | 
				
			||||||
                      #   Gateway = allAssignments.shill.routing.ipv4.address;
 | 
					 | 
				
			||||||
                      # }
 | 
					 | 
				
			||||||
                    ];
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
                    qdiscConfig = {
 | 
					                    qdiscConfig = {
 | 
				
			||||||
                      Parent = "ingress";
 | 
					                      Parent = "ingress";
 | 
				
			||||||
@@ -308,13 +302,6 @@ in
 | 
				
			|||||||
              nat = {
 | 
					              nat = {
 | 
				
			||||||
                enable = true;
 | 
					                enable = true;
 | 
				
			||||||
                externalInterface = "wan";
 | 
					                externalInterface = "wan";
 | 
				
			||||||
                # externalIP = assignments.internal.ipv4.address;
 | 
					 | 
				
			||||||
                forwardPorts = [
 | 
					 | 
				
			||||||
                  # {
 | 
					 | 
				
			||||||
                  #   port = "http";
 | 
					 | 
				
			||||||
                  #   dst = allAssignments.middleman.internal.ipv4.address;
 | 
					 | 
				
			||||||
                  # }
 | 
					 | 
				
			||||||
                ];
 | 
					 | 
				
			||||||
              };
 | 
					              };
 | 
				
			||||||
              extraRules = ''
 | 
					              extraRules = ''
 | 
				
			||||||
                table inet filter {
 | 
					                table inet filter {
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -76,7 +76,9 @@ in
 | 
				
			|||||||
              ];
 | 
					              ];
 | 
				
			||||||
              pools = [
 | 
					              pools = [
 | 
				
			||||||
                {
 | 
					                {
 | 
				
			||||||
                  pool = "192.168.68.120 - 192.168.71.240";
 | 
					                  pool = if index == 0
 | 
				
			||||||
 | 
					                    then "192.168.68.120 - 192.168.69.255"
 | 
				
			||||||
 | 
					                    else "192.168.70.0 - 192.168.71.240";
 | 
				
			||||||
                }
 | 
					                }
 | 
				
			||||||
              ];
 | 
					              ];
 | 
				
			||||||
              reservations = [
 | 
					              reservations = [
 | 
				
			||||||
@@ -103,7 +105,9 @@ in
 | 
				
			|||||||
              ];
 | 
					              ];
 | 
				
			||||||
              pools = [
 | 
					              pools = [
 | 
				
			||||||
                {
 | 
					                {
 | 
				
			||||||
                  pool = "192.168.72.120 - 192.168.79.240";
 | 
					                  pool = if index == 0
 | 
				
			||||||
 | 
					                    then "192.168.72.120 - 192.168.75.255"
 | 
				
			||||||
 | 
					                    else "192.168.76.0 - 192.168.79.240";
 | 
				
			||||||
                }
 | 
					                }
 | 
				
			||||||
              ];
 | 
					              ];
 | 
				
			||||||
              reservations = [
 | 
					              reservations = [
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -43,6 +43,16 @@ let
 | 
				
			|||||||
    modules = flatten [
 | 
					    modules = flatten [
 | 
				
			||||||
      "${modulesPath}/installer/netboot/netboot.nix"
 | 
					      "${modulesPath}/installer/netboot/netboot.nix"
 | 
				
			||||||
      allHardware
 | 
					      allHardware
 | 
				
			||||||
 | 
					      ({ pkgs, config, ... }: {
 | 
				
			||||||
 | 
					        system.build.netbootArchive = pkgs.runCommand "netboot-${config.system.name}-archive.tar" { } ''
 | 
				
			||||||
 | 
					          ${pkgs.gnutar}/bin/tar -rvC "${config.system.build.kernel}" \
 | 
				
			||||||
 | 
					            -f "$out" "${config.system.boot.loader.kernelFile}"
 | 
				
			||||||
 | 
					          ${pkgs.gnutar}/bin/tar -rvC "${config.system.build.netbootRamdisk}" \
 | 
				
			||||||
 | 
					            -f "$out" initrd
 | 
				
			||||||
 | 
					          ${pkgs.gnutar}/bin/tar -rvC "${config.system.build.netbootIpxeScript}" \
 | 
				
			||||||
 | 
					            -f "$out" netboot.ipxe
 | 
				
			||||||
 | 
					        '';
 | 
				
			||||||
 | 
					      })
 | 
				
			||||||
    ];
 | 
					    ];
 | 
				
			||||||
  };
 | 
					  };
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -99,6 +109,7 @@ in
 | 
				
			|||||||
        iso = config.my.asISO.config.system.build.isoImage;
 | 
					        iso = config.my.asISO.config.system.build.isoImage;
 | 
				
			||||||
        container = config.my.asContainer.config.system.build.toplevel;
 | 
					        container = config.my.asContainer.config.system.build.toplevel;
 | 
				
			||||||
        kexecTree = config.my.asKexecTree.config.system.build.kexecTree;
 | 
					        kexecTree = config.my.asKexecTree.config.system.build.kexecTree;
 | 
				
			||||||
 | 
					        netbootArchive = config.my.asKexecTree.config.system.build.netbootArchive;
 | 
				
			||||||
      };
 | 
					      };
 | 
				
			||||||
    };
 | 
					    };
 | 
				
			||||||
  };
 | 
					  };
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user