summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--templates/default.nix4
-rw-r--r--templates/nixos/modules/basic.nix13
2 files changed, 11 insertions, 6 deletions
diff --git a/templates/default.nix b/templates/default.nix
index 30c5a5d..6ea1be4 100644
--- a/templates/default.nix
+++ b/templates/default.nix
@@ -1,9 +1,9 @@
-{self, ...}: {
+{
flake = {
templates = let
# string -> string -> {}
mkTemplate = name: description: {
- path = "${self}/templates/${name}";
+ path = ./${name};
inherit description;
};
in {
diff --git a/templates/nixos/modules/basic.nix b/templates/nixos/modules/basic.nix
index c1b5ebc..f1f7a81 100644
--- a/templates/nixos/modules/basic.nix
+++ b/templates/nixos/modules/basic.nix
@@ -5,7 +5,7 @@
...
}: let
inherit (builtins) attrNames map;
- inherit (lib) mkDefault mkEnableOption mkIf mkOption types;
+ inherit (lib) filterAttrs mapAttrs mkDefault mkEnableOption mkIf mkOption types;
cfg = config.getchoo.basicConfig;
mapInputs = fn: map fn (attrNames inputs);
@@ -28,15 +28,20 @@ in {
nix = {
gc = {
automatic = mkDefault true;
- options = mkDefault "-d --delete-older-then 2d";
+ options = mkDefault "-d --delete-older-than 2d";
};
+ nixPath = mapInputs (i: "${i}=${cfg.channelPath.dirname i}");
+
+ registry =
+ {n.flake = inputs.nixpkgs;}
+ // (mapAttrs (_: flake: {inherit flake;})
+ (filterAttrs (n: _: n != "nixpkgs") inputs));
+
settings = {
auto-optimise-store = true;
experimental-features = ["nix-command" "flakes" "auto-allocate-uids" "repl-flake"];
};
-
- nixPath = mapInputs (i: "${i}=${cfg.channelPath.dirname i}");
};
systemd.tmpfiles.rules = mapInputs (i: "L+ ${cfg.channelPath i} - - - - ${inputs.${i}.outPath}");