nixos-configuration/modules/nixpkgs.nix

80 lines
2.5 KiB
Nix
Raw Normal View History

2023-10-02 18:14:05 +02:00
{
config,
lib,
...
}: let
2024-03-09 17:56:02 +01:00
unstable-commit-sha = "9df3e30ce24fd28c7b3e2de0d986769db5d6225d";
ultrastable-commit-sha = "2be119add7b37dc535da2dd4cba68e2cf8d1517e";
2023-10-02 17:14:20 +02:00
in {
2023-10-02 18:14:05 +02:00
options.my.allowUnfreePackages = lib.mkOption {
type = lib.types.listOf lib.types.str;
default = [];
example = ["steam"];
};
2024-07-21 14:00:10 +02:00
imports = [
# this switches the nix implementation to lix everywhere, but means recompiling lix every build.
# https://lix.systems/add-to-config/
(let
module = fetchTarball {
name = "source";
url = "https://git.lix.systems/lix-project/nixos-module/archive/2.90.0.tar.gz";
sha256 = "sha256-yEO2cGNgzm9x/XxiDQI+WckSWnZX63R8aJLBRSXtYNE=";
};
lixSrc = fetchTarball {
name = "source";
url = "https://git.lix.systems/lix-project/lix/archive/2.90.0.tar.gz";
sha256 = "sha256-f8k+BezKdJfmE+k7zgBJiohtS3VkkriycdXYsKOm3sc=";
};
in import "${module}/module.nix" { lix = lixSrc; }
)
];
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;
};
ultrastable = import (fetchTarball "https://github.com/nixos/nixpkgs/tarball/${ultrastable-commit-sha}") {
config = config.nixpkgs.config;
};
2023-10-02 17:14:20 +02:00
};
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
2023-10-31 14:43:00 +01:00
nix = {
settings = {
substituters = ["https://nix-community.cachix.org" "https://cache.nixos.org/"];
trusted-public-keys = ["nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="];
};
};
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;
2024-03-02 13:11:01 +01:00
dates = "daily";
options = "--delete-older-than 7d";
2023-09-09 15:44:15 +02:00
};
2023-10-08 17:17:14 +02:00
documentation = {
enable = true; # documentation of packages
nixos.enable = false; # nixos documentation
man.enable = true; # manual pages and the man command
info.enable = false; # info pages and the info command
doc.enable = false; # documentation distributed in packages' /share/doc
};
2023-09-09 15:44:15 +02:00
};
}