From c4acd525c7b79424d474816cecd554e469db22f2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Motiejus=20Jak=C5=A1tys?= Date: Wed, 5 Apr 2023 14:46:57 +0300 Subject: [PATCH] flakes: add age and agenix --- flake.lock | 22 ++++++++++++++++++++++ flake.nix | 34 ++++++++++++++++++++++------------ 2 files changed, 44 insertions(+), 12 deletions(-) diff --git a/flake.lock b/flake.lock index 609331d..213f461 100644 --- a/flake.lock +++ b/flake.lock @@ -1,5 +1,26 @@ { "nodes": { + "agenix": { + "inputs": { + "darwin": [], + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1680281360, + "narHash": "sha256-XdLTgAzjJNDhAG2V+++0bHpSzfvArvr2pW6omiFfEJk=", + "owner": "ryantm", + "repo": "agenix", + "rev": "e64961977f60388dd0b49572bb0fc453b871f896", + "type": "github" + }, + "original": { + "owner": "ryantm", + "repo": "agenix", + "type": "github" + } + }, "deploy-rs": { "inputs": { "flake-compat": "flake-compat", @@ -73,6 +94,7 @@ }, "root": { "inputs": { + "agenix": "agenix", "deploy-rs": "deploy-rs", "flake-utils": "flake-utils", "nixpkgs": "nixpkgs" diff --git a/flake.nix b/flake.nix index 4b9f6d9..0eb3487 100644 --- a/flake.nix +++ b/flake.nix @@ -1,26 +1,30 @@ { description = "motiejus/config"; + inputs = { + nixpkgs.url = "github:NixOS/nixpkgs/nixos-22.11-small"; + flake-utils.url = "github:numtide/flake-utils"; + + agenix.url = "github:ryantm/agenix"; + agenix.inputs.nixpkgs.follows = "nixpkgs"; + agenix.inputs.darwin.follows = ""; + + deploy-rs.url = "github:serokell/deploy-rs"; + deploy-rs.inputs.nixpkgs.follows = "nixpkgs"; + deploy-rs.inputs.utils.follows = "flake-utils"; + + }; + nixConfig = { trusted-substituters = "https://cache.nixos.org/"; trusted-public-keys = "cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY="; extra-experimental-features = "nix-command flakes"; }; - inputs = { - nixpkgs.url = "github:NixOS/nixpkgs/nixos-22.11-small"; - - deploy-rs.url = "github:serokell/deploy-rs"; - deploy-rs.inputs.nixpkgs.follows = "nixpkgs"; - deploy-rs.inputs.utils.follows = "flake-utils"; - - flake-utils.url = "github:numtide/flake-utils"; - - }; - outputs = { self, nixpkgs, + agenix, deploy-rs, flake-utils, }: let @@ -33,6 +37,8 @@ ./configuration.nix ./hardware-configuration.nix ./zfs.nix + + agenix.nixosModules.default ]; }; @@ -55,7 +61,11 @@ in { devShells.default = with pkgs; mkShell { - packages = [deploy-rs.packages.x86_64-linux.deploy-rs]; + packages = [ + pkgs.age + agenix.packages.${system}.agenix + deploy-rs.packages.${system}.deploy-rs + ]; }; formatter = pkgs.alejandra;