mirror of
https://github.com/oddlama/nix-config.git
synced 2025-10-10 23:00:39 +02:00
chore: auto optimize biweekly; delete generations older than 90d; use single-definition for stateVersion
This commit is contained in:
parent
4cee692eff
commit
e2e2c2a757
8 changed files with 22 additions and 26 deletions
|
@ -86,6 +86,8 @@
|
|||
content = import ./nix/secrets.nix inputs;
|
||||
};
|
||||
|
||||
stateVersion = "23.05";
|
||||
|
||||
hosts = {
|
||||
nom = {
|
||||
type = "nixos";
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
{
|
||||
inputs,
|
||||
pkgs,
|
||||
stateVersion,
|
||||
...
|
||||
}: {
|
||||
environment.etc."nixos/configuration.nix".source = pkgs.writeText "configuration.nix" ''
|
||||
|
@ -32,12 +33,14 @@
|
|||
builders-use-substitutes = true
|
||||
experimental-features = nix-command flakes recursive-nix
|
||||
flake-registry = /etc/nix/registry.json
|
||||
plugin-files = ${pkgs.nix-plugins}/lib/nix/plugins
|
||||
extra-builtins-file = ${../../../nix/extra-builtins.nix}
|
||||
'';
|
||||
nixPath = ["nixpkgs=/run/current-system/nixpkgs"];
|
||||
optimise.automatic = true;
|
||||
gc.automatic = true;
|
||||
gc = {
|
||||
automatic = true;
|
||||
dates = "biweekly";
|
||||
options = "--delete-older-than 90d";
|
||||
};
|
||||
# Define global flakes for this system
|
||||
registry = {
|
||||
nixpkgs.flake = inputs.nixpkgs;
|
||||
|
@ -51,6 +54,6 @@
|
|||
extraSystemBuilderCmds = ''
|
||||
ln -sv ${pkgs.path} $out/nixpkgs
|
||||
'';
|
||||
stateVersion = "23.05";
|
||||
inherit stateVersion;
|
||||
};
|
||||
}
|
||||
|
|
|
@ -1,5 +1,8 @@
|
|||
{
|
||||
imports = [./documentation.nix];
|
||||
imports = [
|
||||
./documentation.nix
|
||||
./nix.nix
|
||||
];
|
||||
|
||||
environment.enableDebugInfo = true;
|
||||
}
|
||||
|
|
6
hosts/common/dev/nix.nix
Normal file
6
hosts/common/dev/nix.nix
Normal file
|
@ -0,0 +1,6 @@
|
|||
{pkgs, ...}: {
|
||||
nix.extraOptions = ''
|
||||
plugin-files = ${pkgs.nix-plugins}/lib/nix/plugins
|
||||
extra-builtins-file = ${../../../nix/extra-builtins.nix}
|
||||
'';
|
||||
}
|
|
@ -1,18 +0,0 @@
|
|||
{pkgs, ...}: {
|
||||
environment.systemPackages = with pkgs; [virt-manager spice-gtk swtpm];
|
||||
security.polkit.enable = true;
|
||||
virtualisation = {
|
||||
libvirtd = {
|
||||
enable = true;
|
||||
qemu = {
|
||||
package = pkgs.qemu_kvm;
|
||||
ovmf = {
|
||||
enable = true;
|
||||
packages = with pkgs; [OVMFFull.fd];
|
||||
};
|
||||
swtpm.enable = true;
|
||||
};
|
||||
};
|
||||
spiceUSBRedirection.enable = true;
|
||||
};
|
||||
}
|
|
@ -26,7 +26,7 @@
|
|||
'';
|
||||
in {
|
||||
isoImage.isoName = lib.mkForce "nixos-image-${nodeName}.iso";
|
||||
system.stateVersion = "23.05";
|
||||
system.stateVersion = self.stateVersion;
|
||||
nix.extraOptions = ''
|
||||
experimental-features = nix-command flakes recursive-nix
|
||||
'';
|
||||
|
|
|
@ -19,7 +19,7 @@ in
|
|||
pkgs = self.pkgs.${nodeMeta.system};
|
||||
specialArgs = {
|
||||
inherit (nixpkgs) lib;
|
||||
inherit (self) extraLib nodes;
|
||||
inherit (self) extraLib nodes stateVersion;
|
||||
inherit inputs;
|
||||
inherit nodeName;
|
||||
secrets = self.secrets.content;
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
];
|
||||
|
||||
home = {
|
||||
stateVersion = "23.05";
|
||||
inherit stateVersion;
|
||||
packages = with pkgs; [
|
||||
bandwhich
|
||||
btop
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue