stop setting netrc-file
This commit is contained in:
parent
aa4732af7b
commit
d6d6721c16
6 changed files with 95 additions and 2 deletions
65
module-checks.nix
Normal file
65
module-checks.nix
Normal file
|
|
@ -0,0 +1,65 @@
|
|||
{ self, pkgs }:
|
||||
let
|
||||
lib = pkgs.lib;
|
||||
fakePackage = pkgs.runCommand "nix-cache-login-fake-package" { } ''
|
||||
mkdir -p "$out/bin"
|
||||
touch "$out/bin/nix-cache-login"
|
||||
chmod +x "$out/bin/nix-cache-login"
|
||||
'';
|
||||
|
||||
hmStubModule =
|
||||
{ lib, ... }:
|
||||
{
|
||||
options = {
|
||||
home.packages = lib.mkOption {
|
||||
type = lib.types.listOf lib.types.package;
|
||||
default = [ ];
|
||||
};
|
||||
home.homeDirectory = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
default = "/home/tester";
|
||||
};
|
||||
xdg.configHome = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
default = "/home/tester/.config";
|
||||
};
|
||||
nix.settings = lib.mkOption {
|
||||
type = lib.types.attrsOf lib.types.anything;
|
||||
default = { };
|
||||
};
|
||||
systemd.user.services = lib.mkOption {
|
||||
type = lib.types.attrsOf lib.types.anything;
|
||||
default = { };
|
||||
};
|
||||
systemd.user.timers = lib.mkOption {
|
||||
type = lib.types.attrsOf lib.types.anything;
|
||||
default = { };
|
||||
};
|
||||
launchd.agents = lib.mkOption {
|
||||
type = lib.types.attrsOf lib.types.anything;
|
||||
default = { };
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
evalHome =
|
||||
extraConfig:
|
||||
lib.evalModules {
|
||||
modules = [
|
||||
hmStubModule
|
||||
./home-module.nix
|
||||
{
|
||||
services.nix-cache-login.enable = true;
|
||||
services.nix-cache-login.package = fakePackage;
|
||||
}
|
||||
extraConfig
|
||||
];
|
||||
};
|
||||
|
||||
homeDefault = evalHome { };
|
||||
in
|
||||
pkgs.runCommand "nix-cache-login-module-checks" { } ''
|
||||
test ${lib.escapeShellArg (builtins.toJSON (builtins.hasAttr "netrc-file" homeDefault.config.nix.settings))} = ${lib.escapeShellArg "false"}
|
||||
test ${lib.escapeShellArg homeDefault.config.systemd.user.services.nix-cache-login.Service.ExecStart} = ${lib.escapeShellArg "${fakePackage}/bin/nix-cache-login refresh"}
|
||||
touch "$out"
|
||||
''
|
||||
Loading…
Add table
Add a link
Reference in a new issue