Make local cache configurable
This commit is contained in:
@@ -3,6 +3,10 @@ let
|
|||||||
username = "gregory.hellings";
|
username = "gregory.hellings";
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
|
greg = {
|
||||||
|
nix.cache = false;
|
||||||
|
};
|
||||||
|
|
||||||
homebrew = {
|
homebrew = {
|
||||||
enable = true;
|
enable = true;
|
||||||
brews = [
|
brews = [
|
||||||
@@ -12,7 +16,9 @@ in
|
|||||||
name = "libvirt";
|
name = "libvirt";
|
||||||
restart_service = true;
|
restart_service = true;
|
||||||
}
|
}
|
||||||
|
"mysql"
|
||||||
"nushell"
|
"nushell"
|
||||||
|
"poetry"
|
||||||
"qemu"
|
"qemu"
|
||||||
];
|
];
|
||||||
casks = [
|
casks = [
|
||||||
@@ -22,15 +28,14 @@ in
|
|||||||
"chromium"
|
"chromium"
|
||||||
"firefox"
|
"firefox"
|
||||||
"microsoft-teams"
|
"microsoft-teams"
|
||||||
"mysql"
|
|
||||||
"onlyoffice"
|
"onlyoffice"
|
||||||
"pgadmin4"
|
"pgadmin4"
|
||||||
"poetry"
|
|
||||||
"tabby"
|
"tabby"
|
||||||
"twine"
|
"twine"
|
||||||
"vagrant"
|
"vagrant"
|
||||||
"visual-studio-code"
|
"visual-studio-code"
|
||||||
"zed"
|
"zed"
|
||||||
|
"zoho-workdrive"
|
||||||
];
|
];
|
||||||
user = username;
|
user = username;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -14,9 +14,6 @@ let
|
|||||||
[ ];
|
[ ];
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
# This is a dumb hack to pass the value into the import below, but it's how we have to do it,
|
|
||||||
# since that's how the module system works
|
|
||||||
_module.args.cache = true;
|
|
||||||
imports = [
|
imports = [
|
||||||
./nix-conf.nix
|
./nix-conf.nix
|
||||||
];
|
];
|
||||||
|
|||||||
+14
-2
@@ -1,11 +1,22 @@
|
|||||||
{
|
{
|
||||||
pkgs,
|
pkgs,
|
||||||
lib,
|
lib,
|
||||||
cache,
|
config,
|
||||||
...
|
...
|
||||||
}:
|
}:
|
||||||
|
|
||||||
|
let
|
||||||
|
cfg = config.greg.nix;
|
||||||
|
in
|
||||||
{
|
{
|
||||||
|
options.greg.nix = {
|
||||||
|
cache = lib.mkOption {
|
||||||
|
type = lib.types.bool;
|
||||||
|
default = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
config = {
|
||||||
nix = {
|
nix = {
|
||||||
gc = {
|
gc = {
|
||||||
automatic = true;
|
automatic = true;
|
||||||
@@ -29,7 +40,7 @@
|
|||||||
"gregory.hellings"
|
"gregory.hellings"
|
||||||
]; # For home and for work machines
|
]; # For home and for work machines
|
||||||
substituters =
|
substituters =
|
||||||
(lib.optionals cache [
|
(lib.optionals cfg.cache [
|
||||||
"http://nas.thehellings.lan:9000/binary-cache/"
|
"http://nas.thehellings.lan:9000/binary-cache/"
|
||||||
"http://nas.home:9000/binary-cache/"
|
"http://nas.home:9000/binary-cache/"
|
||||||
])
|
])
|
||||||
@@ -57,4 +68,5 @@
|
|||||||
allowUnfreePredicate = _: true;
|
allowUnfreePredicate = _: true;
|
||||||
permittedInsecurePackages = [ "ventoy-1.1.05" ];
|
permittedInsecurePackages = [ "ventoy-1.1.05" ];
|
||||||
};
|
};
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user