Compare commits

...

13 Commits

16 changed files with 168 additions and 58 deletions

View File

@ -77,7 +77,6 @@
matrix-synapse-next, matrix-synapse-next,
maunium-stickerpicker, maunium-stickerpicker,
minecraft, minecraft,
nix-attr-search,
osuchan, osuchan,
secrets, secrets,
sops-nix, sops-nix,
@ -95,9 +94,11 @@
}; };
overlays = let overlays = let
nonrecursive-unstable-pkgs = nixpkgs-unstable.legacyPackages.${system}; nonrecursive-unstable-pkgs = import nixpkgs-unstable {
inherit system;
config.allowUnfree = true;
};
in [ in [
(self: super: { kanidm = nonrecursive-unstable-pkgs.kanidm; })
(self: super: { pgadmin4 = nonrecursive-unstable-pkgs.pgadmin4; }) (self: super: { pgadmin4 = nonrecursive-unstable-pkgs.pgadmin4; })
# (self: super: { pcloud = nonrecursive-unstable-pkgs.pcloud; }) # (self: super: { pcloud = nonrecursive-unstable-pkgs.pcloud; })
osuchan.overlays.default osuchan.overlays.default
@ -106,11 +107,6 @@
ffmpeg = super.ffmpeg_6-full; ffmpeg = super.ffmpeg_6-full;
}; };
}) })
# (self: super: {
# systemd = super.systemd.overrideAttrs (final: prev: {
# mesonFlags = prev.mesonFlags ++ [ "-Dsystemd-socket-proxyd=true" ];
# });
# })
]; ];
}; };
@ -195,15 +191,12 @@
extraSpecialArgs = { extraSpecialArgs = {
inherit inputs; inherit inputs;
inherit (self) extendedLib; inherit (self) extendedLib;
inherit (config) machineVars;
secrets = secrets.outputs.settings; secrets = secrets.outputs.settings;
}; };
users.h7x4 = import ./home/home.nix { users.h7x4 = {
inherit pkgs; imports = [ ./home/home.nix ];
inherit inputs;
inherit (pkgs) lib;
inherit (config) machineVars;
inherit (self) extendedLib;
}; };
}; };
}) })

View File

@ -1,6 +1,6 @@
{ pkgs, config, ... }: { pkgs, config, machineVars, ... }:
{ {
gtk = pkgs.lib.mkIf (!config.machineVars.headless) { gtk = pkgs.lib.mkIf (!machineVars.headless) {
enable = true; enable = true;
font = { font = {
name = "Droid Sans"; name = "Droid Sans";

View File

@ -4,6 +4,7 @@
"ntnu" = { "ntnu" = {
user = "oysteikt"; user = "oysteikt";
hostname = "login.stud.ntnu.no"; hostname = "login.stud.ntnu.no";
proxyJump = "pvv";
}; };
"gitlab.stud.idi.ntnu.no" = { "gitlab.stud.idi.ntnu.no" = {
user = "git"; user = "git";

View File

@ -1,6 +1,9 @@
{ config, ... }: { config, ... }:
{ {
imports = [ ./mimetypes.nix ]; imports = [
./mimetypes.nix
./directory-spec-overrides.nix
];
xdg = { xdg = {
enable = true; enable = true;
userDirs = { userDirs = {

View File

@ -0,0 +1,63 @@
{ config, pkgs, lib, ... }:
{
nix.settings.use-xdg-base-directories = true;
home.sessionVariables = let
inherit (config.xdg) dataHome cacheHome configHome userDirs;
in {
TEXMFHOME = "${dataHome}/texmf";
TEXMFVAR = "${cacheHome}/texlive";
TEXMFCONFIG = "${configHome}/texlive";
PSQL_HISTORY = "${dataHome}/psql_history";
SQLITE_HISTORY= "${dataHome}/sqlite_history";
MYSQL_HISTFILE = "${dataHome}/mysql_history";
NODE_REPL_HISTORY = "${dataHome}/node_repl_history";
GDB_HISTFILE = "${dataHome}/gdb_history";
PYTHON_HISTORY = "${dataHome}/python_history";
GHCUP_USE_XDG_DIRS = "true";
ANDROID_USER_HOME = "${dataHome}/android";
AZURE_CONFIG_DIR = "${dataHome}/azure";
CARGO_HOME = "${dataHome}/cargo";
CUDA_CACHE_PATH = "${cacheHome}/nv";
DOCKER_CONFIG = "${configHome}/docker";
DOTNET_CLI_HOME = "${dataHome}/dotnet";
DOT_SAGE = "${configHome}/sagemath";
ELM_HOME = "${configHome}/";
GOPATH = "${dataHome}/go";
GRADLE_USER_HOME = "${dataHome}/gradle";
ICEAUTHORITY = "${cacheHome}/ICEauthority";
NIMBLE_DIR = "${dataHome}/nimble";
NLTK_DATA = "${dataHome}/nltk_data";
NRFUTIL_HOME = "${dataHome}/nrfutil";
NUGET_PACKAGES = "${cacheHome}/nuget-packages";
PARALLEL_HOME = "${configHome}/parallel";
PYENV_ROOT = "${dataHome}/pyenv";
RUSTUP_HOME = "${dataHome}/rustup";
STACK_ROOT = "${dataHome}/stack";
W3M_DIR = "${dataHome}/w3m";
WINEPREFIX = "${dataHome}/wine";
# TODO: these needs to be set before the user session has fully initialized
# XINITRC = "$XDG_CONFIG_HOME/x11/initrc";
# XAUTHORITY
# ERRFILE = "${cacheHome}/X11/xsession-errors";
# USERXSESSION
# XCOMPOSECACHE="${cacheHome}/X11/xcompose";
# XCURSOR_PATH
};
xdg.configFile = {
"npm/npmrc".text = ''
prefix=${config.xdg.dataHome}/npm
cache=${config.xdg.cacheHome}/npm
init-module=${config.xdg.configHome}/npm/config/npm-init.js
'';
"bpython/config".text = ''
[general]
hist_file = ${config.xdg.dataHome}/bpython_history
'';
};
}

View File

@ -1,9 +1,7 @@
{ pkgs, lib, extendedLib, inputs, machineVars, ... } @ args: let { config, pkgs, lib, extendedLib, inputs, machineVars, ... } @ args: let
inherit (lib) mkForce mkIf optionals; inherit (lib) mkForce mkIf optionals;
graphics = !machineVars.headless; graphics = !machineVars.headless;
in { in {
inherit machineVars;
imports = [ imports = [
./shell.nix ./shell.nix
./packages.nix ./packages.nix
@ -26,7 +24,6 @@ in {
./programs/tmux.nix ./programs/tmux.nix
./programs/zsh ./programs/zsh
../modules/machineVars.nix
./modules/colors.nix ./modules/colors.nix
./modules/shellAliases.nix ./modules/shellAliases.nix
] ++ optionals graphics [ ] ++ optionals graphics [
@ -46,34 +43,24 @@ in {
./services/mpd.nix ./services/mpd.nix
./services/picom.nix ./services/picom.nix
./services/polybar.nix ./services/polybar.nix
./services/screen-locker.nix
./services/stalonetray.nix ./services/stalonetray.nix
./services/sxhkd.nix ./services/sxhkd.nix
./services/copyq.nix ./services/copyq.nix
]; ];
nix.settings = {
use-xdg-base-directories = true;
};
home = { home = {
stateVersion = "22.05"; stateVersion = "22.05";
username = "h7x4"; username = "h7x4";
homeDirectory = "/home/h7x4"; homeDirectory = "/home/h7x4";
file = {
".ghci".text = ''
:set prompt "${extendedLib.termColors.front.magenta "[GHCi]λ"} ".
'';
".pyrc".text = '' sessionPath = [
#!/usr/bin/env python3 "$HOME/.local/bin"
import sys ];
# You also need \x01 and \x02 to separate escape sequence, due to:
# https://stackoverflow.com/a/9468954/1147688
sys.ps1='\x01\x1b${extendedLib.termColors.front.blue "[Python]> "}\x02>>>\x01\x1b[0m\x02 ' # bright yellow
sys.ps2='\x01\x1b[1;49;31m\x02...\x01\x1b[0m\x02 ' # bright red
'';
};
sessionVariables = {
TEXMFHOME = "$HOME/documents/texmf";
};
pointerCursor = mkIf graphics { pointerCursor = mkIf graphics {
package = pkgs.capitaine-cursors; package = pkgs.capitaine-cursors;
@ -82,6 +69,26 @@ in {
}; };
keyboard.options = [ "caps:escape" ]; keyboard.options = [ "caps:escape" ];
sessionVariables = {
PYTHONSTARTUP = "${config.xdg.configHome}/python/pyrc";
};
};
xdg.configFile = {
"ghc/ghci.conf".text = ''
:set prompt "${extendedLib.termColors.front.magenta "[GHCi]λ"} "
'';
"python/pyrc".text = ''
#!/usr/bin/env python3
import sys
# You also need \x01 and \x02 to separate escape sequence, due to:
# https://stackoverflow.com/a/9468954/1147688
sys.ps1='\x01\x1b${extendedLib.termColors.front.blue "[Python]> "}\x02>>>\x01\x1b[0m\x02 ' # bright yellow
sys.ps2='\x01\x1b[1;49;31m\x02...\x01\x1b[0m\x02 ' # bright red
'';
}; };
news.display = "silent"; news.display = "silent";
@ -91,8 +98,17 @@ in {
programs = { programs = {
home-manager.enable = true; home-manager.enable = true;
bash = {
enable = true;
historyFile = "${config.xdg.dataHome}/bash_history";
historySize = 100000;
};
bat.enable = true; bat.enable = true;
bottom.enable = true; bottom = {
enable = true;
settings.flags.enable_gpu = true;
};
eza.enable = true; eza.enable = true;
feh.enable = mkIf graphics true; feh.enable = mkIf graphics true;
fzf = { fzf = {

View File

@ -1,8 +1,8 @@
{ pkgs, config, ... }: let { pkgs, config, machineVars, ... }:
inherit (config) machineVars; {
in {
home.packages = with pkgs; [ home.packages = with pkgs; [
beets beets
binutils
cloc cloc
czkawka czkawka
delta delta
@ -22,6 +22,7 @@ in {
lolcat lolcat
mdcat mdcat
mediainfo mediainfo
meli
mkvtoolnix mkvtoolnix
mmv mmv
mtr mtr
@ -65,7 +66,7 @@ in {
# Needed for VSCode liveshare # Needed for VSCode liveshare
desktop-file-utils desktop-file-utils
krb5 # krb5
zlib zlib
icu icu
openssl openssl
@ -78,7 +79,7 @@ in {
birdtray birdtray
calibre calibre
cool-retro-term cool-retro-term
# darktable darktable
discord discord
element-desktop element-desktop
geogebra geogebra
@ -115,7 +116,7 @@ in {
# swiPrologWithGui # swiPrologWithGui
sxiv sxiv
# tagainijisho # tagainijisho
teams
tenacity tenacity
thunderbird thunderbird
# transcribe # transcribe
@ -123,6 +124,7 @@ in {
xcalib xcalib
xclip xclip
xdotool xdotool
xorg.xmodmap
(xfce.thunar.override { (xfce.thunar.override {
thunarPlugins = with xfce; [ thunarPlugins = with xfce; [
thunar-volman thunar-volman

View File

@ -26,14 +26,14 @@
in in
{ {
primary = getAttrs primaryColors config.colors.defaultColorSet; primary = getAttrs primaryColors config.colors.defaultColorSet;
normal = let normal = builtins.removeAttrs config.colors.defaultColorSet (primaryColors ++ [ "name" ]);
removePrimaryColorAttrs = n: v: !(any (pc: n ? pc) primaryColors);
in filterAttrs removePrimaryColorAttrs config.colors.defaultColorSet;
}; };
cursor = { cursor = {
style = "Block"; style = {
blinking = "On"; shape = "Block";
blinking = "On";
};
unfocused_hollow = true; unfocused_hollow = true;
}; };

View File

@ -1,4 +1,4 @@
{ pkgs, config, ... }: let { config, pkgs, machineVars, ... }: let
inherit (pkgs) lib; inherit (pkgs) lib;
in { in {
programs.xmobar = let programs.xmobar = let
@ -7,8 +7,8 @@ in {
# TODO: loop over dataDrives # TODO: loop over dataDrives
disks = [ disks = [
"/" "/"
"${config.machineVars.dataDrives.default}" "${machineVars.dataDrives.default}"
"${config.machineVars.dataDrives.default}/disks/data2" "${machineVars.dataDrives.default}/disks/data2"
]; ];
mpd_status_script = pkgs.writeShellScript "mpd-status" '' mpd_status_script = pkgs.writeShellScript "mpd-status" ''

View File

@ -13,7 +13,9 @@
''; '';
# TODO: Regenerate zcompdump with a systemd timer # TODO: Regenerate zcompdump with a systemd timer
completionInit = "autoload -Uz compinit && compinit -C"; completionInit = ''
autoload -Uz compinit && compinit -C -d "${config.xdg.cacheHome}/zsh/zcompdump-$ZSH_VERSION"
'';
history = { history = {
extended = true; extended = true;

View File

@ -1,6 +1,5 @@
{ pkgs, config, ... }: let { pkgs, config, machineVars, ... }: let
colors = config.colors.defaultColorSet; colors = config.colors.defaultColorSet;
inherit (config) machineVars;
in { in {
services.polybar = { services.polybar = {
enable = true; enable = true;

View File

@ -0,0 +1,7 @@
{ config, pkgs, lib, ... }:
{
services.screen-locker = {
enable = true;
lockCmd = lib.getExe pkgs.i3lock-fancy;
};
}

View File

@ -50,6 +50,8 @@ in
# Misc # Misc
"super + l" = "loginctl lock-session";
"super + a" = "${pkgs.copyq}/bin/copyq toggle"; "super + a" = "${pkgs.copyq}/bin/copyq toggle";
# fcitx "super + {b,n,m}" = "${pkgs.fcitx}/bin/fcitx-remote -s {mozc,fcitx-keyboard-no,fcitx-keyboard-us}"; # fcitx "super + {b,n,m}" = "${pkgs.fcitx}/bin/fcitx-remote -s {mozc,fcitx-keyboard-no,fcitx-keyboard-us}";

View File

@ -22,9 +22,10 @@ in {
auto-optimise-store = true; auto-optimise-store = true;
binary-caches = [ "https://cache.nixos.org/" ]; binary-caches = [ "https://cache.nixos.org/" ];
builders-use-substitutes = true; builders-use-substitutes = true;
experimental-features = [ "nix-command" "flakes" "repl-flake" ]; experimental-features = [ "nix-command" "flakes" ];
log-lines = 50; log-lines = 50;
trusted-users = [ "h7x4" "nix-builder" ]; trusted-users = [ "h7x4" "nix-builder" ];
use-xdg-base-directories = true;
}; };
buildMachines = [ buildMachines = [
@ -86,6 +87,13 @@ in {
}; };
}; };
programs.nix-ld = {
enable = true;
libraries = with pkgs; [
libusb1
];
};
programs.ssh = { programs.ssh = {
extraConfig = '' extraConfig = ''
Host nix-builder-isvegg Host nix-builder-isvegg

View File

@ -1,6 +1,7 @@
{ config, lib, pkgs, inputs, specialArgs, ... }: { config, lib, pkgs, inputs, specialArgs, ... }:
{ {
imports = [ imports = [
./services/avahi.nix
./services/docker.nix ./services/docker.nix
./services/libvirtd.nix ./services/libvirtd.nix
./services/logiops.nix ./services/logiops.nix

View File

@ -0,0 +1,13 @@
{ config, pkgs, lib, ... }:
{
services.avahi = {
enable = true;
publish.enable = true;
publish.addresses = true;
publish.domain = true;
publish.hinfo = true;
publish.userServices = true;
publish.workstation = true;
extraServiceFiles.ssh = "${pkgs.avahi}/etc/avahi/services/ssh.service";
};
}