feat: move nixos-specific modules to their own module that is dynamically imported

This commit is contained in:
ahwx 2026-02-27 01:27:52 +01:00
parent 0ec2828d3e
commit 6bd255f636
2 changed files with 38 additions and 26 deletions

25
modules/core/nixos.nix Normal file
View file

@ -0,0 +1,25 @@
{
self,
pkgs,
lib,
inputs,
...
}:
{
nix = {
gc = {
automatic = true;
dates = "weekly";
options = "--delete-older-than 7d";
};
};
programs.nix-ld = {
enable = true;
libraries = with pkgs; [ ];
};
services.envfs.enable = true;
system.stateVersion = "24.05";
}

View file

@ -3,35 +3,30 @@
pkgs, pkgs,
lib, lib,
inputs, inputs,
system,
... ...
}: }:
{ {
imports =
(lib.optionals (system == "x64_64-linux") [ (import ./i18n.nix) ])
++ (lib.optionals (system == "aarch64-linux") [ (import ./i18n.nix) ])
++ (lib.optionals (system == "x64_64-linux") [ (import ./nixos.nix) ])
++ (lib.optionals (system == "aarch64-linux") [ (import ./nixos.nix) ]);
nix = { nix = {
settings = { settings = {
download-buffer-size = 67108864; # Set buffer size to 64MB for large downloads
allowed-users = [ "@wheel" ];
auto-optimise-store = true;
experimental-features = [ experimental-features = [
"nix-command" "nix-command"
"flakes" "flakes"
]; ];
download-buffer-size = 67108864; # Set buffer size to 64MB for large downloads
allowed-users = [ "@wheel" ];
# substituters = [ "http://violet.booping.local" ]; # substituters = [ "http://violet.booping.local" ];
# trusted-public-keys = [ "violet.booping.local:2gshN3xfGSL7eKFc8tGkqSoIb3WQxuB2RJ8DuakLLqc=%" ]; # trusted-public-keys = [ "violet.booping.local:2gshN3xfGSL7eKFc8tGkqSoIb3WQxuB2RJ8DuakLLqc=%" ];
}; };
gc = { optimise.automatic = true;
automatic = true;
dates = "weekly";
options = "--delete-older-than 7d";
};
}; };
programs.nix-ld = {
enable = true;
libraries = with pkgs; [ ];
};
services.envfs.enable = true;
nixpkgs = { nixpkgs = {
overlays = [ overlays = [
self.overlays.default self.overlays.default
@ -42,9 +37,9 @@
nixpkgs.config = { nixpkgs.config = {
allowUnfree = true; allowUnfree = true;
permittedInsecurePackages = [ permittedInsecurePackages = [
"jitsi-meet-1.0.8043" # "jitsi-meet-1.0.8043"
"olm-3.2.16" # "olm-3.2.16"
"libsoup-2.74.3" # "libsoup-2.74.3"
]; ];
overlays = [ overlays = [
self.overlays.default self.overlays.default
@ -53,8 +48,6 @@
]; ];
}; };
# powerManagement.cpuFreqGovernor = lib.mkDefault "powersave";
# Font packages # Font packages
environment.systemPackages = with pkgs; [ environment.systemPackages = with pkgs; [
noto-fonts-cjk-sans noto-fonts-cjk-sans
@ -62,14 +55,8 @@
ipaexfont ipaexfont
]; ];
i18n.defaultLocale = "en_US.UTF-8";
i18n.supportedLocales = [
"en_US.UTF-8/UTF-8"
"ja_JP.UTF-8/UTF-8"
];
time.timeZone = lib.mkDefault "Europe/Amsterdam"; time.timeZone = lib.mkDefault "Europe/Amsterdam";
environment.variables = { environment.variables = {
LC_TIME = "C.UTF-8"; LC_TIME = "C.UTF-8";
}; };
system.stateVersion = "24.05";
} }