-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdefault.nix
85 lines (69 loc) · 2.65 KB
/
default.nix
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
{ inputs, config, lib, pkgs, ... }:
with lib;
with lib.my;
{
# Import Home Manager NixOS Module and all modules under `./modules`.
imports = [
inputs.home-manager.nixosModules.home-manager
] ++ (mapModulesRec' import (toString ./modules));
# Where my custom binaries, configuration, and wallpapers are placed.
environment.variables.MY_NIXOS_BIN = "${config.my.dir}/bin";
environment.variables.MY_NIXOS_CONFIG = "${config.my.dir}";
environment.variables.MY_NIXOS_WALLS = "${config.my.dir}/wallpapers";
# Allow unfree packages from nixpkgs.
environment.variables.NIXPKGS_ALLOW_UNFREE = "1";
# Enable Nix Flakes.
nix.package = pkgs.nixStable;
nix.extraOptions = ''
experimental-features = nix-command flakes
'';
# Set Nix store auto-optimization.
nix.settings.auto-optimise-store = true;
# Specify the kernel version to use.
boot.kernelPackages = mkDefault pkgs.linuxPackages;
# Use the systemd-boot EFI boot loader.
boot.loader.systemd-boot.enable = mkDefault true;
boot.loader.efi.canTouchEfiVariables = mkDefault true;
# Limit the number of generations to prevent the boot partition running out
# of space.
boot.loader.systemd-boot.configurationLimit = mkDefault 20;
# Install some basic packages in the system profile.
environment.systemPackages = with pkgs; [
git
gnumake
pciutils
psmisc
unzip
vim
wget
linux-manual
man-pages
man-pages-posix
# Set https://github.com/uutils/coreutils as a replacement of the original
# GNU coreutils.
(uutils-coreutils.override { prefix = ""; })
(let base = pkgs.appimageTools.defaultFhsEnvArgs; in
pkgs.buildFHSUserEnv (base // {
name = "fhs";
targetPkgs = pkgs: (
(base.targetPkgs pkgs) ++ [ pkgs.pkg-config pkgs.ncurses ]
);
profile = "export FHS=1";
runScript = "bash";
extraOutputsToInstall = [ "dev" ];
}))
];
documentation.dev.enable = true;
# Set the configurationRevision to the Git revision of this repository.
#
# TODO: maybe set it to be mandatory and throw an error if the Git tree is
# dirty.
system.configurationRevision = with inputs; mkIf (self ? rev) self.rev;
# This value determines the NixOS release from which the default
# settings for stateful data, like file locations and database versions
# on your system were taken. It‘s perfectly fine and recommended to leave
# this value at the release version of the first install of this system.
# Before changing this value read the documentation for this option
# (e.g. man configuration.nix or on https://nixos.org/nixos/options.html).
system.stateVersion = "21.05"; # Did you read the comment?
}