From 4c1e53287658f2d0740f32a2ab724a5270987751 Mon Sep 17 00:00:00 2001 From: Pegasust Date: Fri, 23 Dec 2022 02:20:17 -0700 Subject: [PATCH] agenix --- nix-conf/system/flake.lock | 67 ++++++++++++++------------------------ nix-conf/system/flake.nix | 44 +++++++++++++++---------- 2 files changed, 52 insertions(+), 59 deletions(-) diff --git a/nix-conf/system/flake.lock b/nix-conf/system/flake.lock index 1232c9a..64f2e8c 100644 --- a/nix-conf/system/flake.lock +++ b/nix-conf/system/flake.lock @@ -1,12 +1,32 @@ { "nodes": { + "agenix": { + "inputs": { + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1665870395, + "narHash": "sha256-Tsbqb27LDNxOoPLh0gw2hIb6L/6Ow/6lIBvqcHzEKBI=", + "owner": "ryantm", + "repo": "agenix", + "rev": "a630400067c6d03c9b3e0455347dc8559db14288", + "type": "github" + }, + "original": { + "owner": "ryantm", + "repo": "agenix", + "type": "github" + } + }, "nixpkgs": { "locked": { - "lastModified": 1669140675, - "narHash": "sha256-npzfyfLECsJWgzK/M4gWhykP2DNAJTYjgY2BWkz/oEQ=", + "lastModified": 1671359686, + "narHash": "sha256-3MpC6yZo+Xn9cPordGz2/ii6IJpP2n8LE8e/ebUXLrs=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "2788904d26dda6cfa1921c5abb7a2466ffe3cb8c", + "rev": "04f574a1c0fde90b51bf68198e2297ca4e7cccf4", "type": "github" }, "original": { @@ -15,47 +35,10 @@ "type": "indirect" } }, - "nixpkgs-stable": { - "locked": { - "lastModified": 1671459584, - "narHash": "sha256-6wRK7xmeHfClJ0ICOkax1avLZVGTDqBodQlkl/opccY=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "87b58217c9a05edcf7630b9be32570f889217aef", - "type": "github" - }, - "original": { - "owner": "NixOS", - "ref": "release-22.11", - "repo": "nixpkgs", - "type": "github" - } - }, "root": { "inputs": { - "nixpkgs": "nixpkgs", - "sops-nix": "sops-nix" - } - }, - "sops-nix": { - "inputs": { - "nixpkgs": [ - "nixpkgs" - ], - "nixpkgs-stable": "nixpkgs-stable" - }, - "locked": { - "lastModified": 1671472949, - "narHash": "sha256-9iHSGpljCX+RypahQssBXPwkru9onfKfceCTeVrMpH4=", - "owner": "Mic92", - "repo": "sops-nix", - "rev": "32840f16ffa0856cdf9503a8658f2dd42bf70342", - "type": "github" - }, - "original": { - "owner": "Mic92", - "repo": "sops-nix", - "type": "github" + "agenix": "agenix", + "nixpkgs": "nixpkgs" } } }, diff --git a/nix-conf/system/flake.nix b/nix-conf/system/flake.nix index 780769c..82fd9c8 100644 --- a/nix-conf/system/flake.nix +++ b/nix-conf/system/flake.nix @@ -1,14 +1,24 @@ { inputs = { nixpkgs.url = "nixpkgs/nixos-unstable"; - agenix.url = "github:ryantm/agenix"; + agenix = { + url = "github:ryantm/agenix"; + inputs.nixpkgs.follows = "nixpkgs"; + }; }; outputs = { self, nixpkgs, agenix, ... }: let lib = nixpkgs.lib; proj_root = ./../..; - base_modules = [agenix.nixosModule]; + # TODO: Change respectively to the system or make a nix shell to alias `nix run github:ryantm/agenix -- ` + additionalPackages = [agenix.defaultPackage.x86_64-linux]; + base_modules = [ + agenix.nixosModule + { + environment.systemPackages = additionalPackages; + } + ]; in { # Windows with NixOS WSL nixosConfigurations.Felia = nixpkgs.lib.nixosSystem { @@ -214,21 +224,21 @@ (lib.mapAttrsToList (name: value: "${name}${lib.optionalString (value != null) "=${value}"}") conf)); in "${mount_dest} ${confToBackendArg backend_args} ${s3fs-exec}#${bucket}"; personalStorage = [ - (autofs-s3fs_entry { - mount_dest = "hot"; - backend_args = { - "-fstype" = "fuse"; - use_cache = "/tmp"; - del_cache = null; - allow_other = null; - url = "https://f5i0.ph.idrivee2-32.com"; - # TODO: builtins.readFile requires a Git-controlled file - passwd_file = (pkgs.writeText "env.s3fs.idrive" (builtins.readFile - ./../../secrets/env.s3fs - )); - }; - bucket = "hungtr-hot"; - }) + # (autofs-s3fs_entry { + # mount_dest = "hot"; + # backend_args = { + # "-fstype" = "fuse"; + # use_cache = "/tmp"; + # del_cache = null; + # allow_other = null; + # url = "https://f5i0.ph.idrivee2-32.com"; + # # TODO: builtins.readFile requires a Git-controlled file + # passwd_file = (pkgs.writeText "env.s3fs.idrive" (builtins.readFile + # ./../../secrets/env.s3fs + # )); + # }; + # bucket = "hungtr-hot"; + # }) ]; persoConf = pkgs.writeText "personal" (builtins.concatStringsSep "\n" personalStorage); in {