nixos-configuration/modules/nixpkgs.nix

43 lines
1,012 B
Nix
Raw Normal View History

2023-10-02 18:14:05 +02:00
{
config,
lib,
...
}: let
2023-10-02 17:14:20 +02:00
unstable-commit-sha = "f5892ddac112a1e9b3612c39af1b72987ee5783a";
in {
2023-10-02 18:14:05 +02:00
options.my.allowUnfreePackages = lib.mkOption {
type = lib.types.listOf lib.types.str;
default = [];
example = ["steam"];
};
2023-09-09 15:44:15 +02:00
config = {
2023-10-02 17:14:20 +02:00
nixpkgs.config = {
# make nixos-unstable availiable as 'pkgs.unstable'
packageOverrides = pkgs: {
unstable = import (fetchTarball "https://github.com/nixos/nixpkgs/tarball/${unstable-commit-sha}") {
config = config.nixpkgs.config;
};
};
2023-10-02 18:14:05 +02:00
# https://github.com/NixOS/nixpkgs/issues/197325#issuecomment-1579420085
allowUnfreePredicate = pkg: builtins.elem (lib.getName pkg) config.my.allowUnfreePackages;
2023-10-02 17:14:20 +02:00
};
2023-09-09 15:44:15 +02:00
system = {
stateVersion = "22.11";
# enable auto updates
2023-09-17 15:20:18 +02:00
autoUpgrade = {
enable = true;
dates = "weekly";
};
2023-09-09 15:44:15 +02:00
};
nix.gc = {
automatic = true;
2023-09-17 15:20:18 +02:00
dates = "monthly";
options = "--delete-older-than 30d";
2023-09-09 15:44:15 +02:00
};
};
}