use inputs.self for file paths

This commit is contained in:
zowoq 2023-05-17 08:03:45 +10:00 committed by Jonas Chevalier
parent 8655606c83
commit eb6370be98
4 changed files with 10 additions and 9 deletions

View file

@ -1,6 +1,6 @@
{ pkgs, lib, inputs, config, ... }:
let
userLib = import ../users/lib.nix { inherit lib; };
userLib = import "${toString inputs.self}/users/lib.nix" { inherit lib; };
nixpkgs-update-bin = "/var/lib/nixpkgs-update/bin/nixpkgs-update";
@ -179,7 +179,7 @@ in
sops.secrets.nix-community-cachix = {
path = "/home/r-ryantm/.config/cachix/cachix.dhall";
sopsFile = ../roles/nix-community-cache/secrets.yaml;
sopsFile = "${toString inputs.self}/roles/nix-community-cache/secrets.yaml";
owner = "r-ryantm";
group = "r-ryantm";
};

View file

@ -1,6 +1,6 @@
{ config, lib, ... }:
{ config, inputs, lib, ... }:
let
defaultSopsPath = ../. + "/${config.networking.hostName}/secrets.yaml";
defaultSopsPath = "${toString inputs.self}/${config.networking.hostName}/secrets.yaml";
in
{
sops.defaultSopsFile = lib.mkIf (builtins.pathExists defaultSopsPath) defaultSopsPath;

View file

@ -1,14 +1,15 @@
{ lib, ... }:
{ inputs, lib, ... }:
let
usersDir = "${toString inputs.self}/users";
userImports =
let
toUserPath = f: ../users/. + "/${f}";
toUserPath = f: usersDir + "/${f}";
onlyUserFiles = x:
lib.hasSuffix ".nix" x &&
x != "lib.nix"
;
userDirEntries = builtins.readDir ../users;
userDirEntries = builtins.readDir usersDir;
userFiles = builtins.filter onlyUserFiles (lib.attrNames userDirEntries);
in
builtins.map toUserPath userFiles;

View file

@ -1,4 +1,4 @@
{ lib, pkgs, config, ... }:
{ lib, inputs, pkgs, config, ... }:
let
upload-to-cachix = pkgs.writeScriptBin "upload-to-cachix" ''
#!/bin/sh
@ -45,7 +45,7 @@ in
];
nix.settings.post-build-hook = "${upload-to-cachix}/bin/upload-to-cachix";
sops.secrets.nix-community-cachix.sopsFile = ../../roles/nix-community-cache/secrets.yaml;
sops.secrets.nix-community-cachix.sopsFile = "${toString inputs.self}/roles/nix-community-cache/secrets.yaml";
sops.secrets.id_buildfarm = { };
# delete build logs older than 30 days