From 99c5b9d802a731ef945daaddf0c966579576138a Mon Sep 17 00:00:00 2001 From: Vivian Roest Date: Fri, 10 Nov 2023 23:41:30 +0100 Subject: [PATCH] fix lint --- nixos/common/desktop/home.nix | 42 +++--- nixos/common/hm-modules/rust.nix | 22 +-- nixos/hosts/olympus/dex/configuration.nix | 163 +++++++++++----------- 3 files changed, 114 insertions(+), 113 deletions(-) diff --git a/nixos/common/desktop/home.nix b/nixos/common/desktop/home.nix index e9b37d53..033f235b 100644 --- a/nixos/common/desktop/home.nix +++ b/nixos/common/desktop/home.nix @@ -5,8 +5,7 @@ let dnd-5e-latex-template = { pkgs = [ pkgs.v.dnd-5e-latex-template ]; }; }; my-python-packages = ps: with ps; [ pandas requests numpy ]; -in -{ +in { home.packages = with pkgs; [ (python3.withPackages my-python-packages) btop @@ -44,9 +43,11 @@ in # Enable my own hm modules themes.v.catppuccin.enable = true; programs = { - v.vscode.enable = true; - v.nvim.enable = true; - v.rust.enable = true; + v = { + vscode.enable = true; + nvim.enable = true; + rust.enable = true; + }; riff = { enable = true; @@ -72,26 +73,23 @@ in thunderbird = { enable = true; - profiles.default = { - isDefault = true; - }; + profiles.default = { isDefault = true; }; }; }; # Syncthing services.syncthing.enable = true; - xdg.userDirs = - let home = config.home.homeDirectory; - in { - enable = true; - createDirectories = true; - desktop = "${home}/.desktop"; - documents = "${home}/cloud/Documents"; - download = "${home}/dl"; - music = "${home}/cloud/Music"; - pictures = "${home}/cloud/Pictures"; - publicShare = "${home}/.publicShare"; - templates = "${home}/.templates"; - videos = "${home}/cloud/Videos"; - }; + xdg.userDirs = let home = config.home.homeDirectory; + in { + enable = true; + createDirectories = true; + desktop = "${home}/.desktop"; + documents = "${home}/cloud/Documents"; + download = "${home}/dl"; + music = "${home}/cloud/Music"; + pictures = "${home}/cloud/Pictures"; + publicShare = "${home}/.publicShare"; + templates = "${home}/.templates"; + videos = "${home}/cloud/Videos"; + }; } diff --git a/nixos/common/hm-modules/rust.nix b/nixos/common/hm-modules/rust.nix index 836eeb45..752ed047 100644 --- a/nixos/common/hm-modules/rust.nix +++ b/nixos/common/hm-modules/rust.nix @@ -4,18 +4,20 @@ let cfg = config.programs.v.rust; in { options.programs.v.rust = { enable = mkEnableOption "rust"; }; config = mkIf cfg.enable { - home.packages = with pkgs; [ rustup ]; + home = { + packages = with pkgs; [ rustup ]; - home.file = { - ".cargo/config.toml".text = '' - [registries.crates-io] - protocol = "sparse" + file = { + ".cargo/config.toml".text = '' + [registries.crates-io] + protocol = "sparse" - [build] - rustc-wrapper = "${pkgs.sccache}/bin/sccache" - ''; + [build] + rustc-wrapper = "${pkgs.sccache}/bin/sccache" + ''; + }; + + sessionPath = [ "$HOME/.cargo/bin" ]; }; - - home.sessionPath = [ "$HOME/.cargo/bin" ]; }; } diff --git a/nixos/hosts/olympus/dex/configuration.nix b/nixos/hosts/olympus/dex/configuration.nix index e70f16c6..3105b95a 100644 --- a/nixos/hosts/olympus/dex/configuration.nix +++ b/nixos/hosts/olympus/dex/configuration.nix @@ -9,8 +9,7 @@ let db_name = "dex"; inherit (config.meta.exposes.dex) port; metricsPort = 5558; -in -{ +in { imports = [ ]; # This value determines the NixOS release from which the default @@ -23,91 +22,93 @@ in networking.firewall.allowedTCPPorts = [ port metricsPort ]; - services.postgresql = { - enable = true; - package = pkgs.postgresql_15; - ensureDatabases = [ db_name ]; - ensureUsers = [{ - name = db_user; - ensurePermissions = { - "DATABASE ${db_name}" = "ALL PRIVILEGES"; - "schema public" = "ALL"; - }; - }]; - }; - vault-secrets.secrets.dex = { }; + services = { - services.dex = { - enable = true; - settings = { - issuer = "https://dex.0x76.dev"; - storage = { - type = "postgres"; - config = { - host = "/var/run/postgresql"; - user = db_user; - database = db_name; - }; - }; - web.http = "0.0.0.0:${toString port}"; - telemetry.http = "0.0.0.0:${toString metricsPort}"; - - connectors = [{ - type = "gitea"; - id = "gitea"; - name = "Gitea"; - config = { - clientID = "$GITEA_CLIENT_ID"; - clientSecret = "$GITEA_CLIENT_SECRET"; - redirectURI = "https://dex.0x76.dev/callback"; - baseURL = "https://git.0x76.dev"; + postgresql = { + enable = true; + package = pkgs.postgresql_15; + ensureDatabases = [ db_name ]; + ensureUsers = [{ + name = db_user; + ensurePermissions = { + "DATABASE ${db_name}" = "ALL PRIVILEGES"; + "schema public" = "ALL"; }; }]; - - staticClients = [ - { - id = "outline"; - name = "Outline"; - redirectURIs = [ "https://outline.0x76.dev/auth/oidc.callback" ]; - secretEnv = "OUTLINE_CLIENT_SECRET"; - } - { - id = "grafana"; - name = "Grafana"; - redirectURIs = [ "https://grafana.0x76.dev/login/generic_oauth" ]; - secretEnv = "GRAFANA_CLIENT_SECRET"; - } - { - id = "hedgedoc"; - name = "Hedgedoc"; - redirectURIs = [ "https://md.0x76.dev/auth/oauth2/callback" ]; - secretEnv = "HEDGEDOC_CLIENT_SECRET"; - } - { - id = "flux"; - name = "Weave Gitops Flux Dashboard"; - redirectURIs = [ "https://flux.0x76.dev/oauth2/callback" ]; - secretEnv = "FLUX_CLIENT_SECRET"; - } - { - id = "oauth2-proxy"; - name = "OAuth2 Proxy"; - redirectURIs = [ "https://o2p.0x76.dev/oauth2/callback" ]; - secretEnv = "O2P_CLIENT_SECRET"; - } - ]; }; - environmentFile = "${vs.dex}/environment"; - }; + dex = { + enable = true; + settings = { + issuer = "https://dex.0x76.dev"; + storage = { + type = "postgres"; + config = { + host = "/var/run/postgresql"; + user = db_user; + database = db_name; + }; + }; + web.http = "0.0.0.0:${toString port}"; + telemetry.http = "0.0.0.0:${toString metricsPort}"; - services.oauth2_proxy = { - enable = true; - provider = "oidc"; - redirectURL = "https://o2p.0x76.dev/oauth2/callback"; - cookie.secure = false; - httpAddress = "0.0.0.0:4180"; - keyFile = ""; + connectors = [{ + type = "gitea"; + id = "gitea"; + name = "Gitea"; + config = { + clientID = "$GITEA_CLIENT_ID"; + clientSecret = "$GITEA_CLIENT_SECRET"; + redirectURI = "https://dex.0x76.dev/callback"; + baseURL = "https://git.0x76.dev"; + }; + }]; + + staticClients = [ + { + id = "outline"; + name = "Outline"; + redirectURIs = [ "https://outline.0x76.dev/auth/oidc.callback" ]; + secretEnv = "OUTLINE_CLIENT_SECRET"; + } + { + id = "grafana"; + name = "Grafana"; + redirectURIs = [ "https://grafana.0x76.dev/login/generic_oauth" ]; + secretEnv = "GRAFANA_CLIENT_SECRET"; + } + { + id = "hedgedoc"; + name = "Hedgedoc"; + redirectURIs = [ "https://md.0x76.dev/auth/oauth2/callback" ]; + secretEnv = "HEDGEDOC_CLIENT_SECRET"; + } + { + id = "flux"; + name = "Weave Gitops Flux Dashboard"; + redirectURIs = [ "https://flux.0x76.dev/oauth2/callback" ]; + secretEnv = "FLUX_CLIENT_SECRET"; + } + { + id = "oauth2-proxy"; + name = "OAuth2 Proxy"; + redirectURIs = [ "https://o2p.0x76.dev/oauth2/callback" ]; + secretEnv = "O2P_CLIENT_SECRET"; + } + ]; + }; + + environmentFile = "${vs.dex}/environment"; + }; + + oauth2_proxy = { + enable = true; + provider = "oidc"; + redirectURL = "https://o2p.0x76.dev/oauth2/callback"; + cookie.secure = false; + httpAddress = "0.0.0.0:4180"; + keyFile = ""; + }; }; }