From 4a3029528fff72c354ef03c7054318478b469c55 Mon Sep 17 00:00:00 2001 From: h7x4 Date: Sun, 31 Mar 2024 04:40:46 +0200 Subject: [PATCH] WIP: idp theme --- flake.lock | 19 ++++++++++++++++++- flake.nix | 16 +++++++++++++--- .../services/idp-simplesamlphp/config.php | 3 ++- .../services/idp-simplesamlphp/default.nix | 2 ++ 4 files changed, 35 insertions(+), 5 deletions(-) diff --git a/flake.lock b/flake.lock index 1b6860c..cada64c 100644 --- a/flake.lock +++ b/flake.lock @@ -155,7 +155,8 @@ "nixpkgs": "nixpkgs", "nixpkgs-unstable": "nixpkgs-unstable", "pvv-calendar-bot": "pvv-calendar-bot", - "sops-nix": "sops-nix" + "sops-nix": "sops-nix", + "ssp-theme": "ssp-theme" } }, "sops-nix": { @@ -178,6 +179,22 @@ "repo": "sops-nix", "type": "github" } + }, + "ssp-theme": { + "flake": false, + "locked": { + "lastModified": 1509201641, + "narHash": "sha256-naNRyPL6PAsZKW2w1Vt9wrHT9inCL/yAFnvpy4glv+c=", + "ref": "refs/heads/master", + "rev": "bda4314030be5f81aeaf2fb1927aee582f1194d9", + "revCount": 5, + "type": "git", + "url": "https://git.pvv.ntnu.no/Drift/ssp-theme.git" + }, + "original": { + "type": "git", + "url": "https://git.pvv.ntnu.no/Drift/ssp-theme.git" + } } }, "root": "root", diff --git a/flake.nix b/flake.nix index fd9987a..f22e61d 100644 --- a/flake.nix +++ b/flake.nix @@ -21,9 +21,12 @@ grzegorz.inputs.nixpkgs.follows = "nixpkgs-unstable"; grzegorz-clients.url = "github:Programvareverkstedet/grzegorz-clients"; grzegorz-clients.inputs.nixpkgs.follows = "nixpkgs"; + + ssp-theme.url = "git+https://git.pvv.ntnu.no/Drift/ssp-theme.git"; + ssp-theme.flake = false; }; - outputs = { self, nixpkgs, nixpkgs-unstable, sops-nix, disko, ... }@inputs: + outputs = { self, nixpkgs, nixpkgs-unstable, sops-nix, disko, ssp-theme, ... }@inputs: let nixlib = nixpkgs.lib; systems = [ @@ -84,6 +87,9 @@ }; mediawiki-extensions = final.callPackage ./packages/mediawiki-extensions { }; simplesamlphp = final.callPackage ./packages/simplesamlphp { }; + ssp-theme = final.runCommandLocal "ssp-theme" { } '' + ln -s ${ssp-theme} $out + ''; }) ]; }; @@ -119,8 +125,8 @@ packages = { "x86_64-linux" = let pkgs = nixpkgs.legacyPackages."x86_64-linux"; - in rec { - default = important-machines; + in { + default = self.packages.x86_64-linux.important-machines; important-machines = pkgs.linkFarm "important-machines" (nixlib.getAttrs importantMachines self.packages.x86_64-linux); all-machines = pkgs.linkFarm "all-machines" @@ -137,6 +143,10 @@ simplesamlphp = pkgs.callPackage ./packages/simplesamlphp { }; mediawiki-extensions = pkgs.callPackage ./packages/mediawiki-extensions { }; + + ssp-theme = pkgs.runCommandLocal "ssp-theme" { } '' + ln -s ${ssp-theme} $out + ''; } // nixlib.genAttrs allMachines (machine: self.nixosConfigurations.${machine}.config.system.build.toplevel); }; diff --git a/hosts/bekkalokk/services/idp-simplesamlphp/config.php b/hosts/bekkalokk/services/idp-simplesamlphp/config.php index 09f3c2f..0b2f90b 100644 --- a/hosts/bekkalokk/services/idp-simplesamlphp/config.php +++ b/hosts/bekkalokk/services/idp-simplesamlphp/config.php @@ -556,6 +556,7 @@ $config = [ 'module.enable' => [ 'admin' => true, 'authpwauth' => true, + 'themepvv' => true, ], @@ -858,7 +859,7 @@ $config = [ /* * Which theme directory should be used? */ - 'theme.use' => 'default', + 'theme.use' => 'themepvv:pvv', /* * Set this option to the text you would like to appear at the header of each page. Set to false if you don't want diff --git a/hosts/bekkalokk/services/idp-simplesamlphp/default.nix b/hosts/bekkalokk/services/idp-simplesamlphp/default.nix index 8213709..38a8949 100644 --- a/hosts/bekkalokk/services/idp-simplesamlphp/default.nix +++ b/hosts/bekkalokk/services/idp-simplesamlphp/default.nix @@ -96,6 +96,8 @@ let ''; "modules/authpwauth/src/Auth/Source/PwAuth.php" = ./authpwauth.php; + + "modules/themepvv" = pkgs.ssp-theme; }; }; in