mirror of
https://github.com/Swarsel/.dotfiles.git
synced 2025-12-06 09:07:21 +01:00
feat: update nix config module
This commit is contained in:
parent
a11c7854d1
commit
6b33a182d8
11 changed files with 167 additions and 239 deletions
|
|
@ -1,12 +0,0 @@
|
|||
{ lib, config, ... }:
|
||||
{
|
||||
options.swarselsystems.modules.gc = lib.mkEnableOption "garbage collection config";
|
||||
config = lib.mkIf config.swarselsystems.modules.gc {
|
||||
nix.gc = {
|
||||
automatic = true;
|
||||
randomizedDelaySec = "14m";
|
||||
dates = "weekly";
|
||||
options = "--delete-older-than 10d";
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
{ lib, config, outputs, inputs, ... }:
|
||||
{ lib, pkgs, config, outputs, inputs, ... }:
|
||||
{
|
||||
options.swarselsystems.modules.general = lib.mkEnableOption "general nix settings";
|
||||
config = lib.mkIf config.swarselsystems.modules.general {
|
||||
|
|
@ -9,6 +9,11 @@
|
|||
};
|
||||
};
|
||||
|
||||
environment.etc."nixos/configuration.nix".source = pkgs.writeText "configuration.nix" ''
|
||||
assert builtins.trace "This location is not used. The config is found in ${config.swarselsystems.flakePath}!" false;
|
||||
{ }
|
||||
'';
|
||||
|
||||
nix =
|
||||
let
|
||||
flakeInputs = lib.filterAttrs (_: lib.isType "flake") inputs;
|
||||
|
|
@ -35,11 +40,24 @@
|
|||
max-jobs = 1;
|
||||
use-cgroups = lib.mkIf config.swarselsystems.isLinux true;
|
||||
};
|
||||
gc = {
|
||||
automatic = true;
|
||||
dates = "weekly";
|
||||
options = "--delete-older-than 10d";
|
||||
};
|
||||
optimise = {
|
||||
automatic = true;
|
||||
dates = "weekly";
|
||||
};
|
||||
channel.enable = false;
|
||||
registry = lib.mapAttrs (_: flake: { inherit flake; }) flakeInputs;
|
||||
registry = rec {
|
||||
nixpkgs.flake = inputs.nixpkgs;
|
||||
p = nixpkgs;
|
||||
};
|
||||
nixPath = lib.mapAttrsToList (n: _: "${n}=flake:${n}") flakeInputs;
|
||||
};
|
||||
|
||||
services.dbus.implementation = "broker";
|
||||
system.stateVersion = lib.mkDefault "23.05";
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,10 +0,0 @@
|
|||
{ lib, config, ... }:
|
||||
{
|
||||
options.swarselsystems.modules.storeOptimize = lib.mkEnableOption "store optimization config";
|
||||
config = lib.mkIf config.swarselsystems.modules.storeOptimize {
|
||||
nix.optimise = {
|
||||
automatic = true;
|
||||
dates = [ "weekly" ];
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
@ -9,8 +9,6 @@ in
|
|||
"${modulesPath}/nixos/common/home-manager.nix"
|
||||
"${modulesPath}/nixos/common/home-manager-extra.nix"
|
||||
"${modulesPath}/nixos/common/xserver.nix"
|
||||
"${modulesPath}/nixos/common/gc.nix"
|
||||
"${modulesPath}/nixos/common/store.nix"
|
||||
"${modulesPath}/nixos/common/time.nix"
|
||||
"${modulesPath}/nixos/common/users.nix"
|
||||
"${modulesPath}/nixos/common/nix-ld.nix"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue