2023-02-26 02:46:35 +01:00
|
|
|
{ config, pkgs, lib, inputs, ... }:
|
2023-02-25 04:39:30 +01:00
|
|
|
{
|
|
|
|
imports = [
|
2023-06-19 02:44:40 +02:00
|
|
|
./cachix.nix # update with `cachix use --mode nixos -d . FOOBAR`
|
2023-03-04 00:11:46 +01:00
|
|
|
./profiles/locale-no.nix
|
2023-03-12 05:14:28 +01:00
|
|
|
# results of 'nixos-generate-config'
|
|
|
|
# nice to have if i just dump this flake into /etc/nixos on a clean install
|
|
|
|
(if builtins.pathExists ./configuration.nix
|
|
|
|
then ./configuration.nix
|
|
|
|
else {}
|
|
|
|
)
|
2023-02-25 04:39:30 +01:00
|
|
|
(if builtins.pathExists ./hardware-configuration.nix
|
2023-03-12 05:14:28 +01:00
|
|
|
then ./hardware-configuration.nix
|
2023-02-25 04:39:30 +01:00
|
|
|
else {}
|
|
|
|
)
|
|
|
|
];
|
|
|
|
|
2023-06-24 19:11:49 +02:00
|
|
|
# TODO: selectively whitelist?
|
2023-02-25 04:39:30 +01:00
|
|
|
nixpkgs.config.allowUnfree = true;
|
|
|
|
nixpkgs.config.allowUnfreePredicate = (pkg: true);
|
2023-03-03 02:24:07 +01:00
|
|
|
nixpkgs.config.nonfreeLicensing = true; # used by ffmpeg
|
2023-02-25 04:39:30 +01:00
|
|
|
|
2023-06-24 19:11:49 +02:00
|
|
|
nix.settings.experimental-features = [
|
|
|
|
"nix-command"
|
|
|
|
"flakes"
|
2023-02-26 21:15:08 +01:00
|
|
|
];
|
2023-03-11 00:30:24 +01:00
|
|
|
nix.settings.allowed-users = [ "*" ]; # default
|
|
|
|
#nix.settings.allowed-users = [ "@nixbld" "@builders" ]; # TODO: this
|
|
|
|
nix.settings.trusted-users = [ "root" "@wheel" ];
|
2023-02-25 04:39:30 +01:00
|
|
|
nix.settings.auto-optimise-store = true; # deduplicate with hardlinks, expensive. Alternative: nix-store --optimise
|
|
|
|
#nix.optimize.automatic = true; # periodic optimization
|
|
|
|
nix.gc.automatic = true;
|
|
|
|
nix.gc.dates = "weekly";
|
|
|
|
nix.gc.options = "--delete-older-than 30d";
|
|
|
|
|
2023-06-24 19:11:49 +02:00
|
|
|
services.thermald.enable = lib.mkIf (config.nixpkgs.system == "x86_64-linux") true;
|
2023-02-25 04:39:30 +01:00
|
|
|
|
|
|
|
# firewall
|
|
|
|
services.fail2ban.enable = config.services.openssh.enable;
|
|
|
|
networking.firewall.enable = true; # default
|
|
|
|
}
|