From 996c82d99f1c543be5873dd898b9aaa2b579afce Mon Sep 17 00:00:00 2001 From: soraefir Date: Fri, 24 Nov 2023 19:08:21 +0100 Subject: [PATCH] [m]Flake sops & format --- .sops.yaml | 10 +++++----- flake.nix | 1 - .../nixos/system/security/sops/default.nix | 7 +++++-- shells/default.nix | 20 +++++++++---------- 4 files changed, 19 insertions(+), 19 deletions(-) diff --git a/.sops.yaml b/.sops.yaml index 993b0cc..9b660a3 100755 --- a/.sops.yaml +++ b/.sops.yaml @@ -10,32 +10,32 @@ keys: - &asgard age1sxzuhh2fcd4pmaz4mdqq95t683d32ft22w9t2r7pk258u0s8wymsqdj7lg creation_rules: - - path_regex: secrets/iriy.ya?ml$ + - path_regex: modules/nixos/system/security/sops/iriy.ya?ml$ key_groups: - age: - *iriy pgp: - *sora - - path_regex: secrets/avalon.ya?ml$ + - path_regex: modules/nixos/system/security/sops/avalon.ya?ml$ key_groups: - age: - *avalon pgp: - *sora - - path_regex: secrets/valinor.ya?ml$ + - path_regex: modules/nixos/system/security/sops/valinor.ya?ml$ key_groups: - age: - *valinor pgp: - *sora - - path_regex: secrets/asgard.ya?ml$ + - path_regex: modules/nixos/system/security/sops/asgard.ya?ml$ key_groups: - age: - *asgard pgp: - *sora - - path_regex: secrets/common.ya?ml$ + - path_regex: modules/nixos/system/security/sops/common.yaml$ key_groups: - age: - *valinor diff --git a/flake.nix b/flake.nix index 080cf62..ed0181e 100755 --- a/flake.nix +++ b/flake.nix @@ -33,7 +33,6 @@ let gen = import ./generator.nix { inherit inputs; }; in { - devShells = import ./shells { inherit inputs; }; nixosConfigurations = { diff --git a/modules/nixos/system/security/sops/default.nix b/modules/nixos/system/security/sops/default.nix index 745b913..245bbf9 100755 --- a/modules/nixos/system/security/sops/default.nix +++ b/modules/nixos/system/security/sops/default.nix @@ -1,6 +1,8 @@ -{ config, pkgs, ... }: { +{ config, pkgs, ... }: +let keyFilePath = "/var/lib/sops-nix/age-key.txt"; +in { sops.defaultSopsFile = ./common.yaml; - sops.age.keyFile = "/var/lib/sops-nix/age-key.txt"; + sops.age.keyFile = keyFilePath; sops.age.generateKey = true; sops.secrets.wifi = { }; @@ -19,5 +21,6 @@ sops.secrets."${config.hostcfg.hostname}_wg_pub" = { }; environment.systemPackages = with pkgs; [ sops ]; + environment.sessionVariables.OPS_AGE_KEY_FILE = keyFilePath; } diff --git a/shells/default.nix b/shells/default.nix index 8638cb6..18f881c 100644 --- a/shells/default.nix +++ b/shells/default.nix @@ -2,14 +2,12 @@ let forEachSystem = inputs.nixpkgs.lib.genAttrs [ "aarch64-linux" "x86_64-linux" ]; -in - forEachSystem (system: - let - overlays = import ./pkgs/overlay.nix { inherit pkgs; }; - overrides = { custom = import ./pkgs { inherit pkgs; }; }; - pkgs = import inputs.nixpkgs { inherit system overlays; } // overrides; - in { - default = import ./shells/devsh { inherit pkgs; }; - devsh = import ./shells/devsh { inherit pkgs; }; - } - ) +in forEachSystem (system: + let + overlays = import ./pkgs/overlay.nix { inherit pkgs; }; + overrides = { custom = import ./pkgs { inherit pkgs; }; }; + pkgs = import inputs.nixpkgs { inherit system overlays; } // overrides; + in { + default = import ./shells/devsh { inherit pkgs; }; + devsh = import ./shells/devsh { inherit pkgs; }; + })