Major refactor

This commit is contained in:
Henrik Lissner 2020-01-17 04:22:50 -05:00
parent 740046f3f0
commit c7e6da3f73
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395
41 changed files with 579 additions and 569 deletions

View file

@ -1,8 +1,9 @@
NIXOS_VERSION := 19.09 NIXOS_VERSION := 19.09
NIXOS_PREFIX := $(PREFIX)/etc/nixos NIXOS_PREFIX := $(PREFIX)/etc/nixos
FLAGS := -I "my=$(PWD)" $(FLAGS)
COMMAND := test COMMAND := test
FLAGS := -I "nixpkgs-overlays=$$(pwd)/overlays.nix" \
-I "config=$$(pwd)/config" \
-I "modules=$$(pwd)/modules" $(FLAGS)
# The real Labowski # The real Labowski
all: channels all: channels
@ -36,7 +37,7 @@ channels:
$(NIXOS_PREFIX)/configuration.nix: $(NIXOS_PREFIX)/configuration.nix:
@sudo nixos-generate-config --root "$(PREFIX)" @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 # Convenience aliases
@ -45,4 +46,4 @@ s: switch
up: upgrade up: upgrade
.PHONY: update config channels test upgrade install .PHONY: config

View file

@ -1,8 +1,5 @@
export ZGEN_DIR="$XDG_CACHE_HOME/zgen" ## Auto-generated by my nix config
export ZGEN_SOURCE="$ZGEN_DIR/zgen.zsh" [ -f "${0:a:h}/extra.zshenv" ] && source "${0:a:h}/extra.zshenv"
## TODO
source $ZDOTDIR/extra.zshenv
# If you have host-local configuration, this is where you'd put it # If you have host-local configuration, this is where you'd put it
[ -f ~/.zshenv ] && source ~/.zshenv [ -f ~/.zshenv ] && source ~/.zshenv

View file

@ -1,26 +1,21 @@
[ -d "$ZGEN_DIR" ] || \ export ZGEN_DIR="$XDG_CACHE_HOME/zgen"
git clone https://github.com/tarjoilija/zgen "$ZGEN_DIR" export ZGEN_SOURCE="$ZGEN_DIR/zgen.zsh"
source $ZGEN_SOURCE
[ -d "$ZGEN_DIR" ] || git clone https://github.com/tarjoilija/zgen "$ZGEN_DIR"
source $ZGEN_SOURCE
if ! zgen saved; then if ! zgen saved; then
echo "Initializing zgen" echo "Initializing zgen"
zgen load hlissner/zsh-autopair autopair.zsh zgen load hlissner/zsh-autopair autopair.zsh
zgen load zsh-users/zsh-history-substring-search zgen load zsh-users/zsh-history-substring-search
zgen load zdharma/history-search-multi-word zgen load zdharma/history-search-multi-word
zgen load zsh-users/zsh-completions src zgen load zsh-users/zsh-completions src
zgen load junegunn/fzf shell zgen load junegunn/fzf shell
[ -z "$SSH_CONNECTION" ] && zgen load zdharma/fast-syntax-highlighting
if [ -z "$SSH_CONNECTION" ]; then
zgen load zdharma/fast-syntax-highlighting
fi
zgen save zgen save
fi fi
source $ZDOTDIR/config.zsh source $ZDOTDIR/config.zsh
if [[ $TERM != dumb ]]; then if [[ $TERM != dumb ]]; then
source $ZDOTDIR/prompt.zsh
source $ZDOTDIR/keybinds.zsh source $ZDOTDIR/keybinds.zsh
source $ZDOTDIR/completion.zsh source $ZDOTDIR/completion.zsh
source $ZDOTDIR/aliases.zsh source $ZDOTDIR/aliases.zsh
@ -47,7 +42,7 @@ if [[ $TERM != dumb ]]; then
fi fi
_cache fasd --init posix-alias zsh-{hook,{c,w}comp{,-install}} _cache fasd --init posix-alias zsh-{hook,{c,w}comp{,-install}}
## TODO ## Auto-generated by my nix config
source $ZDOTDIR/extra.zshrc source $ZDOTDIR/extra.zshrc
## ##

View file

@ -1,4 +1,4 @@
# ... # default.nix --- my dotfile bootstrapper
device: device:
{ pkgs, options, lib, config, ... }: { pkgs, options, lib, config, ... }:
@ -6,39 +6,27 @@ device:
networking.hostName = lib.mkDefault device; networking.hostName = lib.mkDefault device;
imports = [ imports = [
<nixpkgs/nixos/modules/installer/scan/not-detected.nix> ./options.nix
/etc/nixos/hardware-configuration.nix "${./hosts}/${device}"
./options/my.nix
"${./machines}/${device}.nix"
]; ];
### ### NixOS
nix = { nix.autoOptimiseStore = true;
nixPath = options.nix.nixPath.default ++ [ nix.nixPath = options.nix.nixPath.default ++ [
"my=/etc/dotfiles" # So we can use absolute import paths
]; "config=/etc/dotfiles/config"
autoOptimiseStore = true; "modules=/etc/dotfiles/modules"
trustedUsers = [ "root" ]; # We define nixpkgs-overlays so our overlays will be available to
}; # nix-shell/nix-build outside of rebuilding...
"nixpkgs-overlays=/etc/dotfiles/overlays.nix"
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) {})
]; ];
# ...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
# 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 # This value determines the NixOS release with which your system is to be
# compatible, in order to avoid breaking some software such as database # compatible, in order to avoid breaking some software such as database

7
deploy Normal file → Executable file
View file

@ -8,7 +8,7 @@ if [ $EUID -nq 0 ]; then
fi fi
USER=${USER:-hlissner} USER=${USER:-hlissner}
HOST=${1:-${HOST:-kuro}} HOST=${1:-${HOST:-$(hostname)}}
DOTFILES="/home/$USER/.dotfiles" DOTFILES="/home/$USER/.dotfiles"
if [ ! -d /etc/dotfiles ]; then if [ ! -d /etc/dotfiles ]; then
@ -21,9 +21,4 @@ if [ ! -f "$DOTFILES/machines/$HOST.nix" ]; then
>&2 echo "No configuration exists for host '$HOST'" >&2 echo "No configuration exists for host '$HOST'"
exit 1 exit 1
fi fi
if [ -n "$LINODE" ]; then
ARGS="\"$HOST\""
HOST=linode
fi
make -C "$DOTFILES" install make -C "$DOTFILES" install

View file

@ -5,10 +5,12 @@
imports = [ imports = [
./. # import common settings ./. # import common settings
<my/modules/services/ssh.nix> <modules/shell/zsh.nix>
./modules/services/plex.nix
# <my/modules/services/jellyfin.nix> <modules/services/ssh.nix>
<my/modules/shell/zsh.nix> <modules/services/plex.nix>
# <modules/services/jellyfin.nix>
<modules/services/syncthing.nix>
]; ];
networking.networkmanager.enable = true; networking.networkmanager.enable = true;

View file

@ -1,17 +1,17 @@
# Ao -- my home development and user-facing server # Ao -- my home development and user-facing server
{ config, ... }: { pkgs, config, ... }:
{ {
imports = [ imports = [
./. # import common settings ./. # import common settings
<my/modules/services/ssh.nix> <modules/services/ssh.nix>
<my/modules/services/nginx.nix> <modules/services/nginx.nix>
<my/modules/services/gitea.nix> <modules/services/gitea.nix>
<my/modules/services/syncthing.nix> <modules/services/syncthing.nix>
<my/modules/shell/git.nix> <modules/shell/git.nix>
<my/modules/shell/zsh.nix> <modules/shell/zsh.nix>
]; ];
networking.networkmanager.enable = true; networking.networkmanager.enable = true;
@ -155,4 +155,18 @@
SSH_DOMAIN = v0.io 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
View 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
View 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";
}

View 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"; } ];
}

View file

@ -33,11 +33,11 @@
with pkgs; [ inetutils mtr sysstat git ]; with pkgs; [ inetutils mtr sysstat git ];
imports = [ imports = [
../. ./.
<my/modules/editors/vim.nix> <modules/editors/vim.nix>
<my/modules/shell/git.nix> <modules/shell/git.nix>
<my/modules/shell/zsh.nix> <modules/shell/zsh.nix>
<my/modules/services/ssh.nix> <modules/services/ssh.nix>
]; ];
# GRUB # GRUB
@ -62,6 +62,4 @@
networking.useDHCP = false; networking.useDHCP = false;
networking.usePredictableInterfaceNames = false; networking.usePredictableInterfaceNames = false;
networking.interfaces.eth0.useDHCP = true; networking.interfaces.eth0.useDHCP = true;
time.timeZone = "America/Toronto";
} }

View file

@ -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 # Nothing in /tmp should survive a reboot
boot.tmpOnTmpfs = true; boot.tmpOnTmpfs = true;
# Use simple bootloader; I prefer the on-demand BIOs boot menu # Use simple bootloader; I prefer the on-demand BIOs boot menu
boot.loader.systemd-boot.enable = true; boot.loader.systemd-boot.enable = true;
boot.loader.efi.canTouchEfiVariables = 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 ### Universal defaults
networking.firewall.enable = true; 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. ### A tidy $HOME is a tidy mind.
# Obey XDG conventions; # Obey XDG conventions;
@ -57,7 +39,6 @@
XDG_DATA_HOME = "$HOME/.local/share"; XDG_DATA_HOME = "$HOME/.local/share";
XDG_BIN_HOME = "$HOME/.local/bin"; XDG_BIN_HOME = "$HOME/.local/bin";
}; };
# Conform more programs to XDG conventions. The rest are handled by their # Conform more programs to XDG conventions. The rest are handled by their
# respective modules. # respective modules.
my.env = { my.env = {

57
hosts/shiro/default.nix Normal file
View 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;
}
];
}

View file

@ -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 = "...";
# };
};
};
}

View file

@ -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;
};
}

View file

@ -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;
}
];
}

View file

@ -9,11 +9,11 @@
my.env.BROWSER = "qutebrowser"; my.env.BROWSER = "qutebrowser";
my.home.xdg = { my.home.xdg = {
configFile."qutebrowser" = { configFile."qutebrowser" = {
source = <my/config/qutebrowser>; source = <config/qutebrowser>;
recursive = true; recursive = true;
}; };
dataFile."qutebrowser/greasemonkey" = { dataFile."qutebrowser/greasemonkey" = {
source = <my/config/qutebrowser/greasemonkey>; source = <config/qutebrowser/greasemonkey>;
recursive = true; recursive = true;
}; };
}; };

View file

@ -3,7 +3,7 @@
# Even neckbeards have a social life. Not that I have one. A neckbeard, I mean. # 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. # But when I do have either, then discord and weechat are my go-to.
{ config, lib, pkgs, ... }: { pkgs, ... }:
{ {
my.packages = with pkgs; [ my.packages = with pkgs; [
# weechat # TODO For the real neckbeards # weechat # TODO For the real neckbeards

View 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 {});
}

View file

@ -2,10 +2,10 @@
{ {
my = { my = {
env.PATH = [ <my/config/rofi/bin> ]; env.PATH = [ <config/rofi/bin> ];
# link recursively so other modules can link files in its folder # link recursively so other modules can link files in its folder
home.xdg.configFile."rofi" = { home.xdg.configFile."rofi" = {
source = <my/config/rofi>; source = <config/rofi>;
recursive = true; recursive = true;
}; };
@ -18,21 +18,21 @@
# Fake rofi dmenu entries # Fake rofi dmenu entries
(makeDesktopItem { (makeDesktopItem {
name = "rofi-browsermenu"; name = "rofi-browsermenu";
desktopName = "Open Bookmark in Firefox"; desktopName = "Open Bookmark in Browser";
icon = "bookmark-new-symbolic"; icon = "bookmark-new-symbolic";
exec = "${<my/config/rofi>}/bin/rofi-browsermenu"; exec = "${<config/rofi>}/bin/rofi-browsermenu";
}) })
(makeDesktopItem { (makeDesktopItem {
name = "rofi-filemenu"; name = "rofi-filemenu";
desktopName = "Open Directory in Terminal"; desktopName = "Open Directory in Terminal";
icon = "folder"; icon = "folder";
exec = "${<my/config/rofi>}/bin/rofi-filemenu"; exec = "${<config/rofi>}/bin/rofi-filemenu";
}) })
(makeDesktopItem { (makeDesktopItem {
name = "rofi-filemenu-scratch"; name = "rofi-filemenu-scratch";
desktopName = "Open Directory in Scratch Terminal"; desktopName = "Open Directory in Scratch Terminal";
icon = "folder"; icon = "folder";
exec = "${<my/config/rofi>}/bin/rofi-filemenu -x"; exec = "${<config/rofi>}/bin/rofi-filemenu -x";
}) })
(makeDesktopItem { (makeDesktopItem {

View file

@ -2,14 +2,14 @@
{ {
imports = [ imports = [
./.
# My launcher # My launcher
./rofi.nix ./apps/rofi.nix
# I often need a thumbnail browser to show off, peruse or organize photos, # I often need a thumbnail browser to show off, peruse or organize photos,
# design work, or digital art. # design work, or digital art.
./thunar.nix ./apps/thunar.nix
./apps/redshift.nix
]; ];
environment.systemPackages = with pkgs; [ environment.systemPackages = with pkgs; [
@ -21,56 +21,11 @@
pulseSupport = true; pulseSupport = true;
nlSupport = 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 = { services = {
xserver = { xserver = {
enable = true;
desktopManager.xterm.enable = false; desktopManager.xterm.enable = false;
windowManager.bspwm.enable = true; windowManager.bspwm.enable = true;
displayManager.lightdm = { displayManager.lightdm = {
@ -81,55 +36,19 @@
}; };
}; };
}; };
compton.enable = true;
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"
];
};
}; };
# For polybar # For polybar
fonts.fonts = [ pkgs.siji ];
my = { my = {
env.PATH = [ <my/config/bspwm/bin> ]; env.PATH = [ <config/bspwm/bin> ];
home.xdg.configFile = { home.xdg.configFile = {
"sxhkd".source = <my/config/sxhkd>; "sxhkd".source = <config/sxhkd>;
# link recursively so other modules can link files in their folders # link recursively so other modules can link files in their folders
"bspwm" = { "bspwm" = {
source = <my/config/bspwm>; source = <config/bspwm>;
recursive = true; 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
'';
} }

View file

@ -1,17 +1,115 @@
{ config, lib, pkgs, ... }: { config, lib, pkgs, ... }:
{ {
my.packages = with pkgs; [ services.compton = {
libqalculate backend = "glx";
xclip vSync = true;
xdotool opacityRules = [
mpv # video player "100:class_g = 'Firefox'"
feh # image viewer "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"
];
};
# Useful apps my = {
calibre # managing my ebooks env.XAUTHORITY = "/tmp/Xauthority";
evince # pdf reader init = "[ -e ~/.Xauthority ] && mv -f ~/.Xauthority \"$XAUTHORITY\"";
packages = with pkgs; [
libqalculate
xclip
xdotool
mpv # video player
feh # image viewer
# 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; sound.enable = true;
hardware.pulseaudio.enable = true; hardware.pulseaudio.enable = true;
@ -28,38 +126,4 @@
in lib.mkIf config.hardware.pulseaudio.enable in lib.mkIf config.hardware.pulseaudio.enable
"${paConfigFile}/default.pa"; "${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"];
};
};
} }

View file

@ -26,7 +26,7 @@
env.PYTHON_EGG_CACHE = "$XDG_CACHE_HOME/python-eggs"; env.PYTHON_EGG_CACHE = "$XDG_CACHE_HOME/python-eggs";
env.JUPYTER_CONFIG_DIR = "$XDG_CONFIG_HOME/jupyter"; 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.py = "python";
alias.py2 = "python2"; alias.py2 = "python2";

View file

@ -9,6 +9,6 @@
{ {
my.packages = with pkgs; [ my.packages = with pkgs; [
shellcheck shellcheck
(callPackage (import <my/packages/zunit.nix> {})) my.zunit
]; ];
} }

View file

@ -42,7 +42,7 @@
]; ];
env.PATH = [ "$HOME/.emacs.d/bin" ]; 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 # My emacs config is too stateful to manage with nix
init = '' init = ''

View file

@ -19,7 +19,7 @@
]; ];
home.xdg.configFile = { home.xdg.configFile = {
"GIMP/2.10" = { source = <my/config/gimp>; recursive = true; }; "GIMP/2.10" = { source = <config/gimp>; recursive = true; };
}; };
}; };
} }

View file

@ -1,6 +0,0 @@
{ config, lib, pkgs, ... }:
{
my.packages = [ pkgs.teensy-loader-cli ];
my.alias.teensyload = "sudo teensy-loader-cli -w -v --mcu=atmega32u4";
}

View file

@ -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"
'')
];
}

View file

@ -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
# '';
}

View file

@ -3,7 +3,7 @@
{ config, lib, pkgs, ... }: { config, lib, pkgs, ... }:
{ {
services.jellyfin = { enable = true; }; services.jellyfin.enable = true;
networking.firewall = { networking.firewall = {
allowedTCPPorts = [ 8096 ]; allowedTCPPorts = [ 8096 ];

View file

@ -6,11 +6,11 @@
gitAndTools.hub gitAndTools.hub
gitAndTools.diff-so-fancy 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 # Do recursively, in case git stores files in this folder
home.xdg.configFile = { home.xdg.configFile = {
"git/config".source = <my/config/git/config>; "git/config".source = <config/git/config>;
"git/ignore".source = <my/config/git/ignore>; "git/ignore".source = <config/git/ignore>;
}; };
}; };
} }

View file

@ -13,7 +13,7 @@
my.alias.mpcsp = "mpc searchplay any"; my.alias.mpcsp = "mpc searchplay any";
my.home.xdg.configFile = { my.home.xdg.configFile = {
"ncmpcpp/config".source = <my/config/ncmpcpp/config>; "ncmpcpp/config".source = <config/ncmpcpp/config>;
"ncmpcpp/bindings".source = <my/config/ncmpcpp/bindings>; "ncmpcpp/bindings".source = <config/ncmpcpp/bindings>;
}; };
} }

View file

@ -19,8 +19,8 @@
zsh.rc = '' zsh.rc = ''
_cache tmuxifier init - _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; };
}; };
} }

View file

@ -1,8 +1,7 @@
{ config, pkgs, libs, ... }: # modules/shell/zsh.nix --- ...
{ pkgs, libs, ... }:
{ {
imports = [ ./tmux.nix ];
my = { my = {
packages = with pkgs; [ packages = with pkgs; [
zsh zsh
@ -19,22 +18,29 @@
env.ZDOTDIR = "$XDG_CONFIG_HOME/zsh"; env.ZDOTDIR = "$XDG_CONFIG_HOME/zsh";
env.ZSH_CACHE = "$XDG_CACHE_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.exa = "exa --group-directories-first";
alias.l = "exa -1"; alias.l = "exa -1";
alias.ll = "exa -l"; alias.ll = "exa -l";
alias.la = "LC_COLLATE=C exa -la"; 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 = { programs.zsh = {
enable = true; enable = true;
enableCompletion = 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 = ""; promptInit = "";
}; };
system.userActivationScripts.cleanupZgen = ''
rm -fv $XDG_CACHE_HOME/zsh/*
'';
} }

View file

@ -1,6 +1,6 @@
# modules/themes/aquanaut/default.nix --- a sea-blue linux theme # modules/themes/aquanaut/default.nix --- a sea-blue linux theme
{ config, pkgs, ... }: { config, lib, pkgs, ... }:
{ {
imports = [ ../. ]; # Load framework for themes imports = [ ../. ]; # Load framework for themes
@ -32,6 +32,7 @@
nordic nordic
paper-icon-theme # for rofi paper-icon-theme # for rofi
]; ];
my.zsh.rc = lib.readFile ./zsh/prompt.zsh;
my.home.xdg.configFile = { my.home.xdg.configFile = {
"bspwm/rc.d/polybar".source = ./polybar/run.sh; "bspwm/rc.d/polybar".source = ./polybar/run.sh;
"bspwm/rc.d/theme".source = ./bspwmrc; "bspwm/rc.d/theme".source = ./bspwmrc;
@ -40,7 +41,6 @@
"rofi/theme" = { source = ./rofi; recursive = true; }; "rofi/theme" = { source = ./rofi; recursive = true; };
"tmux/theme".source = ./tmux.conf; "tmux/theme".source = ./tmux.conf;
"xtheme/90-theme".source = ./Xresources; "xtheme/90-theme".source = ./Xresources;
"zsh/prompt.zsh".source = ./zsh/prompt.zsh;
# GTK # GTK
"gtk-3.0/settings.ini".text = '' "gtk-3.0/settings.ini".text = ''
[Settings] [Settings]

View file

@ -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. # Try really hard to get QT to respect my GTK theme.
my.env = { my.env.GTK_DATA_PREFIX = [ "${config.system.path}" ];
GTK_DATA_PREFIX = [ "${config.system.path}" ]; my.env.QT_QPA_PLATFORMTHEME = "gtk2";
QT_QPA_PLATFORMTHEME = "gtk2"; qt5 = { style = "gtk2"; platformTheme = "gtk2"; };
};
qt5 = {
style = "gtk2";
platformTheme = "gtk2";
};
services.xserver.displayManager.sessionCommands = '' services.xserver.displayManager.sessionCommands = ''
export GTK2_RC_FILES="$XDG_CONFIG_HOME/gtk-2.0/gtkrc" export GTK2_RC_FILES="$XDG_CONFIG_HOME/gtk-2.0/gtkrc"
source "$XDG_CONFIG_HOME"/xsession/*.sh source "$XDG_CONFIG_HOME"/xsession/*.sh

View file

@ -1,19 +1,17 @@
{ config, options, lib, pkgs, ... }: # modules/themes/options.nix
{ options, config, lib, pkgs, ... }:
with lib; with lib;
{ {
options.theme = { options.theme = {
wallpaper = mkOption { wallpaper = mkOption {
type = with types; nullOr (either str path); type = with types; nullOr (either str path);
default = null;
description = "The wallpaper to use";
}; };
# TODO Colors? # TODO Colors?
}; };
config = { config = {
# Set up wallpaper and blur/darken it for lock/login screen
my.home.home.file.".background-image".source = config.theme.wallpaper; my.home.home.file.".background-image".source = config.theme.wallpaper;
services.xserver.displayManager.lightdm.background = services.xserver.displayManager.lightdm.background =
let blurredWallpaper = let blurredWallpaper =

90
options.nix Normal file
View 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" ];
}

View file

@ -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
View 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))
]