-
Notifications
You must be signed in to change notification settings - Fork 0
/
default.nix
92 lines (82 loc) · 2.81 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
86
87
88
89
90
91
92
{ inputs, config, lib, pkgs, ... }:
with lib;
with lib.my;
{
imports =
# I use home-manager to deploy files to $HOME; little else
[ inputs.home-manager.nixosModules.home-manager ]
# All my personal modules
++ (mapModulesRec' (toString ./modules) import);
# Common config for all nixos machines; and to ensure the flake operates
# soundly
environment.variables.DOTFILES = config.dotfiles.dir;
environment.variables.DOTFILES_BIN = config.dotfiles.binDir;
# Configure nix and nixpkgs
environment.variables.NIXPKGS_ALLOW_UNFREE = "1";
hardware.enableRedistributableFirmware = true;
nix =
let filteredInputs = filterAttrs (n: _: n != "self") inputs;
nixPathInputs = mapAttrsToList (n: v: "${n}=${v}") filteredInputs;
registryInputs = mapAttrs (_: v: { flake = v; }) filteredInputs;
in {
package = pkgs.nixVersions.stable;
extraOptions = "experimental-features = nix-command flakes";
nixPath = nixPathInputs ++ [
"nixpkgs-overlays=${config.dotfiles.dir}/overlays"
"dotfiles=${config.dotfiles.dir}"
];
registry = registryInputs // { dotfiles.flake = inputs.self; };
settings = {
substituters = [
"https://cache.nixos.org"
"https://nix-community.cachix.org"
];
trusted-public-keys = [
"cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY="
"nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="
];
auto-optimise-store = true;
};
};
system.configurationRevision = with inputs; mkIf (self ? rev) self.rev;
system.stateVersion = "21.05";
## Some reasonable, global defaults
# This is here to appease 'nix flake check' for generic hosts with no
# hardware-configuration.nix or fileSystem config.
fileSystems."/".device = mkDefault "/dev/disk/by-label/nixos";
# The global useDHCP flag is deprecated, therefore explicitly set to false
# here. Per-interface useDHCP will be mandatory in the future, so we enforce
# this default behavior here.
networking.useDHCP = mkDefault false;
# Ensure we always have nmtui/nmcli
networking.networkmanager.enable = true;
user.extraGroups = [ "networkmanager" ];
# Use the latest kernel
boot = {
kernelPackages = mkDefault pkgs.linuxPackages_latest;
loader = {
efi.canTouchEfiVariables = mkDefault true;
systemd-boot.configurationLimit = 10;
systemd-boot.enable = mkDefault true;
};
};
# Just the bear necessities...
environment.systemPackages = with pkgs; [
bind
cached-nix-shell
git
gnumake
unzip
vim
# Basic tools for backup and restore
borgbackup
rclone
kbd
];
# Console setup
console.font = "ter-i32b";
console.packages = with pkgs; [
terminus_font
];
console.keyMap = "mod-dh-ansi-us";
}