mirror of
https://github.com/divnix/digga.git
synced 2024-12-23 16:11:51 +03:00
cachix: move out of root and into profile
This commit is contained in:
parent
2d91946745
commit
fbce126f4d
@ -1,8 +1,13 @@
|
||||
# Cachix
|
||||
The cachix directory simple captures the output of `sudo cachix use` for the
|
||||
developers personal cache, as well as the nix-community cache. You can easily
|
||||
add your own cache, assuming the template lives in /etc/nixos, by simply
|
||||
running `sudo cachix use yourcache`.
|
||||
The system will automatically pull a cachix.nix at the root if one exists.
|
||||
This is usually created automatically by a `sudo cachix use`. If your more
|
||||
inclined to keep the root clean, you can drop any generated files in the
|
||||
`cachix` directory into the `profiles/cachix` directory without further
|
||||
modification.
|
||||
|
||||
For example, to add your own cache, assuming the template lives in /etc/nixos,
|
||||
by simply running `sudo cachix use yourcache`. Then, optionally, move
|
||||
`cachix/yourcache.nix` to `profiles/cachix/yourcache.nix`
|
||||
|
||||
These caches are only added to the system after a `nixos-rebuild switch`, so it
|
||||
is recommended to call `cachix use nrdxp` before the initial deployment, as it
|
||||
|
@ -63,7 +63,11 @@ let
|
||||
# Everything in `./modules/list.nix`.
|
||||
flakeModules = { imports = builtins.attrValues self.nixosModules ++ extern.modules; };
|
||||
|
||||
cachix = ../../cachix.nix;
|
||||
cachix = let rootCachix = ../../cachix.nix; in
|
||||
if builtins.pathExists rootCachix
|
||||
then rootCachix
|
||||
else { }
|
||||
;
|
||||
};
|
||||
|
||||
specialArgs = extern.specialArgs // { suites = suites.system; };
|
||||
|
@ -1,9 +1,8 @@
|
||||
# WARN: this file will get overwritten by $ cachix use <name>
|
||||
{ pkgs, lib, ... }:
|
||||
let
|
||||
folder = ./cachix;
|
||||
folder = ./.;
|
||||
toImport = name: value: folder + ("/" + name);
|
||||
filterCaches = key: value: value == "regular" && lib.hasSuffix ".nix" key;
|
||||
filterCaches = key: value: value == "regular" && lib.hasSuffix ".nix" key && key != "default.nix";
|
||||
imports = lib.mapAttrsToList toImport (lib.filterAttrs filterCaches (builtins.readDir folder));
|
||||
in
|
||||
{
|
@ -2,6 +2,7 @@
|
||||
let inherit (lib) fileContents;
|
||||
in
|
||||
{
|
||||
imports = [ ../cachix ];
|
||||
|
||||
nix.systemFeatures = [ "nixos-test" "benchmark" "big-parallel" "kvm" ];
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user