diff --git a/factorio-mods/snek/valerian-planets_1.0.2.zip b/factorio-mods/snek/valerian-planets_1.0.2.zip new file mode 100644 index 0000000..5d77424 Binary files /dev/null and b/factorio-mods/snek/valerian-planets_1.0.2.zip differ diff --git a/fili/services/factorio.nix b/fili/services/factorio.nix index f25a4b3..4fa19d1 100644 --- a/fili/services/factorio.nix +++ b/fili/services/factorio.nix @@ -1,30 +1,43 @@ -{lib, pkgs, config, ...}: let - factorioVersion = version: sha: pkgs.factorio-headless.overrideAttrs (_: { - inherit version; - src = pkgs.fetchurl { - url = "https://factorio.com/get-download/${version}/headless/linux64"; - name = "factorio-headless-${version}.tar.xz"; - sha256 = sha; - }; - }); - getMods = modDir: let - modList = lib.pipe modDir [ - builtins.readDir - (lib.filterAttrs (k: v: v == "regular")) - (lib.mapAttrsToList (k: v: k)) - (builtins.filter (lib.hasSuffix ".zip")) - ]; - validPath = modFileName: - builtins.path { - path = modDir + "/${modFileName}"; - name = lib.strings.sanitizeDerivationName modFileName; +{ lib +, pkgs +, config +, ... +}: +let + factorioVersion = + version: sha: + pkgs.factorio-headless.overrideAttrs (_: { + inherit version; + src = pkgs.fetchurl { + url = "https://factorio.com/get-download/${version}/headless/linux64"; + name = "factorio-headless-${version}.tar.xz"; + sha256 = sha; }; - modToDrv = modFileName: - pkgs.runCommand "copy-factorio-mods" {} '' - mkdir $out - ln -s '${validPath modFileName}' $out/'${modFileName}' - '' - // { deps = []; }; + }); + getMods = + modDir: + let + modList = lib.pipe modDir [ + builtins.readDir + (lib.filterAttrs (k: v: v == "regular")) + (lib.mapAttrsToList (k: v: k)) + (builtins.filter (lib.hasSuffix ".zip")) + ]; + validPath = + modFileName: + builtins.path { + path = modDir + "/${modFileName}"; + name = lib.strings.sanitizeDerivationName modFileName; + }; + modToDrv = + modFileName: + pkgs.runCommand "copy-factorio-mods" { } '' + mkdir $out + ln -s '${validPath modFileName}' $out/'${modFileName}' + '' + // { + deps = [ ]; + }; in builtins.map modToDrv modList; factorioContainer = name: factorio-config: { @@ -46,27 +59,33 @@ }; privateUsers = "no"; - config = { config, pkgs, lib, ... }: { - systemd.services.factorio.serviceConfig.User = "factorio"; - services.factorio = factorio-config // { - enable = true; - openFirewall = true; + config = + { config + , pkgs + , lib + , ... + }: + { + systemd.services.factorio.serviceConfig.User = "factorio"; + services.factorio = factorio-config // { + enable = true; + openFirewall = true; - game-name = name; - saveName = name; - stateDirName = "factorio"; + game-name = name; + saveName = name; + stateDirName = "factorio"; + }; + + nixpkgs.config = { + allowUnfree = true; + }; + + system.stateVersion = "23.11"; + + networking = { + firewall.enable = false; + }; }; - - nixpkgs.config = { - allowUnfree = true; - }; - - system.stateVersion = "23.11"; - - networking = { - firewall.enable = false; - }; - }; }; }; in @@ -85,20 +104,31 @@ in owner = "factorio"; }; - containers = factorioContainer "tawney" { - autosave-interval = 20; - admins = [ "jonay2000" "computerdruid" "pineapple" ]; - extraSettingsFile = config.sops.secrets.factorio.path; - # mods = getMods ../../factorio-mods/tawney; - package = factorioVersion "2.0.66" "sha256-8bOXbqzE4jOADTmdkABsNW+jZvXWQ0HFBMlcDLoyHAY="; - port = 20001; - } - // factorioContainer "snek" { - autosave-interval = 20; - admins = [ "jonay2000" "computerdruid" "pineapple" ]; - extraSettingsFile = config.sops.secrets.factorio.path; - mods = getMods ../../factorio-mods/snek; - package = factorioVersion "2.0.66" "sha256-8bOXbqzE4jOADTmdkABsNW+jZvXWQ0HFBMlcDLoyHAY="; - port = 20002; - }; + containers = + factorioContainer "tawney" + { + autosave-interval = 20; + admins = [ + "jonay2000" + "computerdruid" + "pineapple" + ]; + extraSettingsFile = config.sops.secrets.factorio.path; + # mods = getMods ../../factorio-mods/tawney; + package = factorioVersion "2.0.69" "sha256-I1FHuz7WtfCmmTiTxskv3+U1upWrhmBG9R+GUoS1c0E="; + port = 20001; + } + // factorioContainer "snek" { + autosave-interval = 20; + admins = [ + "jonay2000" + "computerdruid" + "pineapple" + "koragendum" + ]; + extraSettingsFile = config.sops.secrets.factorio.path; + mods = getMods ../../factorio-mods/snek; + package = factorioVersion "2.0.69" "sha256-I1FHuz7WtfCmmTiTxskv3+U1upWrhmBG9R+GUoS1c0E="; + port = 20002; + }; } diff --git a/fili/services/forgejo.nix b/fili/services/forgejo.nix index 01920c8..5293333 100644 --- a/fili/services/forgejo.nix +++ b/fili/services/forgejo.nix @@ -68,6 +68,15 @@ in SHOW_REGISTRATION_BUTTON = false; ENABLE_PASSWORD_SIGNIN_FORM = false; }; + openid = { + ENABLE_OPENID_SIGNUP = true; + }; + oauth2_client = { + REGISTER_EMAIL_CONFIRM = false; + ENABLE_AUTO_REGISTRATION = true; + UPDATE_AVATAR = true; + ACCOUNT_LINKING = "auto"; + }; actions = { ENABLED = true; DEFAULT_ACTIONS_URL = "github"; @@ -150,5 +159,4 @@ in }; }; networking.firewall.trustedInterfaces = [ "br-+" ]; - } diff --git a/fili/services/websites/compiler-construction-2021.nix b/fili/services/websites/compiler-construction-2021.nix new file mode 100644 index 0000000..f7901db --- /dev/null +++ b/fili/services/websites/compiler-construction-2021.nix @@ -0,0 +1,14 @@ +{ pkgs, flakes, ... }: +{ + services.nginx = { + virtualHosts."compiler-construction-2021.donsz.nl" = { + forceSSL = true; + http2 = true; + enableACME = true; + + locations."/" = { + root = flakes.compiler-construction-2021.packages.${pkgs.system}.website; + }; + }; + }; +} diff --git a/fili/services/websites/default.nix b/fili/services/websites/default.nix index 4cf107d..fb1cdf5 100644 --- a/fili/services/websites/default.nix +++ b/fili/services/websites/default.nix @@ -5,5 +5,7 @@ _: { ./totpal.nix ./harmonica-tabs.nix ./mapf.nix + ./compiler-construction-2021.nix + ./mapfm-poster.nix ]; } diff --git a/fili/services/websites/mapfm-poster.nix b/fili/services/websites/mapfm-poster.nix new file mode 100644 index 0000000..5c026f4 --- /dev/null +++ b/fili/services/websites/mapfm-poster.nix @@ -0,0 +1,26 @@ +{ pkgs, ... }: +{ + services.nginx.virtualHosts."mapfm-poster.donsz.nl" = { + forceSSL = true; + http2 = true; + enableACME = true; + + locations."/" = { + root = pkgs.stdenv.mkDerivation rec { + pname = "research-project-poster"; + version = "2021-06-27"; + src = pkgs.fetchFromGitHub { + owner = "jdonszelmann"; + repo = "research-project"; + rev = "f1c0c5d839197f825b555780271781281ba10ac3"; + sha256 = "sha256-YJxcLRABU3yRS/U/XNLpTIXtve0cFfnwPKr+1oY0HeY="; + }; + + installPhase = '' + mkdir -p $out + cp -r assets/final_poster/* $out + ''; + }; + }; + }; +} diff --git a/flake.lock b/flake.lock index 7245d06..142f716 100644 --- a/flake.lock +++ b/flake.lock @@ -22,6 +22,25 @@ "type": "github" } }, + "compiler-construction-2021": { + "inputs": { + "flake-utils": "flake-utils_2", + "nixpkgs": "nixpkgs_2" + }, + "locked": { + "lastModified": 1759157554, + "narHash": "sha256-BLdqS+zBfG+QHEuRV3iJHaBkizlohD+hgvz8KvpDPOA=", + "ref": "refs/heads/main", + "rev": "9d739f22726a4f3078369ade0c3646fbf058ce01", + "revCount": 4, + "type": "git", + "url": "ssh://forgejo@git.donsz.nl/jana/eelco-visser-compiler-construction.git" + }, + "original": { + "type": "git", + "url": "ssh://forgejo@git.donsz.nl/jana/eelco-visser-compiler-construction.git" + } + }, "fenix": { "inputs": { "nixpkgs": [ @@ -99,11 +118,11 @@ "systems": "systems_2" }, "locked": { - "lastModified": 1710146030, - "narHash": "sha256-SZ5L6eA7HJ/nmkzGG7/ISclqe6oZdOZTNoesiInkXPQ=", + "lastModified": 1731533236, + "narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=", "owner": "numtide", "repo": "flake-utils", - "rev": "b1d9ab70662946ef0850d488da1c9019f3a9752a", + "rev": "11707dc2f618dd54ca8739b309ec4fc024de578b", "type": "github" }, "original": { @@ -134,6 +153,24 @@ "inputs": { "systems": "systems_4" }, + "locked": { + "lastModified": 1710146030, + "narHash": "sha256-SZ5L6eA7HJ/nmkzGG7/ISclqe6oZdOZTNoesiInkXPQ=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "b1d9ab70662946ef0850d488da1c9019f3a9752a", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "flake-utils_6": { + "inputs": { + "systems": "systems_5" + }, "locked": { "lastModified": 1731533236, "narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=", @@ -150,7 +187,7 @@ }, "harmonica": { "inputs": { - "nixpkgs": "nixpkgs_2" + "nixpkgs": "nixpkgs_3" }, "locked": { "lastModified": 1738890519, @@ -168,15 +205,15 @@ }, "homepage": { "inputs": { - "flake-utils": "flake-utils_3", - "nixpkgs": "nixpkgs_3" + "flake-utils": "flake-utils_4", + "nixpkgs": "nixpkgs_4" }, "locked": { - "lastModified": 1747823174, - "narHash": "sha256-8P6od55oOAaE0/QAaHn33ADFISTiE+QOt2s0AmaPAFQ=", + "lastModified": 1761038066, + "narHash": "sha256-YPSW9CZpcDdDpJ0SCOB5Y/oP/7Ijhm3AjN8PF6472YI=", "owner": "jdonszelmann", "repo": "homepage", - "rev": "39ef8624648f4e8803aa7510036ad48f5d4a459c", + "rev": "0e99242648d9ff015773b661cc2888baa4f6acb0", "type": "github" }, "original": { @@ -187,8 +224,8 @@ }, "mapf": { "inputs": { - "flake-utils": "flake-utils_4", - "nixpkgs": "nixpkgs_4" + "flake-utils": "flake-utils_5", + "nixpkgs": "nixpkgs_5" }, "locked": { "lastModified": 1757529600, @@ -207,7 +244,7 @@ "naersk": { "inputs": { "fenix": "fenix", - "nixpkgs": "nixpkgs_6" + "nixpkgs": "nixpkgs_7" }, "locked": { "lastModified": 1752689277, @@ -276,117 +313,7 @@ "type": "github" } }, - "nixpkgs_2": { - "locked": { - "lastModified": 1738680400, - "narHash": "sha256-ooLh+XW8jfa+91F1nhf9OF7qhuA/y1ChLx6lXDNeY5U=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "799ba5bffed04ced7067a91798353d360788b30d", - "type": "github" - }, - "original": { - "owner": "NixOS", - "ref": "nixos-unstable", - "repo": "nixpkgs", - "type": "github" - } - }, - "nixpkgs_3": { - "locked": { - "lastModified": 1716137900, - "narHash": "sha256-sowPU+tLQv8GlqtVtsXioTKeaQvlMz/pefcdwg8MvfM=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "6c0b7a92c30122196a761b440ac0d46d3d9954f1", - "type": "github" - }, - "original": { - "owner": "NixOS", - "ref": "nixos-unstable", - "repo": "nixpkgs", - "type": "github" - } - }, - "nixpkgs_4": { - "locked": { - "lastModified": 1721379653, - "narHash": "sha256-8MUgifkJ7lkZs3u99UDZMB4kbOxvMEXQZ31FO3SopZ0=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "1d9c2c9b3e71b9ee663d11c5d298727dace8d374", - "type": "github" - }, - "original": { - "owner": "NixOS", - "ref": "nixos-unstable", - "repo": "nixpkgs", - "type": "github" - } - }, - "nixpkgs_5": { - "locked": { - "lastModified": 1757345582, - "narHash": "sha256-HnJYHM9zCVV5Avil6/IPw1m1s2vLd+fmFN7VR/UkidA=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "49a25608bff9b2add8edcee8ff92dda38909e671", - "type": "github" - }, - "original": { - "owner": "NixOS", - "ref": "release-25.05", - "repo": "nixpkgs", - "type": "github" - } - }, - "nixpkgs_6": { - "locked": { - "lastModified": 1752077645, - "narHash": "sha256-HM791ZQtXV93xtCY+ZxG1REzhQenSQO020cu6rHtAPk=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "be9e214982e20b8310878ac2baa063a961c1bdf6", - "type": "github" - }, - "original": { - "owner": "NixOS", - "ref": "nixpkgs-unstable", - "repo": "nixpkgs", - "type": "github" - } - }, - "nixpkgs_7": { - "locked": { - "lastModified": 1755020227, - "narHash": "sha256-gGmm+h0t6rY88RPTaIm3su95QvQIVjAJx558YUG4Id8=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "695d5db1b8b20b73292501683a524e0bd79074fb", - "type": "github" - }, - "original": { - "id": "nixpkgs", - "type": "indirect" - } - }, - "nixpkgs_8": { - "locked": { - "lastModified": 1703499205, - "narHash": "sha256-lF9rK5mSUfIZJgZxC3ge40tp1gmyyOXZ+lRY3P8bfbg=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "e1fa12d4f6c6fe19ccb59cac54b5b3f25e160870", - "type": "github" - }, - "original": { - "owner": "NixOS", - "ref": "nixpkgs-unstable", - "repo": "nixpkgs", - "type": "github" - } - }, - "nixpkgs_9": { + "nixpkgs_10": { "locked": { "lastModified": 1732014248, "narHash": "sha256-y/MEyuJ5oBWrWAic/14LaIr/u5E0wRVzyYsouYY3W6w=", @@ -402,11 +329,137 @@ "type": "github" } }, + "nixpkgs_2": { + "locked": { + "lastModified": 1759036355, + "narHash": "sha256-0m27AKv6ka+q270dw48KflE0LwQYrO7Fm4/2//KCVWg=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "e9f00bd893984bc8ce46c895c3bf7cac95331127", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_3": { + "locked": { + "lastModified": 1738680400, + "narHash": "sha256-ooLh+XW8jfa+91F1nhf9OF7qhuA/y1ChLx6lXDNeY5U=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "799ba5bffed04ced7067a91798353d360788b30d", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_4": { + "locked": { + "lastModified": 1716137900, + "narHash": "sha256-sowPU+tLQv8GlqtVtsXioTKeaQvlMz/pefcdwg8MvfM=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "6c0b7a92c30122196a761b440ac0d46d3d9954f1", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_5": { + "locked": { + "lastModified": 1721379653, + "narHash": "sha256-8MUgifkJ7lkZs3u99UDZMB4kbOxvMEXQZ31FO3SopZ0=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "1d9c2c9b3e71b9ee663d11c5d298727dace8d374", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_6": { + "locked": { + "lastModified": 1757345582, + "narHash": "sha256-HnJYHM9zCVV5Avil6/IPw1m1s2vLd+fmFN7VR/UkidA=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "49a25608bff9b2add8edcee8ff92dda38909e671", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "release-25.05", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_7": { + "locked": { + "lastModified": 1752077645, + "narHash": "sha256-HM791ZQtXV93xtCY+ZxG1REzhQenSQO020cu6rHtAPk=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "be9e214982e20b8310878ac2baa063a961c1bdf6", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixpkgs-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_8": { + "locked": { + "lastModified": 1755020227, + "narHash": "sha256-gGmm+h0t6rY88RPTaIm3su95QvQIVjAJx558YUG4Id8=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "695d5db1b8b20b73292501683a524e0bd79074fb", + "type": "github" + }, + "original": { + "id": "nixpkgs", + "type": "indirect" + } + }, + "nixpkgs_9": { + "locked": { + "lastModified": 1703499205, + "narHash": "sha256-lF9rK5mSUfIZJgZxC3ge40tp1gmyyOXZ+lRY3P8bfbg=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "e1fa12d4f6c6fe19ccb59cac54b5b3f25e160870", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixpkgs-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, "reviewqueue": { "inputs": { - "flake-utils": "flake-utils_5", + "flake-utils": "flake-utils_6", "naersk": "naersk", - "nixpkgs": "nixpkgs_7", + "nixpkgs": "nixpkgs_8", "nixpkgs-mozilla": "nixpkgs-mozilla" }, "locked": { @@ -426,11 +479,12 @@ "root": { "inputs": { "colmena": "colmena", - "flake-utils": "flake-utils_2", + "compiler-construction-2021": "compiler-construction-2021", + "flake-utils": "flake-utils_3", "harmonica": "harmonica", "homepage": "homepage", "mapf": "mapf", - "nixpkgs": "nixpkgs_5", + "nixpkgs": "nixpkgs_6", "reviewqueue": "reviewqueue", "sops-nix": "sops-nix", "totpal": "totpal", @@ -456,7 +510,7 @@ }, "sops-nix": { "inputs": { - "nixpkgs": "nixpkgs_8" + "nixpkgs": "nixpkgs_9" }, "locked": { "lastModified": 1758425756, @@ -548,9 +602,24 @@ "type": "github" } }, + "systems_5": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + }, "totpal": { "inputs": { - "nixpkgs": "nixpkgs_9" + "nixpkgs": "nixpkgs_10" }, "locked": { "lastModified": 1737322813, diff --git a/flake.nix b/flake.nix index 1ce8b3d..49f9ef5 100644 --- a/flake.nix +++ b/flake.nix @@ -14,6 +14,7 @@ harmonica.url = "git+ssh://git@github.com/jdonszelmann/harmonica-tabs"; mapf.url = "git+ssh://git@github.com/jdonszelmann/mapf-server"; reviewqueue.url = "github:jdonszelmann/review-queue"; + compiler-construction-2021.url = "git+ssh://forgejo@git.donsz.nl/jana/eelco-visser-compiler-construction.git"; }; outputs = { self