2020-04-22 16:55:02 -07:00
|
|
|
# default.nix --- the heart of my dotfiles
|
|
|
|
#
|
|
|
|
# Author: Henrik Lissner <henrik@lissner.net>
|
|
|
|
# URL: https://github.com/hlissner/dotfiles
|
|
|
|
# License: MIT
|
|
|
|
#
|
|
|
|
# This is ground zero, where the absolute essentials go, to be present on all
|
|
|
|
# systems I use nixos on. Most of which are single user systems (the ones that
|
|
|
|
# aren't are configured from their hosts/*/default.nix).
|
2019-08-06 10:56:54 -07:00
|
|
|
|
2020-04-06 20:06:47 -07:00
|
|
|
device: username:
|
2020-01-12 15:17:17 -08:00
|
|
|
{ pkgs, options, lib, config, ... }:
|
2019-08-06 10:56:54 -07:00
|
|
|
{
|
2020-01-13 16:56:39 -08:00
|
|
|
networking.hostName = lib.mkDefault device;
|
2020-04-12 18:02:37 -07:00
|
|
|
my.username = username;
|
2020-01-12 15:28:02 -08:00
|
|
|
|
2019-08-06 10:56:54 -07:00
|
|
|
imports = [
|
2020-03-28 22:48:43 -07:00
|
|
|
./modules
|
2020-01-17 01:22:50 -08:00
|
|
|
"${./hosts}/${device}"
|
2020-07-31 15:54:48 -07:00
|
|
|
] ++ (if builtins.pathExists(/etc/nixos/cachix.nix) then [
|
|
|
|
/etc/nixos/cachix.nix
|
|
|
|
] else []);
|
2019-08-06 10:56:54 -07:00
|
|
|
|
2020-01-17 01:22:50 -08:00
|
|
|
### NixOS
|
|
|
|
nix.autoOptimiseStore = true;
|
|
|
|
nix.nixPath = options.nix.nixPath.default ++ [
|
|
|
|
# So we can use absolute import paths
|
2020-02-01 18:05:55 -08:00
|
|
|
"bin=/etc/dotfiles/bin"
|
2020-01-17 01:22:50 -08:00
|
|
|
"config=/etc/dotfiles/config"
|
2020-01-13 14:29:00 -08:00
|
|
|
];
|
2020-04-06 20:07:06 -07:00
|
|
|
|
2020-03-28 22:48:43 -07:00
|
|
|
# Add custom packages & unstable channel, so they can be accessed via pkgs.*
|
2020-04-06 20:07:06 -07:00
|
|
|
nixpkgs.overlays = import ./packages;
|
2020-01-17 01:22:50 -08:00
|
|
|
nixpkgs.config.allowUnfree = true; # forgive me Stallman senpai
|
|
|
|
|
2020-04-12 18:02:37 -07:00
|
|
|
# These are the things I want installed on all my systems
|
2020-03-28 22:48:43 -07:00
|
|
|
environment.systemPackages = with pkgs; [
|
2020-04-06 20:07:06 -07:00
|
|
|
# Just the bear necessities~
|
|
|
|
coreutils
|
|
|
|
git
|
|
|
|
killall
|
|
|
|
unzip
|
|
|
|
vim
|
|
|
|
wget
|
|
|
|
sshfs
|
|
|
|
|
2020-03-28 22:48:43 -07:00
|
|
|
gnumake # for our own makefile
|
|
|
|
my.cached-nix-shell # for instant nix-shell scripts
|
2020-07-31 15:54:48 -07:00
|
|
|
cachix # less time buildin' mo time nixin'
|
|
|
|
(writeScriptBin "nix-shell" ''
|
|
|
|
#!${stdenv.shell}
|
|
|
|
NIX_PATH="nixpkgs-overlays=/etc/dotfiles/packages/default.nix:$NIX_PATH" ${nix}/bin/nix-shell "$@"
|
|
|
|
'')
|
2020-03-28 22:48:43 -07:00
|
|
|
];
|
2020-01-17 13:13:14 -08:00
|
|
|
environment.shellAliases = {
|
|
|
|
nix-env = "NIXPKGS_ALLOW_UNFREE=1 nix-env";
|
|
|
|
nsh = "nix-shell";
|
|
|
|
nen = "nix-env";
|
|
|
|
dots = "make -C ~/.dotfiles";
|
|
|
|
};
|
2020-01-13 14:29:00 -08:00
|
|
|
|
2020-04-22 16:55:02 -07:00
|
|
|
# Default settings for primary user account. `my` is defined in
|
|
|
|
# modules/default.nix
|
2020-04-06 20:06:47 -07:00
|
|
|
my.user = {
|
|
|
|
isNormalUser = true;
|
|
|
|
uid = 1000;
|
|
|
|
extraGroups = [ "wheel" "video" "networkmanager" ];
|
|
|
|
shell = pkgs.zsh;
|
|
|
|
};
|
|
|
|
|
2019-08-06 10:56:54 -07:00
|
|
|
# This value determines the NixOS release with which your system is to be
|
|
|
|
# compatible, in order to avoid breaking some software such as database
|
|
|
|
# servers. You should change this only after NixOS release notes say you
|
|
|
|
# should.
|
2020-04-22 16:52:48 -07:00
|
|
|
system.stateVersion = "20.03"; # Did you read the comment?
|
2019-08-06 10:56:54 -07:00
|
|
|
}
|