Major refactor
This commit is contained in:
parent
740046f3f0
commit
c7e6da3f73
9
Makefile
9
Makefile
|
@ -1,8 +1,9 @@
|
|||
NIXOS_VERSION := 19.09
|
||||
NIXOS_PREFIX := $(PREFIX)/etc/nixos
|
||||
|
||||
FLAGS := -I "my=$(PWD)" $(FLAGS)
|
||||
COMMAND := test
|
||||
FLAGS := -I "nixpkgs-overlays=$$(pwd)/overlays.nix" \
|
||||
-I "config=$$(pwd)/config" \
|
||||
-I "modules=$$(pwd)/modules" $(FLAGS)
|
||||
|
||||
# The real Labowski
|
||||
all: channels
|
||||
|
@ -36,7 +37,7 @@ channels:
|
|||
|
||||
$(NIXOS_PREFIX)/configuration.nix:
|
||||
@sudo nixos-generate-config --root "$(PREFIX)"
|
||||
@echo "import $(PWD)/dotfiles \"$(HOST)\"" | sudo tee "$(NIXOS_PREFIX)/configuration.nix"
|
||||
@echo "(import /etc/dotfiles \"$$(hostname)\")" | sudo tee "$(NIXOS_PREFIX)/configuration.nix"
|
||||
|
||||
|
||||
# Convenience aliases
|
||||
|
@ -45,4 +46,4 @@ s: switch
|
|||
up: upgrade
|
||||
|
||||
|
||||
.PHONY: update config channels test upgrade install
|
||||
.PHONY: config
|
||||
|
|
|
@ -1,8 +1,5 @@
|
|||
export ZGEN_DIR="$XDG_CACHE_HOME/zgen"
|
||||
export ZGEN_SOURCE="$ZGEN_DIR/zgen.zsh"
|
||||
|
||||
## TODO
|
||||
source $ZDOTDIR/extra.zshenv
|
||||
## Auto-generated by my nix config
|
||||
[ -f "${0:a:h}/extra.zshenv" ] && source "${0:a:h}/extra.zshenv"
|
||||
|
||||
# If you have host-local configuration, this is where you'd put it
|
||||
[ -f ~/.zshenv ] && source ~/.zshenv
|
||||
|
|
|
@ -1,26 +1,21 @@
|
|||
[ -d "$ZGEN_DIR" ] || \
|
||||
git clone https://github.com/tarjoilija/zgen "$ZGEN_DIR"
|
||||
source $ZGEN_SOURCE
|
||||
export ZGEN_DIR="$XDG_CACHE_HOME/zgen"
|
||||
export ZGEN_SOURCE="$ZGEN_DIR/zgen.zsh"
|
||||
|
||||
[ -d "$ZGEN_DIR" ] || git clone https://github.com/tarjoilija/zgen "$ZGEN_DIR"
|
||||
source $ZGEN_SOURCE
|
||||
if ! zgen saved; then
|
||||
echo "Initializing zgen"
|
||||
|
||||
zgen load hlissner/zsh-autopair autopair.zsh
|
||||
zgen load zsh-users/zsh-history-substring-search
|
||||
zgen load zdharma/history-search-multi-word
|
||||
zgen load zsh-users/zsh-completions src
|
||||
zgen load junegunn/fzf shell
|
||||
|
||||
if [ -z "$SSH_CONNECTION" ]; then
|
||||
zgen load zdharma/fast-syntax-highlighting
|
||||
fi
|
||||
|
||||
[ -z "$SSH_CONNECTION" ] && zgen load zdharma/fast-syntax-highlighting
|
||||
zgen save
|
||||
fi
|
||||
|
||||
source $ZDOTDIR/config.zsh
|
||||
if [[ $TERM != dumb ]]; then
|
||||
source $ZDOTDIR/prompt.zsh
|
||||
source $ZDOTDIR/keybinds.zsh
|
||||
source $ZDOTDIR/completion.zsh
|
||||
source $ZDOTDIR/aliases.zsh
|
||||
|
@ -47,7 +42,7 @@ if [[ $TERM != dumb ]]; then
|
|||
fi
|
||||
_cache fasd --init posix-alias zsh-{hook,{c,w}comp{,-install}}
|
||||
|
||||
## TODO
|
||||
## Auto-generated by my nix config
|
||||
source $ZDOTDIR/extra.zshrc
|
||||
|
||||
##
|
||||
|
|
48
default.nix
48
default.nix
|
@ -1,4 +1,4 @@
|
|||
# ...
|
||||
# default.nix --- my dotfile bootstrapper
|
||||
|
||||
device:
|
||||
{ pkgs, options, lib, config, ... }:
|
||||
|
@ -6,39 +6,27 @@ device:
|
|||
networking.hostName = lib.mkDefault device;
|
||||
|
||||
imports = [
|
||||
<nixpkgs/nixos/modules/installer/scan/not-detected.nix>
|
||||
/etc/nixos/hardware-configuration.nix
|
||||
|
||||
./options/my.nix
|
||||
"${./machines}/${device}.nix"
|
||||
./options.nix
|
||||
"${./hosts}/${device}"
|
||||
];
|
||||
|
||||
###
|
||||
nix = {
|
||||
nixPath = options.nix.nixPath.default ++ [
|
||||
"my=/etc/dotfiles"
|
||||
### NixOS
|
||||
nix.autoOptimiseStore = true;
|
||||
nix.nixPath = options.nix.nixPath.default ++ [
|
||||
# So we can use absolute import paths
|
||||
"config=/etc/dotfiles/config"
|
||||
"modules=/etc/dotfiles/modules"
|
||||
# We define nixpkgs-overlays so our overlays will be available to
|
||||
# nix-shell/nix-build outside of rebuilding...
|
||||
"nixpkgs-overlays=/etc/dotfiles/overlays.nix"
|
||||
];
|
||||
autoOptimiseStore = true;
|
||||
trustedUsers = [ "root" ];
|
||||
};
|
||||
# ...but we still need to set nixpkgs.overlays to make them visible to the
|
||||
# rebuild process, however...
|
||||
nixpkgs.overlays = import ./overlays.nix;
|
||||
nixpkgs.config.allowUnfree = true; # forgive me Stallman senpai
|
||||
|
||||
nixpkgs.config = {
|
||||
allowUnfree = true; # forgive me Stallman senpai
|
||||
# Occasionally, "stable" packages are broken or incomplete, so access to the
|
||||
# bleeding edge is necessary, as a last resort.
|
||||
packageOverrides = pkgs: {
|
||||
unstable = import <nixpkgs-unstable> {
|
||||
config = config.nixpkgs.config;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
environment.systemPackages = with pkgs; [
|
||||
# cached-nix-shell, for instant nix-shell scripts
|
||||
(callPackage
|
||||
(builtins.fetchTarball
|
||||
https://github.com/xzfc/cached-nix-shell/archive/master.tar.gz) {})
|
||||
];
|
||||
# For instant nix-shell scripts
|
||||
environment.systemPackages = [ pkgs.my.cached-nix-shell ];
|
||||
|
||||
# This value determines the NixOS release with which your system is to be
|
||||
# compatible, in order to avoid breaking some software such as database
|
||||
|
|
7
deploy
Normal file → Executable file
7
deploy
Normal file → Executable file
|
@ -8,7 +8,7 @@ if [ $EUID -nq 0 ]; then
|
|||
fi
|
||||
|
||||
USER=${USER:-hlissner}
|
||||
HOST=${1:-${HOST:-kuro}}
|
||||
HOST=${1:-${HOST:-$(hostname)}}
|
||||
|
||||
DOTFILES="/home/$USER/.dotfiles"
|
||||
if [ ! -d /etc/dotfiles ]; then
|
||||
|
@ -21,9 +21,4 @@ if [ ! -f "$DOTFILES/machines/$HOST.nix" ]; then
|
|||
>&2 echo "No configuration exists for host '$HOST'"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ -n "$LINODE" ]; then
|
||||
ARGS="\"$HOST\""
|
||||
HOST=linode
|
||||
fi
|
||||
make -C "$DOTFILES" install
|
||||
|
|
|
@ -5,10 +5,12 @@
|
|||
imports = [
|
||||
./. # import common settings
|
||||
|
||||
<my/modules/services/ssh.nix>
|
||||
./modules/services/plex.nix
|
||||
# <my/modules/services/jellyfin.nix>
|
||||
<my/modules/shell/zsh.nix>
|
||||
<modules/shell/zsh.nix>
|
||||
|
||||
<modules/services/ssh.nix>
|
||||
<modules/services/plex.nix>
|
||||
# <modules/services/jellyfin.nix>
|
||||
<modules/services/syncthing.nix>
|
||||
];
|
||||
|
||||
networking.networkmanager.enable = true;
|
|
@ -1,17 +1,17 @@
|
|||
# Ao -- my home development and user-facing server
|
||||
|
||||
{ config, ... }:
|
||||
{ pkgs, config, ... }:
|
||||
{
|
||||
imports = [
|
||||
./. # import common settings
|
||||
|
||||
<my/modules/services/ssh.nix>
|
||||
<my/modules/services/nginx.nix>
|
||||
<my/modules/services/gitea.nix>
|
||||
<my/modules/services/syncthing.nix>
|
||||
<modules/services/ssh.nix>
|
||||
<modules/services/nginx.nix>
|
||||
<modules/services/gitea.nix>
|
||||
<modules/services/syncthing.nix>
|
||||
|
||||
<my/modules/shell/git.nix>
|
||||
<my/modules/shell/zsh.nix>
|
||||
<modules/shell/git.nix>
|
||||
<modules/shell/zsh.nix>
|
||||
];
|
||||
|
||||
networking.networkmanager.enable = true;
|
||||
|
@ -155,4 +155,18 @@
|
|||
SSH_DOMAIN = v0.io
|
||||
'';
|
||||
};
|
||||
|
||||
services.fail2ban = {
|
||||
enable = true;
|
||||
jails.DEFAULT = ''
|
||||
ignoreip = 127.0.0.1/8,192.168.1.0/24
|
||||
bantime = 3600
|
||||
maxretry = 5
|
||||
'';
|
||||
jails.sshd = ''
|
||||
filter = sshd
|
||||
action = iptables[name=ssh, port=22, protocl=tcp]
|
||||
enabled = true
|
||||
'';
|
||||
};
|
||||
}
|
32
hosts/default.nix
Normal file
32
hosts/default.nix
Normal file
|
@ -0,0 +1,32 @@
|
|||
# hosts/default.nix --- settings common to all my systems
|
||||
|
||||
{ pkgs, ... }:
|
||||
{
|
||||
# Just the bear necessities~
|
||||
environment.systemPackages = with pkgs; [
|
||||
coreutils
|
||||
git
|
||||
killall
|
||||
unzip
|
||||
vim
|
||||
wget
|
||||
sshfs
|
||||
];
|
||||
|
||||
|
||||
### My user settings
|
||||
my.username = "hlissner";
|
||||
my.env.PATH = [ ../bin ];
|
||||
my.user = {
|
||||
isNormalUser = true;
|
||||
uid = 1000;
|
||||
extraGroups = [ "wheel" "video" "networkmanager" ];
|
||||
shell = pkgs.zsh;
|
||||
};
|
||||
my.alias.nix-env = "NIXPKGS_ALLOW_UNFREE=1 nix-env";
|
||||
my.alias.nsh = "nix-shell";
|
||||
my.alias.nen = "nix-env";
|
||||
my.alias.sc = "systemctl";
|
||||
my.alias.ssc = "sudo systemctl";
|
||||
my.alias.dots = "make -C ~/.dotfiles";
|
||||
}
|
39
hosts/kuro/default.nix
Normal file
39
hosts/kuro/default.nix
Normal file
|
@ -0,0 +1,39 @@
|
|||
# Kuro -- my desktop
|
||||
|
||||
{ pkgs, ... }:
|
||||
{
|
||||
imports = [
|
||||
../personal.nix # common settings
|
||||
./hardware-configuration.nix
|
||||
## Desktop/shell environment
|
||||
<modules/desktop/bspwm.nix>
|
||||
## Apps
|
||||
# <modules/browser/firefox.nix>
|
||||
<modules/browser/vivaldi.nix>
|
||||
<modules/dev/cc.nix>
|
||||
<modules/dev/rust.nix>
|
||||
<modules/editors/emacs.nix>
|
||||
<modules/editors/vim.nix>
|
||||
<modules/gaming/steam.nix>
|
||||
<modules/shell/direnv.nix>
|
||||
<modules/shell/git.nix>
|
||||
<modules/shell/gnupg.nix>
|
||||
<modules/shell/pass.nix>
|
||||
<modules/shell/tmux.nix>
|
||||
<modules/shell/zsh.nix>
|
||||
## Project-based
|
||||
# <modules/chat> # discord, mainly
|
||||
<modules/recording.nix> # recording video & audio
|
||||
<modules/daw.nix> # making music
|
||||
<modules/music.nix> # playing music
|
||||
<modules/graphics.nix> # art & design
|
||||
<modules/vm.nix> # virtualbox for testing
|
||||
## Services
|
||||
<modules/services/syncthing.nix>
|
||||
## Theme
|
||||
<modules/themes/aquanaut>
|
||||
];
|
||||
|
||||
networking.networkmanager.enable = true;
|
||||
time.timeZone = "America/Toronto";
|
||||
}
|
75
hosts/kuro/hardware-configuration.nix
Normal file
75
hosts/kuro/hardware-configuration.nix
Normal file
|
@ -0,0 +1,75 @@
|
|||
{ config, pkgs, lib, ... }:
|
||||
{
|
||||
imports = [
|
||||
<nixpkgs/nixos/modules/installer/scan/not-detected.nix>
|
||||
];
|
||||
|
||||
boot.initrd.availableKernelModules = [ "xhci_pci" "ehci_pci" "ahci" "usbhid" "uas" "usb_storage" "sd_mod" ];
|
||||
boot.initrd.kernelModules = [ ];
|
||||
boot.kernelModules = [ "kvm-intel" ];
|
||||
boot.extraModulePackages = [ ];
|
||||
|
||||
### CPU
|
||||
nix.maxJobs = lib.mkDefault 8;
|
||||
powerManagement.cpuFreqGovernor = "performance";
|
||||
|
||||
## SSDs
|
||||
services.fstrim.enable = true;
|
||||
|
||||
## Ergodox
|
||||
my.packages = [ pkgs.teensy-loader-cli ];
|
||||
my.alias.teensyload = "sudo teensy-loader-cli -w -v --mcu=atmega32u4";
|
||||
|
||||
## GPU
|
||||
services.xserver.videoDrivers = [ "nvidia" ];
|
||||
hardware.opengl.enable = true;
|
||||
# Respect XDG conventions, damn it!
|
||||
environment.systemPackages = with pkgs; [
|
||||
(writeScriptBin "nvidia-settings" ''
|
||||
#!${stdenv.shell}
|
||||
exec ${config.boot.kernelPackages.nvidia_x11}/bin/nvidia-settings --config="$XDG_CONFIG_HOME/nvidia/settings"
|
||||
'')
|
||||
];
|
||||
|
||||
## Tablet
|
||||
# For my intuos4 pro. Doesn't work for cintiqs.
|
||||
services.xserver.wacom.enable = true;
|
||||
# TODO Move this to udev
|
||||
# my.init = ''
|
||||
# # lock tablet to main display
|
||||
# if xinput list --id-only "Wacom Intuos Pro S Pen stylus" 2>&1 >/dev/null; then
|
||||
# xinput map-to-output $(xinput list --id-only "Wacom Intuos Pro S Pen stylus") DVI-I-1
|
||||
# xinput map-to-output $(xinput list --id-only "Wacom Intuos Pro S Pen eraser") DVI-I-1
|
||||
# xinput map-to-output $(xinput list --id-only "Wacom Intuos Pro S Pen cursor") DVI-I-1
|
||||
# fi
|
||||
# '';
|
||||
|
||||
### Harddrives
|
||||
fileSystems = {
|
||||
"/" = {
|
||||
device = "/dev/disk/by-label/nixos";
|
||||
fsType = "ext4";
|
||||
options = [ "noatime" ];
|
||||
};
|
||||
"/boot" = {
|
||||
device = "/dev/disk/by-label/BOOT";
|
||||
fsType = "vfat";
|
||||
};
|
||||
"/mnt/projects" = {
|
||||
device = "/dev/disk/by-label/projects";
|
||||
fsType = "ext4";
|
||||
options = [ "noatime" ];
|
||||
};
|
||||
"/mnt/archive" = {
|
||||
device = "/dev/disk/by-label/archive";
|
||||
fsType = "ext4";
|
||||
options = [ "noatime" ];
|
||||
};
|
||||
"/mnt/local" = {
|
||||
device = "/dev/disk/by-label/local";
|
||||
fsType = "ext4";
|
||||
options = [ "noatime" ];
|
||||
};
|
||||
};
|
||||
swapDevices = [ { device = "/dev/disk/by-label/swap"; } ];
|
||||
}
|
|
@ -33,11 +33,11 @@
|
|||
with pkgs; [ inetutils mtr sysstat git ];
|
||||
|
||||
imports = [
|
||||
../.
|
||||
<my/modules/editors/vim.nix>
|
||||
<my/modules/shell/git.nix>
|
||||
<my/modules/shell/zsh.nix>
|
||||
<my/modules/services/ssh.nix>
|
||||
./.
|
||||
<modules/editors/vim.nix>
|
||||
<modules/shell/git.nix>
|
||||
<modules/shell/zsh.nix>
|
||||
<modules/services/ssh.nix>
|
||||
];
|
||||
|
||||
# GRUB
|
||||
|
@ -62,6 +62,4 @@
|
|||
networking.useDHCP = false;
|
||||
networking.usePredictableInterfaceNames = false;
|
||||
networking.interfaces.eth0.useDHCP = true;
|
||||
|
||||
time.timeZone = "America/Toronto";
|
||||
}
|
|
@ -1,50 +1,32 @@
|
|||
# ...
|
||||
# hosts/personal.nix --- settings common to my personal systems
|
||||
|
||||
{ config, options, lib, pkgs, ... }:
|
||||
{ pkgs, ... }:
|
||||
{
|
||||
imports = [ ./. ];
|
||||
|
||||
environment.systemPackages = with pkgs; [
|
||||
# Support for more filesystems
|
||||
exfat
|
||||
ntfs3g
|
||||
hfsprogs
|
||||
];
|
||||
|
||||
# Nothing in /tmp should survive a reboot
|
||||
boot.tmpOnTmpfs = true;
|
||||
# Use simple bootloader; I prefer the on-demand BIOs boot menu
|
||||
boot.loader.systemd-boot.enable = true;
|
||||
boot.loader.efi.canTouchEfiVariables = true;
|
||||
|
||||
# Just the bear necessities~
|
||||
environment.systemPackages = with pkgs; [
|
||||
coreutils
|
||||
git
|
||||
killall
|
||||
unzip
|
||||
vim
|
||||
wget
|
||||
# Support for extra filesystems
|
||||
sshfs
|
||||
exfat
|
||||
ntfs3g
|
||||
hfsprogs
|
||||
];
|
||||
|
||||
###
|
||||
# My user settings
|
||||
my = {
|
||||
username = "hlissner";
|
||||
env.PATH = [ <my/bin> ];
|
||||
user = {
|
||||
isNormalUser = true;
|
||||
uid = 1000;
|
||||
extraGroups = [ "wheel" "video" "networkmanager" ];
|
||||
shell = pkgs.zsh;
|
||||
};
|
||||
|
||||
alias.nix-env = "NIXPKGS_ALLOW_UNFREE=1 nix-env";
|
||||
alias.nen = "nix-env";
|
||||
alias.sc = "systemctl";
|
||||
alias.ssc = "sudo systemctl";
|
||||
alias.dots = "make -C ~/.dotfiles";
|
||||
};
|
||||
|
||||
|
||||
### Universal defaults
|
||||
networking.firewall.enable = true;
|
||||
networking.hosts = {
|
||||
"192.168.1.2" = [ "ao" ];
|
||||
"192.168.1.3" = [ "aka" ];
|
||||
"192.168.1.10" = [ "kuro" ];
|
||||
"192.168.1.11" = [ "shiro" ];
|
||||
"192.168.1.12" = [ "midori" ];
|
||||
};
|
||||
|
||||
|
||||
### A tidy $HOME is a tidy mind.
|
||||
# Obey XDG conventions;
|
||||
|
@ -57,7 +39,6 @@
|
|||
XDG_DATA_HOME = "$HOME/.local/share";
|
||||
XDG_BIN_HOME = "$HOME/.local/bin";
|
||||
};
|
||||
|
||||
# Conform more programs to XDG conventions. The rest are handled by their
|
||||
# respective modules.
|
||||
my.env = {
|
57
hosts/shiro/default.nix
Normal file
57
hosts/shiro/default.nix
Normal file
|
@ -0,0 +1,57 @@
|
|||
# Shiro -- my laptop
|
||||
|
||||
{ pkgs, ... }:
|
||||
{
|
||||
imports = [
|
||||
../personal.nix # common settings
|
||||
./hardware-configuration.nix
|
||||
(let nixos-hardware =
|
||||
builtins.fetchTarball
|
||||
https://github.com/NixOS/nixos-hardware/archive/master.tar.gz;
|
||||
in "${nixos-hardware}/dell/xps/13-9370")
|
||||
## Dekstop environment
|
||||
<modules/desktop/bspwm.nix>
|
||||
## Apps
|
||||
<modules/browser/firefox.nix>
|
||||
<modules/dev>
|
||||
<modules/editors/emacs.nix>
|
||||
<modules/editors/vim.nix>
|
||||
<modules/shell/direnv.nix>
|
||||
<modules/shell/git.nix>
|
||||
<modules/shell/gnupg.nix>
|
||||
<modules/shell/pass.nix>
|
||||
<modules/shell/zsh.nix>
|
||||
## Project-based
|
||||
# <modules/chat> # discord, mainly
|
||||
<modules/recording.nix> # recording video & audio
|
||||
<modules/daw.nix> # making music
|
||||
<modules/music.nix> # playing music
|
||||
<modules/graphics.nix> # art & design
|
||||
# <modules/vm.nix> # virtualbox for testing
|
||||
## Services
|
||||
<modules/services/syncthing.nix>
|
||||
## Theme
|
||||
<modules/themes/aquanaut>
|
||||
];
|
||||
|
||||
networking.wireless.enable = true;
|
||||
hardware.opengl.enable = true;
|
||||
|
||||
time.timeZone = "America/Toronto";
|
||||
# time.timeZone = "Europe/Copenhagen";
|
||||
|
||||
# Optimize power use
|
||||
environment.systemPackages = [ pkgs.acpi ];
|
||||
powerManagement.powertop.enable = true;
|
||||
# Monitor backlight control
|
||||
programs.light.enable = true;
|
||||
# Encrypted /home
|
||||
boot.initrd.luks.devices = [
|
||||
{
|
||||
name = "home";
|
||||
device = "/dev/nvme0n1p8";
|
||||
preLVM = true;
|
||||
allowDiscards = true;
|
||||
}
|
||||
];
|
||||
}
|
|
@ -1,23 +0,0 @@
|
|||
# FIXME
|
||||
|
||||
{ config, lib, pkgs, ... }:
|
||||
{
|
||||
imports = [
|
||||
<my/modules/linode.nix>
|
||||
];
|
||||
|
||||
networking.hostName = "holo";
|
||||
time.timeZone = "America/Toronto";
|
||||
|
||||
services.nginx = {
|
||||
# user = config.my.username;
|
||||
virtualHosts = {
|
||||
# "domain.com" = {
|
||||
# default = true;
|
||||
# enableACME = true;
|
||||
# forceSSL = true;
|
||||
# root = "...";
|
||||
# };
|
||||
};
|
||||
};
|
||||
}
|
|
@ -1,49 +0,0 @@
|
|||
# Kuro -- my desktop
|
||||
|
||||
{ config, lib, utils, pkgs, ... }:
|
||||
{
|
||||
imports = [
|
||||
./. # import common settings
|
||||
|
||||
<my/modules/hardware/nvidia.nix>
|
||||
<my/modules/hardware/ergodox.nix>
|
||||
|
||||
<my/modules/desktop/bspwm.nix>
|
||||
|
||||
<my/modules/chat.nix> # discord, mainly
|
||||
<my/modules/recording.nix> # recording video & audio
|
||||
<my/modules/daw.nix> # making music
|
||||
<my/modules/music.nix> # playing music
|
||||
<my/modules/graphics.nix> # art & design
|
||||
<my/modules/vm.nix> # virtualbox for testing
|
||||
|
||||
# <my/modules/browser/firefox.nix>
|
||||
<my/modules/browser/vivaldi.nix>
|
||||
<my/modules/dev/cc.nix>
|
||||
<my/modules/dev/rust.nix>
|
||||
<my/modules/editors/emacs.nix>
|
||||
<my/modules/editors/vim.nix>
|
||||
<my/modules/gaming/steam.nix>
|
||||
<my/modules/shell/direnv.nix>
|
||||
<my/modules/shell/git.nix>
|
||||
<my/modules/shell/gnupg.nix>
|
||||
<my/modules/shell/pass.nix>
|
||||
<my/modules/shell/zsh.nix>
|
||||
|
||||
# Services
|
||||
<my/modules/services/syncthing.nix>
|
||||
|
||||
# Themes
|
||||
<my/modules/themes/aquanaut>
|
||||
];
|
||||
|
||||
networking.networkmanager.enable = true;
|
||||
time.timeZone = "America/Toronto";
|
||||
|
||||
# Mouse settings
|
||||
services.xserver.libinput = {
|
||||
enable = true;
|
||||
middleEmulation = true;
|
||||
scrollButton = 3;
|
||||
};
|
||||
}
|
|
@ -1,60 +0,0 @@
|
|||
# Shiro -- my laptop
|
||||
|
||||
{ config, lib, pkgs, ... }:
|
||||
|
||||
let nixos-hardware = builtins.fetchTarball https://github.com/NixOS/nixos-hardware/archive/master.tar.gz;
|
||||
in {
|
||||
imports = [
|
||||
./. # import common settings
|
||||
|
||||
# Hardware specific
|
||||
"${nixos-hardware}/dell/xps/13-9370"
|
||||
|
||||
<my/modules/desktop/bspwm.nix>
|
||||
|
||||
<my/modules/chat.nix> # discord, mainly
|
||||
<my/modules/recording.nix> # recording video & audio
|
||||
<my/modules/daw.nix> # making music
|
||||
<my/modules/music.nix> # playing music
|
||||
<my/modules/graphics.nix> # art & design
|
||||
# <my/modules/vm.nix> # virtualbox for testing
|
||||
|
||||
<my/modules/browser/firefox.nix>
|
||||
<my/modules/dev>
|
||||
<my/modules/editors/emacs.nix>
|
||||
<my/modules/editors/vim.nix>
|
||||
<my/modules/shell/direnv.nix>
|
||||
<my/modules/shell/git.nix>
|
||||
<my/modules/shell/gnupg.nix>
|
||||
<my/modules/shell/pass.nix>
|
||||
<my/modules/shell/zsh.nix>
|
||||
|
||||
# Services
|
||||
<my/modules/services/syncthing.nix>
|
||||
|
||||
# Themes
|
||||
<modules/themes/aquanaut>
|
||||
];
|
||||
|
||||
theme.wallpaper = <my/assets/wallpapers/aquanaut.2560x1440.jpg>;
|
||||
networking.wireless.enable = true;
|
||||
hardware.opengl.enable = true;
|
||||
|
||||
time.timeZone = "America/Toronto";
|
||||
# time.timeZone = "Europe/Copenhagen";
|
||||
|
||||
# Optimize power use
|
||||
environment.systemPackages = [ pkgs.acpi ];
|
||||
powerManagement.powertop.enable = true;
|
||||
# Monitor backlight control
|
||||
programs.light.enable = true;
|
||||
# Encrypted /home
|
||||
boot.initrd.luks.devices = [
|
||||
{
|
||||
name = "home";
|
||||
device = "/dev/nvme0n1p8";
|
||||
preLVM = true;
|
||||
allowDiscards = true;
|
||||
}
|
||||
];
|
||||
}
|
|
@ -9,11 +9,11 @@
|
|||
my.env.BROWSER = "qutebrowser";
|
||||
my.home.xdg = {
|
||||
configFile."qutebrowser" = {
|
||||
source = <my/config/qutebrowser>;
|
||||
source = <config/qutebrowser>;
|
||||
recursive = true;
|
||||
};
|
||||
dataFile."qutebrowser/greasemonkey" = {
|
||||
source = <my/config/qutebrowser/greasemonkey>;
|
||||
source = <config/qutebrowser/greasemonkey>;
|
||||
recursive = true;
|
||||
};
|
||||
};
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
# Even neckbeards have a social life. Not that I have one. A neckbeard, I mean.
|
||||
# But when I do have either, then discord and weechat are my go-to.
|
||||
|
||||
{ config, lib, pkgs, ... }:
|
||||
{ pkgs, ... }:
|
||||
{
|
||||
my.packages = with pkgs; [
|
||||
# weechat # TODO For the real neckbeards
|
||||
|
|
15
modules/desktop/apps/redshift.nix
Normal file
15
modules/desktop/apps/redshift.nix
Normal file
|
@ -0,0 +1,15 @@
|
|||
# modules/desktop/apps/redshift.nix
|
||||
|
||||
{ config, lib, pkgs, ... }:
|
||||
{
|
||||
services.redshift.enable = true;
|
||||
|
||||
# For redshift
|
||||
location = (if config.time.timeZone == "America/Toronto" then {
|
||||
latitude = 43.70011;
|
||||
longitude = -79.4163;
|
||||
} else if config.time.timeZone == "Europe/Copenhagen" then {
|
||||
latitude = 55.88;
|
||||
longitude = 12.5;
|
||||
} else {});
|
||||
}
|
|
@ -2,10 +2,10 @@
|
|||
|
||||
{
|
||||
my = {
|
||||
env.PATH = [ <my/config/rofi/bin> ];
|
||||
env.PATH = [ <config/rofi/bin> ];
|
||||
# link recursively so other modules can link files in its folder
|
||||
home.xdg.configFile."rofi" = {
|
||||
source = <my/config/rofi>;
|
||||
source = <config/rofi>;
|
||||
recursive = true;
|
||||
};
|
||||
|
||||
|
@ -18,21 +18,21 @@
|
|||
# Fake rofi dmenu entries
|
||||
(makeDesktopItem {
|
||||
name = "rofi-browsermenu";
|
||||
desktopName = "Open Bookmark in Firefox";
|
||||
desktopName = "Open Bookmark in Browser";
|
||||
icon = "bookmark-new-symbolic";
|
||||
exec = "${<my/config/rofi>}/bin/rofi-browsermenu";
|
||||
exec = "${<config/rofi>}/bin/rofi-browsermenu";
|
||||
})
|
||||
(makeDesktopItem {
|
||||
name = "rofi-filemenu";
|
||||
desktopName = "Open Directory in Terminal";
|
||||
icon = "folder";
|
||||
exec = "${<my/config/rofi>}/bin/rofi-filemenu";
|
||||
exec = "${<config/rofi>}/bin/rofi-filemenu";
|
||||
})
|
||||
(makeDesktopItem {
|
||||
name = "rofi-filemenu-scratch";
|
||||
desktopName = "Open Directory in Scratch Terminal";
|
||||
icon = "folder";
|
||||
exec = "${<my/config/rofi>}/bin/rofi-filemenu -x";
|
||||
exec = "${<config/rofi>}/bin/rofi-filemenu -x";
|
||||
})
|
||||
|
||||
(makeDesktopItem {
|
|
@ -2,14 +2,14 @@
|
|||
|
||||
{
|
||||
imports = [
|
||||
./.
|
||||
|
||||
# My launcher
|
||||
./rofi.nix
|
||||
./apps/rofi.nix
|
||||
|
||||
# I often need a thumbnail browser to show off, peruse or organize photos,
|
||||
# design work, or digital art.
|
||||
./thunar.nix
|
||||
./apps/thunar.nix
|
||||
|
||||
./apps/redshift.nix
|
||||
];
|
||||
|
||||
environment.systemPackages = with pkgs; [
|
||||
|
@ -21,56 +21,11 @@
|
|||
pulseSupport = true;
|
||||
nlSupport = true;
|
||||
})
|
||||
|
||||
xst # st + nice-to-have extensions
|
||||
(makeDesktopItem {
|
||||
name = "xst";
|
||||
desktopName = "Suckless Terminal";
|
||||
genericName = "Default terminal";
|
||||
icon = "utilities-terminal";
|
||||
exec = "${xst}/bin/xst";
|
||||
categories = "Development;System;Utility";
|
||||
})
|
||||
|
||||
(writeScriptBin "st-scratch" ''
|
||||
#!${stdenv.shell}
|
||||
SCRID=st-scratch
|
||||
focused=$(xdotool getactivewindow)
|
||||
scratch=$(xdotool search --onlyvisible --classname $SCRID)
|
||||
if [[ -n $scratch ]]; then
|
||||
if [[ $focused == $scratch ]]; then
|
||||
xdotool windowkill $scratch
|
||||
else
|
||||
xdotool windowactivate $scratch
|
||||
fi
|
||||
else
|
||||
xst -t $SCRID -n $SCRID -c $SCRID \
|
||||
-f "$(xrdb -query | grep 'st-scratch\.font' | cut -f2)" \
|
||||
-g 100x26 \
|
||||
-e $SHELL
|
||||
fi
|
||||
'')
|
||||
(writeScriptBin "st-calc" ''
|
||||
#!${stdenv.shell}
|
||||
SCRID=st-calc
|
||||
scratch=$(xdotool search --onlyvisible --classname $SCRID)
|
||||
[ -n "$scratch" ] && xdotool windowkill $scratch
|
||||
xst -t $SCRID -n $SCRID -c $SCRID \
|
||||
-f "$(xrdb -query | grep 'st-scratch\.font' | cut -f2)" \
|
||||
-g 80x12 \
|
||||
-e $SHELL -c qalc
|
||||
'')
|
||||
(makeDesktopItem {
|
||||
name = "st-calc";
|
||||
desktopName = "Calculator";
|
||||
icon = "calc";
|
||||
exec = "st-calc";
|
||||
categories = "Development";
|
||||
})
|
||||
];
|
||||
|
||||
services = {
|
||||
xserver = {
|
||||
enable = true;
|
||||
desktopManager.xterm.enable = false;
|
||||
windowManager.bspwm.enable = true;
|
||||
displayManager.lightdm = {
|
||||
|
@ -81,55 +36,19 @@
|
|||
};
|
||||
};
|
||||
};
|
||||
|
||||
compton = {
|
||||
enable = true;
|
||||
backend = "glx";
|
||||
vSync = true;
|
||||
opacityRules = [
|
||||
"100:class_g = 'Firefox'"
|
||||
"100:class_g = 'Vivaldi-stable'"
|
||||
"100:class_g = 'VirtualBox Machine'"
|
||||
# Art/image programs where we need fidelity
|
||||
"100:class_g = 'Gimp'"
|
||||
"100:class_g = 'Inkscape'"
|
||||
"100:class_g = 'aseprite'"
|
||||
"100:class_g = 'krita'"
|
||||
"100:class_g = 'feh'"
|
||||
"100:class_g = 'mpv'"
|
||||
];
|
||||
settings.blur-background-exclude = [
|
||||
"window_type = 'dock'"
|
||||
"window_type = 'desktop'"
|
||||
"_GTK_FRAME_EXTENTS@:c"
|
||||
];
|
||||
};
|
||||
compton.enable = true;
|
||||
};
|
||||
|
||||
# For polybar
|
||||
fonts.fonts = [ pkgs.siji ];
|
||||
|
||||
my = {
|
||||
env.PATH = [ <my/config/bspwm/bin> ];
|
||||
env.PATH = [ <config/bspwm/bin> ];
|
||||
home.xdg.configFile = {
|
||||
"sxhkd".source = <my/config/sxhkd>;
|
||||
"sxhkd".source = <config/sxhkd>;
|
||||
# link recursively so other modules can link files in their folders
|
||||
"bspwm" = {
|
||||
source = <my/config/bspwm>;
|
||||
source = <config/bspwm>;
|
||||
recursive = true;
|
||||
};
|
||||
};
|
||||
|
||||
env.XAUTHORITY = "/tmp/Xauthority";
|
||||
init = ''
|
||||
[ -e ~/.Xauthority ] && mv -f ~/.Xauthority "$XAUTHORITY"
|
||||
'';
|
||||
};
|
||||
|
||||
system.activationScripts.clearHome = ''
|
||||
pushd /home/${config.my.username}
|
||||
rm -rf .compose-cache .nv .pki .dbus .fehbg
|
||||
[ -s .xsession-errors ] || rm -f .xsession-errors*
|
||||
popd
|
||||
'';
|
||||
}
|
||||
|
|
|
@ -1,7 +1,33 @@
|
|||
{ config, lib, pkgs, ... }:
|
||||
|
||||
{
|
||||
my.packages = with pkgs; [
|
||||
services.compton = {
|
||||
backend = "glx";
|
||||
vSync = true;
|
||||
opacityRules = [
|
||||
"100:class_g = 'Firefox'"
|
||||
"100:class_g = 'Vivaldi-stable'"
|
||||
"100:class_g = 'VirtualBox Machine'"
|
||||
# Art/image programs where we need fidelity
|
||||
"100:class_g = 'Gimp'"
|
||||
"100:class_g = 'Inkscape'"
|
||||
"100:class_g = 'aseprite'"
|
||||
"100:class_g = 'krita'"
|
||||
"100:class_g = 'feh'"
|
||||
"100:class_g = 'mpv'"
|
||||
];
|
||||
settings.blur-background-exclude = [
|
||||
"window_type = 'dock'"
|
||||
"window_type = 'desktop'"
|
||||
"_GTK_FRAME_EXTENTS@:c"
|
||||
];
|
||||
};
|
||||
|
||||
my = {
|
||||
env.XAUTHORITY = "/tmp/Xauthority";
|
||||
init = "[ -e ~/.Xauthority ] && mv -f ~/.Xauthority \"$XAUTHORITY\"";
|
||||
|
||||
packages = with pkgs; [
|
||||
libqalculate
|
||||
xclip
|
||||
xdotool
|
||||
|
@ -11,7 +37,79 @@
|
|||
# Useful apps
|
||||
calibre # managing my ebooks
|
||||
evince # pdf reader
|
||||
|
||||
xst # st + nice-to-have extensions
|
||||
(makeDesktopItem {
|
||||
name = "xst";
|
||||
desktopName = "Suckless Terminal";
|
||||
genericName = "Default terminal";
|
||||
icon = "utilities-terminal";
|
||||
exec = "${xst}/bin/xst";
|
||||
categories = "Development;System;Utility";
|
||||
})
|
||||
|
||||
(writeScriptBin "st-scratch" ''
|
||||
#!${stdenv.shell}
|
||||
SCRID=st-scratch
|
||||
focused=$(xdotool getactivewindow)
|
||||
scratch=$(xdotool search --onlyvisible --classname $SCRID)
|
||||
if [[ -n $scratch ]]; then
|
||||
if [[ $focused == $scratch ]]; then
|
||||
xdotool windowkill $scratch
|
||||
else
|
||||
xdotool windowactivate $scratch
|
||||
fi
|
||||
else
|
||||
xst -t $SCRID -n $SCRID -c $SCRID \
|
||||
-f "$(xrdb -query | grep 'st-scratch\.font' | cut -f2)" \
|
||||
-g 100x26 \
|
||||
-e $SHELL
|
||||
fi
|
||||
'')
|
||||
(writeScriptBin "st-calc" ''
|
||||
#!${stdenv.shell}
|
||||
SCRID=st-calc
|
||||
scratch=$(xdotool search --onlyvisible --classname $SCRID)
|
||||
[ -n "$scratch" ] && xdotool windowkill $scratch
|
||||
xst -t $SCRID -n $SCRID -c $SCRID \
|
||||
-f "$(xrdb -query | grep 'st-scratch\.font' | cut -f2)" \
|
||||
-g 80x12 \
|
||||
-e $SHELL -c qalc
|
||||
'')
|
||||
(makeDesktopItem {
|
||||
name = "st-calc";
|
||||
desktopName = "Calculator";
|
||||
icon = "calc";
|
||||
exec = "st-calc";
|
||||
categories = "Development";
|
||||
})
|
||||
];
|
||||
};
|
||||
|
||||
fonts.enableFontDir = true;
|
||||
fonts.enableGhostscriptFonts = true;
|
||||
fonts.fonts = with pkgs; [
|
||||
ubuntu_font_family
|
||||
dejavu_fonts
|
||||
fira-code
|
||||
fira-code-symbols
|
||||
symbola
|
||||
noto-fonts
|
||||
noto-fonts-cjk
|
||||
font-awesome-ttf
|
||||
siji
|
||||
];
|
||||
fonts.fontconfig.defaultFonts = {
|
||||
sansSerif = ["Ubuntu"];
|
||||
monospace = ["Fira Code"];
|
||||
};
|
||||
|
||||
system.activationScripts.clearHome = ''
|
||||
pushd /home/${config.my.username}
|
||||
rm -rf .compose-cache .nv .pki .dbus .fehbg
|
||||
[ -s .xsession-errors ] || rm -f .xsession-errors*
|
||||
popd
|
||||
'';
|
||||
|
||||
sound.enable = true;
|
||||
hardware.pulseaudio.enable = true;
|
||||
|
@ -28,38 +126,4 @@
|
|||
in lib.mkIf config.hardware.pulseaudio.enable
|
||||
"${paConfigFile}/default.pa";
|
||||
|
||||
services = {
|
||||
xserver.enable = true;
|
||||
redshift.enable = true;
|
||||
};
|
||||
|
||||
# For redshift
|
||||
location = (if config.time.timeZone == "America/Toronto" then {
|
||||
latitude = 43.70011;
|
||||
longitude = -79.4163;
|
||||
} else if config.time.timeZone == "Europe/Copenhagen" then {
|
||||
latitude = 55.88;
|
||||
longitude = 12.5;
|
||||
} else {});
|
||||
|
||||
fonts = {
|
||||
enableFontDir = true;
|
||||
enableGhostscriptFonts = true;
|
||||
|
||||
fonts = with pkgs; [
|
||||
ubuntu_font_family
|
||||
dejavu_fonts
|
||||
fira-code
|
||||
fira-code-symbols
|
||||
symbola
|
||||
noto-fonts
|
||||
noto-fonts-cjk
|
||||
font-awesome-ttf
|
||||
];
|
||||
|
||||
fontconfig.defaultFonts = {
|
||||
sansSerif = ["Ubuntu"];
|
||||
monospace = ["Fira Code"];
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
@ -26,7 +26,7 @@
|
|||
env.PYTHON_EGG_CACHE = "$XDG_CACHE_HOME/python-eggs";
|
||||
env.JUPYTER_CONFIG_DIR = "$XDG_CONFIG_HOME/jupyter";
|
||||
|
||||
zsh.rc = lib.readFile <my/config/python/aliases.zsh>;
|
||||
zsh.rc = lib.readFile <config/python/aliases.zsh>;
|
||||
|
||||
alias.py = "python";
|
||||
alias.py2 = "python2";
|
||||
|
|
|
@ -9,6 +9,6 @@
|
|||
{
|
||||
my.packages = with pkgs; [
|
||||
shellcheck
|
||||
(callPackage (import <my/packages/zunit.nix> {}))
|
||||
my.zunit
|
||||
];
|
||||
}
|
||||
|
|
|
@ -42,7 +42,7 @@
|
|||
];
|
||||
|
||||
env.PATH = [ "$HOME/.emacs.d/bin" ];
|
||||
zsh.rc = lib.readFile <my/config/emacs/aliases.zsh>;
|
||||
zsh.rc = lib.readFile <config/emacs/aliases.zsh>;
|
||||
|
||||
# My emacs config is too stateful to manage with nix
|
||||
init = ''
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
];
|
||||
|
||||
home.xdg.configFile = {
|
||||
"GIMP/2.10" = { source = <my/config/gimp>; recursive = true; };
|
||||
"GIMP/2.10" = { source = <config/gimp>; recursive = true; };
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
@ -1,6 +0,0 @@
|
|||
{ config, lib, pkgs, ... }:
|
||||
|
||||
{
|
||||
my.packages = [ pkgs.teensy-loader-cli ];
|
||||
my.alias.teensyload = "sudo teensy-loader-cli -w -v --mcu=atmega32u4";
|
||||
}
|
|
@ -1,14 +0,0 @@
|
|||
{ config, lib, pkgs, ... }:
|
||||
|
||||
{
|
||||
services.xserver.videoDrivers = [ "nvidia" ];
|
||||
hardware.opengl.enable = true;
|
||||
|
||||
# Respect XDG conventions, damn it!
|
||||
environment.systemPackages = with pkgs; [
|
||||
(pkgs.writeScriptBin "nvidia-settings" ''
|
||||
#!${pkgs.stdenv.shell}
|
||||
exec ${config.boot.kernelPackages.nvidia_x11}/bin/nvidia-settings --config="$XDG_CONFIG_HOME/nvidia/settings"
|
||||
'')
|
||||
];
|
||||
}
|
|
@ -1,16 +0,0 @@
|
|||
{ config, lib, pkgs, ... }:
|
||||
|
||||
{
|
||||
# For my intuos4 pro. Doesn't work for cintiqs.
|
||||
services.xserver.wacom.enable = true;
|
||||
|
||||
# TODO Move this to udev
|
||||
# my.init = ''
|
||||
# # lock tablet to main display
|
||||
# if xinput list --id-only "Wacom Intuos Pro S Pen stylus" 2>&1 >/dev/null; then
|
||||
# xinput map-to-output $(xinput list --id-only "Wacom Intuos Pro S Pen stylus") DVI-I-1
|
||||
# xinput map-to-output $(xinput list --id-only "Wacom Intuos Pro S Pen eraser") DVI-I-1
|
||||
# xinput map-to-output $(xinput list --id-only "Wacom Intuos Pro S Pen cursor") DVI-I-1
|
||||
# fi
|
||||
# '';
|
||||
}
|
|
@ -3,7 +3,7 @@
|
|||
{ config, lib, pkgs, ... }:
|
||||
|
||||
{
|
||||
services.jellyfin = { enable = true; };
|
||||
services.jellyfin.enable = true;
|
||||
|
||||
networking.firewall = {
|
||||
allowedTCPPorts = [ 8096 ];
|
||||
|
|
|
@ -6,11 +6,11 @@
|
|||
gitAndTools.hub
|
||||
gitAndTools.diff-so-fancy
|
||||
];
|
||||
zsh.rc = lib.readFile <my/config/git/aliases.zsh>;
|
||||
zsh.rc = lib.readFile <config/git/aliases.zsh>;
|
||||
# Do recursively, in case git stores files in this folder
|
||||
home.xdg.configFile = {
|
||||
"git/config".source = <my/config/git/config>;
|
||||
"git/ignore".source = <my/config/git/ignore>;
|
||||
"git/config".source = <config/git/config>;
|
||||
"git/ignore".source = <config/git/ignore>;
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
my.alias.mpcsp = "mpc searchplay any";
|
||||
|
||||
my.home.xdg.configFile = {
|
||||
"ncmpcpp/config".source = <my/config/ncmpcpp/config>;
|
||||
"ncmpcpp/bindings".source = <my/config/ncmpcpp/bindings>;
|
||||
"ncmpcpp/config".source = <config/ncmpcpp/config>;
|
||||
"ncmpcpp/bindings".source = <config/ncmpcpp/bindings>;
|
||||
};
|
||||
}
|
||||
|
|
|
@ -19,8 +19,8 @@
|
|||
|
||||
zsh.rc = ''
|
||||
_cache tmuxifier init -
|
||||
${lib.readFile <my/config/tmux/aliases.zsh>}
|
||||
${lib.readFile <config/tmux/aliases.zsh>}
|
||||
'';
|
||||
home.xdg.configFile."tmux" = { source = <my/config/tmux>; recursive = true; };
|
||||
home.xdg.configFile."tmux" = { source = <config/tmux>; recursive = true; };
|
||||
};
|
||||
}
|
||||
|
|
|
@ -1,8 +1,7 @@
|
|||
{ config, pkgs, libs, ... }:
|
||||
# modules/shell/zsh.nix --- ...
|
||||
|
||||
{ pkgs, libs, ... }:
|
||||
{
|
||||
imports = [ ./tmux.nix ];
|
||||
|
||||
my = {
|
||||
packages = with pkgs; [
|
||||
zsh
|
||||
|
@ -19,22 +18,29 @@
|
|||
env.ZDOTDIR = "$XDG_CONFIG_HOME/zsh";
|
||||
env.ZSH_CACHE = "$XDG_CACHE_HOME/zsh";
|
||||
|
||||
# Write it recursively so other modules can write files to it
|
||||
home.xdg.configFile."zsh" = {
|
||||
source = <my/config/zsh>;
|
||||
recursive = true;
|
||||
};
|
||||
|
||||
alias.exa = "exa --group-directories-first";
|
||||
alias.l = "exa -1";
|
||||
alias.ll = "exa -l";
|
||||
alias.la = "LC_COLLATE=C exa -la";
|
||||
|
||||
# Write it recursively so other modules can write files to it
|
||||
home.xdg.configFile."zsh" = {
|
||||
source = <config/zsh>;
|
||||
recursive = true;
|
||||
};
|
||||
};
|
||||
|
||||
programs.zsh = {
|
||||
enable = true;
|
||||
enableCompletion = true;
|
||||
enableGlobalCompInit = false; # I'll do it myself
|
||||
# I init completion myself, because enableGlobalCompInit initializes it too
|
||||
# soon, which means commands initialized later in my config won't get
|
||||
# completion, and running compinit twice is slow.
|
||||
enableGlobalCompInit = false;
|
||||
promptInit = "";
|
||||
};
|
||||
|
||||
system.userActivationScripts.cleanupZgen = ''
|
||||
rm -fv $XDG_CACHE_HOME/zsh/*
|
||||
'';
|
||||
}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# modules/themes/aquanaut/default.nix --- a sea-blue linux theme
|
||||
|
||||
{ config, pkgs, ... }:
|
||||
{ config, lib, pkgs, ... }:
|
||||
{
|
||||
imports = [ ../. ]; # Load framework for themes
|
||||
|
||||
|
@ -32,6 +32,7 @@
|
|||
nordic
|
||||
paper-icon-theme # for rofi
|
||||
];
|
||||
my.zsh.rc = lib.readFile ./zsh/prompt.zsh;
|
||||
my.home.xdg.configFile = {
|
||||
"bspwm/rc.d/polybar".source = ./polybar/run.sh;
|
||||
"bspwm/rc.d/theme".source = ./bspwmrc;
|
||||
|
@ -40,7 +41,6 @@
|
|||
"rofi/theme" = { source = ./rofi; recursive = true; };
|
||||
"tmux/theme".source = ./tmux.conf;
|
||||
"xtheme/90-theme".source = ./Xresources;
|
||||
"zsh/prompt.zsh".source = ./zsh/prompt.zsh;
|
||||
# GTK
|
||||
"gtk-3.0/settings.ini".text = ''
|
||||
[Settings]
|
||||
|
|
|
@ -1,17 +1,13 @@
|
|||
{ config, lib, pkgs, ... }:
|
||||
# modules/themes/default.nix
|
||||
|
||||
{ config, ... }:
|
||||
{
|
||||
imports = [ <my/options/theme.nix> ];
|
||||
imports = [ ./options.nix ];
|
||||
|
||||
# Try really hard to get QT to respect my GTK theme.
|
||||
my.env = {
|
||||
GTK_DATA_PREFIX = [ "${config.system.path}" ];
|
||||
QT_QPA_PLATFORMTHEME = "gtk2";
|
||||
};
|
||||
qt5 = {
|
||||
style = "gtk2";
|
||||
platformTheme = "gtk2";
|
||||
};
|
||||
my.env.GTK_DATA_PREFIX = [ "${config.system.path}" ];
|
||||
my.env.QT_QPA_PLATFORMTHEME = "gtk2";
|
||||
qt5 = { style = "gtk2"; platformTheme = "gtk2"; };
|
||||
services.xserver.displayManager.sessionCommands = ''
|
||||
export GTK2_RC_FILES="$XDG_CONFIG_HOME/gtk-2.0/gtkrc"
|
||||
source "$XDG_CONFIG_HOME"/xsession/*.sh
|
||||
|
|
|
@ -1,19 +1,17 @@
|
|||
{ config, options, lib, pkgs, ... }:
|
||||
# modules/themes/options.nix
|
||||
|
||||
{ options, config, lib, pkgs, ... }:
|
||||
with lib;
|
||||
{
|
||||
options.theme = {
|
||||
wallpaper = mkOption {
|
||||
type = with types; nullOr (either str path);
|
||||
default = null;
|
||||
description = "The wallpaper to use";
|
||||
};
|
||||
|
||||
# TODO Colors?
|
||||
};
|
||||
|
||||
config = {
|
||||
# Set up wallpaper and blur/darken it for lock/login screen
|
||||
my.home.home.file.".background-image".source = config.theme.wallpaper;
|
||||
services.xserver.displayManager.lightdm.background =
|
||||
let blurredWallpaper =
|
90
options.nix
Normal file
90
options.nix
Normal file
|
@ -0,0 +1,90 @@
|
|||
{ config, options, lib, ... }:
|
||||
|
||||
with lib;
|
||||
let mkOptionStr = value: mkOption
|
||||
{ type = types.str;
|
||||
default = value; };
|
||||
in
|
||||
{
|
||||
imports = [ <home-manager/nixos> ];
|
||||
|
||||
|
||||
## Personal settings
|
||||
options.my.username = mkOptionStr "hlissner";
|
||||
options.my.email = mkOptionStr "henrik@lissner.net";
|
||||
|
||||
|
||||
## Convenience aliases
|
||||
options.my.home = mkOption
|
||||
{ type = options.home-manager.users.type.functor.wrapped; };
|
||||
config.home-manager.users.${config.my.username} = mkAliasDefinitions options.my.home;
|
||||
|
||||
options.my.user = mkOption { type = types.submodule; };
|
||||
config.users.users.${config.my.username} = mkAliasDefinitions options.my.user;
|
||||
|
||||
options.my.packages = mkOption
|
||||
{ type = types.listOf types.package;
|
||||
description = "The set of packages to appear in the user environment."; };
|
||||
config.my.user.packages = config.my.packages;
|
||||
|
||||
|
||||
## Shell/Environment
|
||||
options.my.env = mkOption {
|
||||
type = with types; attrsOf (either (either str path) (listOf (either str path)));
|
||||
apply = mapAttrs
|
||||
(n: v: if isList v
|
||||
then concatMapStringsSep ":" (x: toString x) v
|
||||
else (toString v));
|
||||
};
|
||||
options.my.init = mkOption {
|
||||
type = types.lines;
|
||||
description = ''
|
||||
An init script that runs after the environment has been rebuilt or
|
||||
booted. Anything done here should be idempotent and inexpensive.
|
||||
'';
|
||||
};
|
||||
config.environment.extraInit =
|
||||
let exportLines = mapAttrsToList (n: v: "export ${n}=\"${v}\"") config.my.env;
|
||||
in ''
|
||||
${concatStringsSep "\n" exportLines}
|
||||
${config.my.init}
|
||||
'';
|
||||
|
||||
options.my.alias = mkOption
|
||||
{ type = with types; nullOr (attrsOf (nullOr (either str path))); };
|
||||
options.my.zsh = {
|
||||
rc = mkOption {
|
||||
type = types.lines;
|
||||
default = "";
|
||||
description = ''
|
||||
Zsh lines to be written to $XDG_CONFIG_HOME/zsh/extra.zshrc and
|
||||
sourced by $XDG_CONFIG_HOME/zsh/.zshrc
|
||||
'';
|
||||
};
|
||||
env = mkOption {
|
||||
type = types.lines;
|
||||
default = "";
|
||||
description = ''
|
||||
Zsh lines to be written to $XDG_CONFIG_HOME/zsh/extra.zshenv and
|
||||
sourced by $XDG_CONFIG_HOME/zsh/.zshenv
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
||||
# I avoid programs.zsh.*Init variables because they initialize too soon. My
|
||||
# zsh config is particular about load order.
|
||||
config.my.home.xdg.configFile."zsh/extra.zshrc".text =
|
||||
let aliasLines = mapAttrsToList (n: v: "alias ${n}=\"${v}\"") config.my.alias;
|
||||
in ''
|
||||
# This file is autogenerated, do not edit it!
|
||||
${concatStringsSep "\n" aliasLines}
|
||||
${config.my.zsh.rc}
|
||||
'';
|
||||
config.my.home.xdg.configFile."zsh/extra.zshenv".text = ''
|
||||
# This file is autogenerated, do not edit it!
|
||||
${config.my.zsh.env};
|
||||
'';
|
||||
|
||||
## PATH should always start with its old value
|
||||
config.my.env.PATH = [ "$PATH" ];
|
||||
}
|
108
options/my.nix
108
options/my.nix
|
@ -1,108 +0,0 @@
|
|||
{ config, options, lib, utils, pkgs, ... }:
|
||||
|
||||
with lib;
|
||||
{
|
||||
imports = [ <home-manager/nixos> ];
|
||||
|
||||
options.my = {
|
||||
username = mkOption {
|
||||
type = types.str;
|
||||
default = "hlissner";
|
||||
};
|
||||
|
||||
email = mkOption {
|
||||
type = types.str;
|
||||
default = "henrik@lissner.net";
|
||||
};
|
||||
|
||||
home = mkOption {
|
||||
type = options.home-manager.users.type.functor.wrapped;
|
||||
default = {};
|
||||
description = "A convenience alias for home-manager.users.{my.username}.";
|
||||
};
|
||||
|
||||
user = mkOption {
|
||||
type = types.submodule;
|
||||
default = {};
|
||||
description = "A convenience alias for users.users.{my.username}.";
|
||||
};
|
||||
|
||||
env = mkOption {
|
||||
type = with types; attrsOf (either (either str path) (listOf (either str path)));
|
||||
default = {};
|
||||
description = ''
|
||||
An map of environment variables that are set later than
|
||||
environment.variables or environment.sessionVariables. This is insurance
|
||||
that XDG variables (and other essentials) are initialized by the time
|
||||
these are set.
|
||||
'';
|
||||
apply = mapAttrs
|
||||
(n: v: if isList v
|
||||
then concatMapStringsSep ":" (x: toString x) v
|
||||
else (toString v));
|
||||
};
|
||||
|
||||
alias = mkOption {
|
||||
type = with types; nullOr (attrsOf (nullOr (either str path)));
|
||||
default = {};
|
||||
description = "Shell-independent aliases for interactive shells.";
|
||||
};
|
||||
|
||||
packages = mkOption {
|
||||
type = types.listOf types.package;
|
||||
default = [];
|
||||
description = "The set of packages to appear in the user environment.";
|
||||
};
|
||||
|
||||
init = mkOption {
|
||||
type = types.lines;
|
||||
default = "";
|
||||
description = ''
|
||||
An init script that runs after the environment has been rebuilt or
|
||||
booted. Anything done here should be idempotent and inexpensive.
|
||||
'';
|
||||
};
|
||||
|
||||
zsh = {
|
||||
rc = mkOption {
|
||||
type = types.lines;
|
||||
default = "";
|
||||
description = ''
|
||||
Zsh lines to be written to $XDG_CONFIG_HOME/zsh/extra.zshrc and
|
||||
sourced by $XDG_CONFIG_HOME/zsh/.zshrc
|
||||
'';
|
||||
};
|
||||
env = mkOption {
|
||||
type = types.lines;
|
||||
default = "";
|
||||
description = ''
|
||||
Zsh lines to be written to $XDG_CONFIG_HOME/zsh/extra.zshenv and
|
||||
sourced by $XDG_CONFIG_HOME/zsh/.zshenv
|
||||
'';
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
config = {
|
||||
users.users.${config.my.username} = mkAliasDefinitions options.my.user;
|
||||
home-manager.users.${config.my.username} = mkAliasDefinitions options.my.home;
|
||||
|
||||
my.user.packages = config.my.packages;
|
||||
my.env.PATH = [ "$PATH" ];
|
||||
|
||||
environment.extraInit =
|
||||
let exportLines = mapAttrsToList (n: v: "export ${n}=\"${v}\"") config.my.env;
|
||||
in ''
|
||||
${concatStringsSep "\n" exportLines}
|
||||
${config.my.init}
|
||||
'';
|
||||
|
||||
my.home.xdg.configFile."zsh/extra.zshrc".text =
|
||||
let aliasLines = mapAttrsToList (n: v: "alias ${n}=\"${v}\"") config.my.alias;
|
||||
in ''
|
||||
${concatStringsSep "\n" aliasLines}
|
||||
${config.my.zsh.rc}
|
||||
'';
|
||||
my.home.xdg.configFile."zsh/extra.zshenv".text = config.my.zsh.env;
|
||||
};
|
||||
}
|
24
overlays.nix
Normal file
24
overlays.nix
Normal file
|
@ -0,0 +1,24 @@
|
|||
[
|
||||
(self: super: with super; {
|
||||
my = {
|
||||
linode-cli = (callPackage ./packages/linode-cli.nix {});
|
||||
ripcord = (callPackage ./packages/ripcord.nix {});
|
||||
zunit = (callPackage ./packages/zunit.nix {});
|
||||
cached-nix-shell =
|
||||
(callPackage
|
||||
(builtins.fetchTarball
|
||||
https://github.com/xzfc/cached-nix-shell/archive/master.tar.gz) {});
|
||||
};
|
||||
|
||||
nur = import (builtins.fetchTarball "https://github.com/nix-community/NUR/archive/master.tar.gz") {
|
||||
inherit super;
|
||||
};
|
||||
|
||||
# Occasionally, "stable" packages are broken or incomplete, so access to the
|
||||
# bleeding edge is necessary, as a last resort.
|
||||
unstable = import <nixpkgs-unstable> { inherit config; };
|
||||
})
|
||||
|
||||
# emacsGit
|
||||
(import (builtins.fetchTarball https://github.com/nix-community/emacs-overlay/archive/master.tar.gz))
|
||||
]
|
Loading…
Reference in a new issue