top-level-nix
Pegasust 2022-12-23 02:20:17 -07:00
parent 4c28cd8b08
commit 4c1e532876
2 changed files with 52 additions and 59 deletions

View File

@ -1,12 +1,32 @@
{ {
"nodes": { "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": { "nixpkgs": {
"locked": { "locked": {
"lastModified": 1669140675, "lastModified": 1671359686,
"narHash": "sha256-npzfyfLECsJWgzK/M4gWhykP2DNAJTYjgY2BWkz/oEQ=", "narHash": "sha256-3MpC6yZo+Xn9cPordGz2/ii6IJpP2n8LE8e/ebUXLrs=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "2788904d26dda6cfa1921c5abb7a2466ffe3cb8c", "rev": "04f574a1c0fde90b51bf68198e2297ca4e7cccf4",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -15,47 +35,10 @@
"type": "indirect" "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": { "root": {
"inputs": { "inputs": {
"nixpkgs": "nixpkgs", "agenix": "agenix",
"sops-nix": "sops-nix" "nixpkgs": "nixpkgs"
}
},
"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"
} }
} }
}, },

View File

@ -1,14 +1,24 @@
{ {
inputs = { inputs = {
nixpkgs.url = "nixpkgs/nixos-unstable"; nixpkgs.url = "nixpkgs/nixos-unstable";
agenix.url = "github:ryantm/agenix"; agenix = {
url = "github:ryantm/agenix";
inputs.nixpkgs.follows = "nixpkgs";
};
}; };
outputs = { self, nixpkgs, agenix, ... }: outputs = { self, nixpkgs, agenix, ... }:
let let
lib = nixpkgs.lib; lib = nixpkgs.lib;
proj_root = ./../..; 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 { in {
# Windows with NixOS WSL # Windows with NixOS WSL
nixosConfigurations.Felia = nixpkgs.lib.nixosSystem { nixosConfigurations.Felia = nixpkgs.lib.nixosSystem {
@ -214,21 +224,21 @@
(lib.mapAttrsToList (name: value: "${name}${lib.optionalString (value != null) "=${value}"}") conf)); (lib.mapAttrsToList (name: value: "${name}${lib.optionalString (value != null) "=${value}"}") conf));
in "${mount_dest} ${confToBackendArg backend_args} ${s3fs-exec}#${bucket}"; in "${mount_dest} ${confToBackendArg backend_args} ${s3fs-exec}#${bucket}";
personalStorage = [ personalStorage = [
(autofs-s3fs_entry { # (autofs-s3fs_entry {
mount_dest = "hot"; # mount_dest = "hot";
backend_args = { # backend_args = {
"-fstype" = "fuse"; # "-fstype" = "fuse";
use_cache = "/tmp"; # use_cache = "/tmp";
del_cache = null; # del_cache = null;
allow_other = null; # allow_other = null;
url = "https://f5i0.ph.idrivee2-32.com"; # url = "https://f5i0.ph.idrivee2-32.com";
# TODO: builtins.readFile requires a Git-controlled file # # TODO: builtins.readFile requires a Git-controlled file
passwd_file = (pkgs.writeText "env.s3fs.idrive" (builtins.readFile # passwd_file = (pkgs.writeText "env.s3fs.idrive" (builtins.readFile
./../../secrets/env.s3fs # ./../../secrets/env.s3fs
)); # ));
}; # };
bucket = "hungtr-hot"; # bucket = "hungtr-hot";
}) # })
]; ];
persoConf = pkgs.writeText "personal" (builtins.concatStringsSep "\n" personalStorage); persoConf = pkgs.writeText "personal" (builtins.concatStringsSep "\n" personalStorage);
in { in {