Compare commits

..

No commits in common. "main" and "ustetind-gitea-runners" have entirely different histories.

5 changed files with 23 additions and 58 deletions

View File

@ -33,13 +33,13 @@
outputs = { self, nixpkgs, nixpkgs-unstable, sops-nix, disko, ... }@inputs: outputs = { self, nixpkgs, nixpkgs-unstable, sops-nix, disko, ... }@inputs:
let let
inherit (nixpkgs) lib; nixlib = nixpkgs.lib;
systems = [ systems = [
"x86_64-linux" "x86_64-linux"
"aarch64-linux" "aarch64-linux"
"aarch64-darwin" "aarch64-darwin"
]; ];
forAllSystems = f: lib.genAttrs systems f; forAllSystems = f: nixlib.genAttrs systems f;
allMachines = builtins.attrNames self.nixosConfigurations; allMachines = builtins.attrNames self.nixosConfigurations;
importantMachines = [ importantMachines = [
"bekkalokk" "bekkalokk"
@ -49,11 +49,11 @@
"ildkule" "ildkule"
]; ];
in { in {
inputs = lib.mapAttrs (_: src: src.outPath) inputs; inputs = nixlib.mapAttrs (_: src: src.outPath) inputs;
nixosConfigurations = let nixosConfigurations = let
unstablePkgs = nixpkgs-unstable.legacyPackages.x86_64-linux; unstablePkgs = nixpkgs-unstable.legacyPackages.x86_64-linux;
nixosConfig = nixpkgs: name: config: lib.nixosSystem (lib.recursiveUpdate nixosConfig = nixpkgs: name: config: nixpkgs.lib.nixosSystem (nixpkgs.lib.recursiveUpdate
rec { rec {
system = "x86_64-linux"; system = "x86_64-linux";
specialArgs = { specialArgs = {
@ -156,19 +156,19 @@
in rec { in rec {
default = important-machines; default = important-machines;
important-machines = pkgs.linkFarm "important-machines" important-machines = pkgs.linkFarm "important-machines"
(lib.getAttrs importantMachines self.packages.x86_64-linux); (nixlib.getAttrs importantMachines self.packages.x86_64-linux);
all-machines = pkgs.linkFarm "all-machines" all-machines = pkgs.linkFarm "all-machines"
(lib.getAttrs allMachines self.packages.x86_64-linux); (nixlib.getAttrs allMachines self.packages.x86_64-linux);
simplesamlphp = pkgs.callPackage ./packages/simplesamlphp { }; simplesamlphp = pkgs.callPackage ./packages/simplesamlphp { };
} // } //
(lib.pipe null [ (nixlib.pipe null [
(_: pkgs.callPackage ./packages/mediawiki-extensions { }) (_: pkgs.callPackage ./packages/mediawiki-extensions { })
(lib.flip builtins.removeAttrs ["override" "overrideDerivation"]) (nixlib.flip builtins.removeAttrs ["override" "overrideDerivation"])
(lib.mapAttrs' (name: lib.nameValuePair "mediawiki-${name}")) (nixlib.mapAttrs' (name: nixlib.nameValuePair "mediawiki-${name}"))
]) ])
// lib.genAttrs allMachines // nixlib.genAttrs allMachines
(machine: self.nixosConfigurations.${machine}.config.system.build.toplevel); (machine: self.nixosConfigurations.${machine}.config.system.build.toplevel);
}; };
}; };

View File

@ -27,7 +27,6 @@ in
users.users."gitea-web" = { users.users."gitea-web" = {
group = "gitea-web"; group = "gitea-web";
isSystemUser = true; isSystemUser = true;
shell = pkgs.bash;
}; };
sops.secrets."gitea/web-secret-provider/token" = { sops.secrets."gitea/web-secret-provider/token" = {
@ -59,7 +58,6 @@ in
key-dir = "/var/lib/gitea-web/keys/%i"; key-dir = "/var/lib/gitea-web/keys/%i";
authorized-keys-path = "/var/lib/gitea-web/authorized_keys.d/%i"; authorized-keys-path = "/var/lib/gitea-web/authorized_keys.d/%i";
rrsync-script = pkgs.writeShellScript "rrsync-chown" '' rrsync-script = pkgs.writeShellScript "rrsync-chown" ''
mkdir -p "$1"
${lib.getExe pkgs.rrsync} -wo "$1" ${lib.getExe pkgs.rrsync} -wo "$1"
${pkgs.coreutils}/bin/chown -R gitea-web:gitea-web "$1" ${pkgs.coreutils}/bin/chown -R gitea-web:gitea-web "$1"
''; '';

View File

@ -34,21 +34,7 @@ def get_org_repo_list(args: argparse.Namespace, token: str):
f"{args.api_url}/orgs/{args.org}/repos", f"{args.api_url}/orgs/{args.org}/repos",
headers = { 'Authorization': 'token ' + token }, headers = { 'Authorization': 'token ' + token },
) )
return [repo["name"] for repo in result.json()]
results = [repo["name"] for repo in result.json()]
target = int(result.headers['X-Total-Count'])
i = 2
while len(results) < target:
result = requests.get(
f"{args.api_url}/orgs/{args.org}/repos",
params = { 'page': i },
headers = { 'Authorization': 'token ' + token },
)
results += [repo["name"] for repo in result.json()]
i += 1
return results
def generate_ssh_key(args: argparse.Namespace, repository: str): def generate_ssh_key(args: argparse.Namespace, repository: str):

View File

@ -16,9 +16,11 @@
networking.hostName = "ustetind"; networking.hostName = "ustetind";
networking.useHostResolvConf = lib.mkForce false; networking.useHostResolvConf = lib.mkForce false;
# systemd.network.enable = lib.mkForce false;
# networking.useDHCP = lib.mkForce true;
# networking.address = with values.hosts.georg; [ (ipv4 + "/25") (ipv6 + "/64") ];
systemd.network.networks = { systemd.network.networks."30-lxc-veth" = values.defaultNetworkConfig // {
"30-lxc-eth" = values.defaultNetworkConfig // {
matchConfig = { matchConfig = {
Type = "ether"; Type = "ether";
Kind = "veth"; Kind = "veth";
@ -28,17 +30,6 @@
}; };
address = with values.hosts.ustetind; [ (ipv4 + "/25") (ipv6 + "/64") ]; address = with values.hosts.ustetind; [ (ipv4 + "/25") (ipv6 + "/64") ];
}; };
"40-podman-veth" = values.defaultNetworkConfig // {
matchConfig = {
Type = "ether";
Kind = "veth";
Name = [
"veth*"
];
};
DHCP = "yes";
};
};
system.stateVersion = "24.11"; system.stateVersion = "24.11";
} }

View File

@ -27,15 +27,5 @@ lib.mkMerge [
(mkRunner "alpha") (mkRunner "alpha")
(mkRunner "beta") (mkRunner "beta")
(mkRunner "epsilon") (mkRunner "epsilon")
{ { virtualisation.podman.enable = true; }
virtualisation.podman = {
enable = true;
defaultNetwork.settings.dns_enabled = true;
autoPrune.enable = true;
};
networking.dhcpcd.IPv6rs = false;
networking.firewall.interfaces."podman+".allowedUDPPorts = [53 5353];
}
] ]