From 055dd32001bdc96fcee3ba0159ae9bb7c922d4b6 Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Thu, 31 Dec 2020 14:32:30 +0100 Subject: Support for sops --- flake.nix | 15 +++++++++++++-- shell.nix | 1 + 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/flake.nix b/flake.nix index fa1e81d6..1b2758e7 100644 --- a/flake.nix +++ b/flake.nix @@ -15,9 +15,16 @@ ref = "master"; inputs.nixpkgs.follows = "nixpkgs"; }; + sops-nix = { + type = "github"; + owner = "Mic92"; + repo = "sops-nix"; + ref = "master"; + inputs.nixpkgs.follows = "nixpkgs"; + }; }; - outputs = { self, nixpkgs, home-manager }@inputs: + outputs = { self, nixpkgs, home-manager, sops-nix }@inputs: let inherit (builtins) attrNames attrValues elemAt; inherit (nixpkgs) lib; @@ -33,6 +40,10 @@ }; modules = let + extraModules = [ + sops-nix.nixosModules.sops + home-manager.nixosModules.home-manager + ]; defaultProfiles = with self.nixosModules.systemProfiles; [core]; local = "${toString dir}/${path}"; global._module.args = { @@ -45,7 +56,7 @@ accountName' = splitString "@" n; hostName' = elemAt accountName' 1; in hostName' == hostName; - in [ home-manager.nixosModules.home-manager global ] ++ defaultProfiles ++ [ local ] ++ accountModules; + in extraModules ++ [ global ] ++ defaultProfiles ++ [ local ] ++ accountModules; }; mkSystemProfile = dir: path: profileName: { diff --git a/shell.nix b/shell.nix index 2820eb1a..2840bec7 100644 --- a/shell.nix +++ b/shell.nix @@ -12,5 +12,6 @@ in pkgs.mkShell { name = "nixos"; nativeBuildInputs = with pkgs; [ nixWithFlakes + sops ]; } -- cgit v1.2.3