From 34cf32a834a3b6abf46643e4cc6bc1a0d5f2992d Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Thu, 31 Dec 2020 14:32:30 +0100 Subject: Support for sops --- flake.lock | 24 +++++++++++++++++++++++- flake.nix | 15 +++++++++++++-- shell.nix | 1 + 3 files changed, 37 insertions(+), 3 deletions(-) diff --git a/flake.lock b/flake.lock index 89225a55..d9afa42f 100644 --- a/flake.lock +++ b/flake.lock @@ -40,7 +40,29 @@ "root": { "inputs": { "home-manager": "home-manager", - "nixpkgs": "nixpkgs" + "nixpkgs": "nixpkgs", + "sops-nix": "sops-nix" + } + }, + "sops-nix": { + "inputs": { + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1609306567, + "narHash": "sha256-CPVjO4tdmhHW7sOTbo8i9JN7HlNhakwpUi3u3+V6gnY=", + "owner": "Mic92", + "repo": "sops-nix", + "rev": "da343afab9aace88875f24bfb2d90e3d9afaafc4", + "type": "github" + }, + "original": { + "owner": "Mic92", + "ref": "master", + "repo": "sops-nix", + "type": "github" } } }, 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