2020-10-26 02:48:12 -07:00
|
|
|
{ inputs, config, lib, pkgs, ... }:
|
|
|
|
|
|
|
|
with lib;
|
|
|
|
with lib.my;
|
|
|
|
{
|
|
|
|
imports =
|
|
|
|
# I use home-manager to deploy files to $HOME; little else
|
2021-01-19 22:28:30 -08:00
|
|
|
[ inputs.home-manager.nixosModules.home-manager ]
|
2020-10-26 02:48:12 -07:00
|
|
|
# All my personal modules
|
|
|
|
++ (mapModulesRec' (toString ./modules) import);
|
|
|
|
|
|
|
|
# Common config for all nixos machines; and to ensure the flake operates
|
|
|
|
# soundly
|
|
|
|
environment.variables.DOTFILES = dotFilesDir;
|
|
|
|
|
|
|
|
# Configure nix and nixpkgs
|
|
|
|
environment.variables.NIXPKGS_ALLOW_UNFREE = "1";
|
2021-01-19 22:28:30 -08:00
|
|
|
nix =
|
|
|
|
let filteredInputs = filterAttrs (n: _: n != "self") inputs;
|
|
|
|
nixPathInputs = mapAttrsToList (n: v: "${n}=${v}") filteredInputs;
|
|
|
|
registryInputs = mapAttrs (_: v: { flake = v; }) filteredInputs;
|
|
|
|
in {
|
|
|
|
package = pkgs.nixFlakes;
|
|
|
|
extraOptions = "experimental-features = nix-command flakes";
|
|
|
|
nixPath = nixPathInputs ++ [
|
|
|
|
"nixpkgs-overlays=${dotFilesDir}/overlays"
|
|
|
|
"dotfiles=${dotFilesDir}"
|
|
|
|
];
|
|
|
|
binaryCaches = [
|
|
|
|
"https://nix-community.cachix.org"
|
|
|
|
];
|
|
|
|
binaryCachePublicKeys = [
|
|
|
|
"nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="
|
|
|
|
];
|
|
|
|
registry = registryInputs // { dotfiles.flake = inputs.self; };
|
|
|
|
useSandbox = true;
|
2020-10-26 02:48:12 -07:00
|
|
|
};
|
2021-01-19 22:28:30 -08:00
|
|
|
system.configurationRevision = with inputs; mkIf (self ? rev) self.rev;
|
2021-02-01 21:33:23 -08:00
|
|
|
system.stateVersion = "21.03";
|
2020-10-26 02:48:12 -07:00
|
|
|
|
|
|
|
|
|
|
|
## Some reasonable, global defaults
|
|
|
|
# This is here to appease 'nix flake check' for generic hosts with no
|
|
|
|
# hardware-configuration.nix or fileSystem config.
|
2020-12-31 16:34:11 -08:00
|
|
|
fileSystems."/".device = mkDefault "/dev/disk/by-label/nixos";
|
2020-10-26 02:48:12 -07:00
|
|
|
|
|
|
|
# Use the latest kernel
|
2021-02-20 19:50:43 -08:00
|
|
|
boot = {
|
|
|
|
kernelPackages = mkDefault pkgs.linuxPackages_5_10;
|
|
|
|
loader = {
|
|
|
|
efi.canTouchEfiVariables = mkDefault true;
|
|
|
|
systemd-boot.configurationLimit = 10;
|
|
|
|
systemd-boot.enable = mkDefault true;
|
|
|
|
};
|
2020-10-26 02:48:12 -07:00
|
|
|
};
|
|
|
|
|
|
|
|
# Just the bear necessities...
|
|
|
|
environment.systemPackages = with pkgs; [
|
2021-01-30 01:41:31 -08:00
|
|
|
bind
|
2020-10-29 22:39:45 -07:00
|
|
|
cached-nix-shell
|
2020-10-26 02:48:12 -07:00
|
|
|
coreutils
|
|
|
|
git
|
|
|
|
vim
|
|
|
|
wget
|
|
|
|
gnumake
|
2020-12-21 19:37:22 -08:00
|
|
|
unzip
|
2020-10-26 02:48:12 -07:00
|
|
|
];
|
|
|
|
}
|