From dee80f1127caef8b4e32c6431680aea8c984155e Mon Sep 17 00:00:00 2001 From: revol-xut Date: Sat, 17 Dec 2022 17:46:09 +0100 Subject: [PATCH 1/8] addning nixpkgs fmt ci --- .github/workflows/fmt.yaml | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 .github/workflows/fmt.yaml diff --git a/.github/workflows/fmt.yaml b/.github/workflows/fmt.yaml new file mode 100644 index 0000000..1bffffa --- /dev/null +++ b/.github/workflows/fmt.yaml @@ -0,0 +1,25 @@ +name: main + +on: + push: + branches: + - main + pull_request: + branches: + - main + +jobs: + check-flake: + name: Check Flake + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + + - name: Install Nix + uses: cachix/install-nix-action@v18 + with: + extra_nix_config: | + experimental-features = nix-command flakes + + - run: nix-shell -p nixpkgs-fmt --run 'nixpkgs-fmt .' From c8f8779e4b9029950ade9e69e9b8bec630b625a5 Mon Sep 17 00:00:00 2001 From: revol-xut Date: Sat, 17 Dec 2022 17:46:35 +0100 Subject: [PATCH 2/8] nixpkgs-fmt forgot the --check flag --- .github/workflows/fmt.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/fmt.yaml b/.github/workflows/fmt.yaml index 1bffffa..6f8d3f4 100644 --- a/.github/workflows/fmt.yaml +++ b/.github/workflows/fmt.yaml @@ -22,4 +22,4 @@ jobs: extra_nix_config: | experimental-features = nix-command flakes - - run: nix-shell -p nixpkgs-fmt --run 'nixpkgs-fmt .' + - run: nix-shell -p nixpkgs-fmt --run 'nixpkgs-fmt . --check' From e6d173f07ff30909d0db96bc383a2a9118135064 Mon Sep 17 00:00:00 2001 From: revol-xut Date: Sat, 17 Dec 2022 17:48:47 +0100 Subject: [PATCH 3/8] github ci updating channel --- .github/workflows/fmt.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/fmt.yaml b/.github/workflows/fmt.yaml index 6f8d3f4..dc26e7a 100644 --- a/.github/workflows/fmt.yaml +++ b/.github/workflows/fmt.yaml @@ -22,4 +22,5 @@ jobs: extra_nix_config: | experimental-features = nix-command flakes + - run: nix-channel --update - run: nix-shell -p nixpkgs-fmt --run 'nixpkgs-fmt . --check' From e0ef7537e10dc1c7a177148c994654c0cf20f3ed Mon Sep 17 00:00:00 2001 From: revol-xut Date: Sat, 17 Dec 2022 17:52:51 +0100 Subject: [PATCH 4/8] updating and adding channel --- .github/workflows/fmt.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/fmt.yaml b/.github/workflows/fmt.yaml index dc26e7a..dd730bd 100644 --- a/.github/workflows/fmt.yaml +++ b/.github/workflows/fmt.yaml @@ -21,6 +21,7 @@ jobs: with: extra_nix_config: | experimental-features = nix-command flakes - + - run: nix-channel --list + - run: nix-channel --add https://nixos.org/channels/nixos-22.11 nixos - run: nix-channel --update - run: nix-shell -p nixpkgs-fmt --run 'nixpkgs-fmt . --check' From 3395b4740530925b2b94ff7c949c7881aab5e988 Mon Sep 17 00:00:00 2001 From: revol-xut Date: Sat, 17 Dec 2022 17:57:05 +0100 Subject: [PATCH 5/8] lisiting channels --- .github/workflows/fmt.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/fmt.yaml b/.github/workflows/fmt.yaml index dd730bd..d9e3359 100644 --- a/.github/workflows/fmt.yaml +++ b/.github/workflows/fmt.yaml @@ -24,4 +24,5 @@ jobs: - run: nix-channel --list - run: nix-channel --add https://nixos.org/channels/nixos-22.11 nixos - run: nix-channel --update + - run: nix-channel --list - run: nix-shell -p nixpkgs-fmt --run 'nixpkgs-fmt . --check' From 01129ebf173945c9ce18ffa3731f2e9caa63dbf9 Mon Sep 17 00:00:00 2001 From: revol-xut Date: Sat, 17 Dec 2022 18:01:28 +0100 Subject: [PATCH 6/8] using modern nix --- .github/workflows/fmt.yaml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/fmt.yaml b/.github/workflows/fmt.yaml index d9e3359..ba75025 100644 --- a/.github/workflows/fmt.yaml +++ b/.github/workflows/fmt.yaml @@ -10,7 +10,7 @@ on: jobs: check-flake: - name: Check Flake + name: Nixpkgs Formatting runs-on: ubuntu-latest steps: @@ -21,8 +21,10 @@ jobs: with: extra_nix_config: | experimental-features = nix-command flakes + - run: nix-channel --list - run: nix-channel --add https://nixos.org/channels/nixos-22.11 nixos - run: nix-channel --update - run: nix-channel --list + - run: nix shell nixpkgs#nixpkgs-fmt -c nixpkgs-fmt . --check - run: nix-shell -p nixpkgs-fmt --run 'nixpkgs-fmt . --check' From 09d8697f7a2c03977ef04e8e3050008cf4f2c015 Mon Sep 17 00:00:00 2001 From: revol-xut Date: Sat, 17 Dec 2022 18:05:19 +0100 Subject: [PATCH 7/8] removing old command from pipeline --- .github/workflows/fmt.yaml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/fmt.yaml b/.github/workflows/fmt.yaml index ba75025..93d16c5 100644 --- a/.github/workflows/fmt.yaml +++ b/.github/workflows/fmt.yaml @@ -22,9 +22,6 @@ jobs: extra_nix_config: | experimental-features = nix-command flakes - - run: nix-channel --list - run: nix-channel --add https://nixos.org/channels/nixos-22.11 nixos - run: nix-channel --update - - run: nix-channel --list - run: nix shell nixpkgs#nixpkgs-fmt -c nixpkgs-fmt . --check - - run: nix-shell -p nixpkgs-fmt --run 'nixpkgs-fmt . --check' From 141bdb9737d3cebe5592349a56ec73f4b2a6600f Mon Sep 17 00:00:00 2001 From: revol-xut Date: Sat, 17 Dec 2022 19:12:41 +0100 Subject: [PATCH 8/8] adding option for domain --- flake.nix | 8 ++++++-- modules/hedgedoc.nix | 2 +- modules/nextcloud.nix | 2 +- modules/options.nix | 15 +++++++++++---- modules/stream.nix | 2 +- modules/wiki.nix | 10 +--------- 6 files changed, 21 insertions(+), 18 deletions(-) diff --git a/flake.nix b/flake.nix index bd91d47..2f5f766 100755 --- a/flake.nix +++ b/flake.nix @@ -56,15 +56,18 @@ modules = [ inputs.sops-nix.nixosModules.sops ./hosts/quitte/configuration.nix + ./modules/options.nix ./modules/base.nix ./modules/sops.nix - ./modules/keycloak.nix + # ./modules/keycloak.nix replaced by portunus ./modules/nginx.nix ./modules/hedgedoc.nix ./modules/wiki.nix ./modules/stream.nix ./modules/nextcloud.nix { + fsr.enable_office_bloat = false; + fsr.domain = "staging.ifsr.de"; sops.defaultSopsFile = ./secrets/quitte.yaml; } ]; @@ -74,8 +77,9 @@ modules = [ inputs.sops-nix.nixosModules.sops ./hosts/quitte/configuration.nix + ./modules/options.nix ./modules/base.nix - ./modules/keycloak.nix + # ./modules/keycloak.nix replaced by portunus ./modules/nginx.nix ./modules/hedgedoc.nix ./modules/wiki.nix diff --git a/modules/hedgedoc.nix b/modules/hedgedoc.nix index 501b0d9..3c8b776 100644 --- a/modules/hedgedoc.nix +++ b/modules/hedgedoc.nix @@ -1,6 +1,6 @@ { config, pkgs, lib, ... }: let - domain = "pad.quitte.tassilo-tanneberger.de"; + domain = "pad.${config.fsr.domain}"; in { services = { diff --git a/modules/nextcloud.nix b/modules/nextcloud.nix index 407f847..373466d 100644 --- a/modules/nextcloud.nix +++ b/modules/nextcloud.nix @@ -1,6 +1,6 @@ { config, pkgs, lib, ... }: let - domain = "nc.quitte.fugi.dev"; + domain = "nc.${config.fsr.domain}"; in { sops.secrets = { diff --git a/modules/options.nix b/modules/options.nix index 26868ae..dc8f4d5 100644 --- a/modules/options.nix +++ b/modules/options.nix @@ -1,7 +1,14 @@ { config, lib, ... }: with lib; { - options.fsr.enable_office_bloat = mkOption { - type = types.bool; - default = false; - description = "install heavy office bloat like texlive, okular, ..."; + options.fsr = { + enable_office_bloat = mkOption { + type = types.bool; + default = false; + description = "install heavy office bloat like texlive, okular, ..."; + }; + domain = mkOption { + type = types.str; + default = "ifsr.de"; + description = "under which top level domain the services should run"; + }; }; } diff --git a/modules/stream.nix b/modules/stream.nix index 2d7bb7f..088840d 100644 --- a/modules/stream.nix +++ b/modules/stream.nix @@ -10,7 +10,7 @@ in services = { nginx = { virtualHosts = { - "stream.ifsr.de" = { + "stream.${config.fsr.domain}" = { enableACME = true; forceSSL = true; locations."/" = diff --git a/modules/wiki.nix b/modules/wiki.nix index 23767c8..aa4e5cc 100644 --- a/modules/wiki.nix +++ b/modules/wiki.nix @@ -116,10 +116,6 @@ $wgPluggableAuth_EnableLocalLogin = true; ''; extensions = { - #Cite = pkgs.fetchzip { - # url = "https://web.archive.org/web/20220627203658/https://extdist.wmflabs.org/dist/extensions/Cite-REL1_38-d40993e.tar.gz"; - # sha256 = "sha256-dziMo6sH4yMPjnDtt0TXiGBxE5uGRJM+scwdeuer5sM="; - #}; CiteThisPage = pkgs.fetchzip { url = "https://web.archive.org/web/20220627203556/https://extdist.wmflabs.org/dist/extensions/CiteThisPage-REL1_38-bb4881c.tar.gz"; sha256 = "sha256-sTZMCLlOkQBEmLiFz2BQJpWRxSDbpS40EZQ+f/jFjxI="; @@ -128,10 +124,6 @@ url = "https://web.archive.org/web/20220627203619/https://extdist.wmflabs.org/dist/extensions/ConfirmEdit-REL1_38-50f4dfd.tar.gz"; sha256 = "sha256-babZDzcQDE446TBuGW/olbt2xRbPjk+5o3o9DUFlCxk="; }; - #DynamicPageList = pkgs.fetchzip { - # url = "https://web.archive.org/web/20220627203129/https://extdist.wmflabs.org/dist/extensions/DynamicPageList-REL1_38-3b7a26d.tar.gz"; - # sha256 = "sha256-WjVLks0Q9hSN2poqbKzTJhvOXog7UHJqjY2WJ4Uc64o="; - #}; Lockdown = pkgs.fetchzip { url = "https://web.archive.org/web/20220627203048/https://extdist.wmflabs.org/dist/extensions/Lockdown-REL1_38-1915db4.tar.gz"; sha256 = "sha256-YCYsjh/3g2P8oT6IomP3UWjOoggH7jYjiiix7poOYnA="; @@ -188,7 +180,7 @@ nginx = { recommendedProxySettings = true; virtualHosts = { - "wiki.quitte.tassilo-tanneberger.de" = { + "wiki.${config.fsr.domain}" = { enableACME = true; forceSSL = true; locations."/" = {