Compare commits

..

No commits in common. "65ef9efd775404e38f8a7720444bd18760a1def8" and "a43fbd034284e63635ee1cfc2ca6a7b1e8eed28c" have entirely different histories.

13 changed files with 82 additions and 258 deletions

View File

@ -14,10 +14,16 @@
}; };
dotfiles = { dotfiles = {
url = "git+https://git.pvv.ntnu.no/oysteikt/dotfiles?ref=master"; url = "git+https://git.nani.wtf/h7x4/dotfiles?ref=master";
flake = false; flake = false;
}; };
nix-attr-search ={
url = "github:h7x4/nix-attr-search";
inputs.nixpkgs.follows = "nixpkgs";
inputs.home-manager.follows = "home-manager";
};
fonts = { fonts = {
url = "path:/home/h7x4/git/fonts"; url = "path:/home/h7x4/git/fonts";
flake = false; flake = false;
@ -31,7 +37,7 @@
}; };
website = { website = {
url = "git+https://git.pvv.ntnu.no/oysteikt/nani.wtf?ref=main"; url = "git+https://git.nani.wtf/h7x4/nani.wtf?ref=main";
# url = "path:/home/h7x4/git/nani.wtf"; # url = "path:/home/h7x4/git/nani.wtf";
# inputs.nixpkgs.follows = "nixpkgs"; # inputs.nixpkgs.follows = "nixpkgs";
}; };
@ -99,7 +105,7 @@
in [ in [
(self: super: { kanidm = nonrecursive-unstable-pkgs.kanidm; }) (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 = unstable-pkgs.callPackage ./package-overrides/pcloud.nix {}; })
osuchan.overlays.default osuchan.overlays.default
(self: super: { (self: super: {
mpv-unwrapped = super.mpv-unwrapped.override { mpv-unwrapped = super.mpv-unwrapped.override {

View File

@ -133,7 +133,7 @@ in {
qt = mkIf graphics { qt = mkIf graphics {
enable = true; enable = true;
platformTheme.name = "gtk"; platformTheme = "gtk";
style = { style = {
name = "adwaita-dark"; name = "adwaita-dark";
package = pkgs.adwaita-qt; package = pkgs.adwaita-qt;

View File

@ -37,6 +37,8 @@ in {
ouch ouch
pandoc pandoc
parallel parallel
pinentry
pinentry-curses
progress progress
python3 python3
rclone rclone
@ -105,7 +107,7 @@ in {
mpc_cli mpc_cli
nyxt nyxt
# obsidian # obsidian
# pcloud pcloud
pulseaudio pulseaudio
pulsemixer pulsemixer
# scrcpy # scrcpy
@ -139,11 +141,10 @@ in {
] ++ lib.optionals (machineVars.laptop) [ ] ++ lib.optionals (machineVars.laptop) [
touchegg touchegg
] ++ lib.optionals (machineVars.gaming) [ ] ++ lib.optionals (machineVars.gaming) [
citra
desmume desmume
minecraft
osu-lazer osu-lazer
(prismlauncher.override {
jdk17 = jdk21;
})
retroarchFull retroarchFull
steam steam
steam-tui steam-tui

View File

@ -1,10 +1,9 @@
{ pkgs, ... }: { ... }:
{ {
programs.gh = { programs.gh = {
enable = true; enable = true;
settings = { settings = {
gitProtocol = "ssh"; gitProtocol = "ssh";
pager = "${pkgs.bat}/git/bat";
aliases = { aliases = {
co = "pr checkout"; co = "pr checkout";
pv = "pr view"; pv = "pr view";

View File

@ -22,15 +22,15 @@
}; };
aliases = { aliases = {
aliases = "!git config --get-regexp alias | sed -re 's/alias\\.(\\S*)\\s(.*)$/\\1 = \\2/g'"; aliases = "!git config --get-regexp alias | sed -re 's/alias\\.(\\S*)\\s(.*)$/\\1 = \\2/g'";
delete-merged = "!git branch --merged | grep -v '\\*' | xargs -n 1 git branch -d"; delete-merged = "!git branch --merged | grep -v '\\*' | xargs -n 1 git branch -d";
graph = "log --graph --abbrev-commit --decorate --format=format:'%C(bold blue)%h%C(reset) - %C(bold green)(%ar)%C(reset) %C(white)%s%C(reset) %C(dim white)- %an%C(reset)%C(bold yellow)%d%C(reset)' --all"; graph = "log --graph --abbrev-commit --decorate --format=format:'%C(bold blue)%h%C(reset) - %C(bold green)(%ar)%C(reset) %C(white)%s%C(reset) %C(dim white)- %an%C(reset)%C(bold yellow)%d%C(reset)' --all";
graphv = "log --graph --abbrev-commit --decorate --format=format:'%C(bold blue)%h%C(reset) - %C(bold cyan)%aD%C(reset) %C(bold green)(%ar)%C(reset)%C(bold yellow)%d%C(reset)%n'' %C(white)%s%C(reset) %C(dim white)- %an%C(reset)' --all"; graphv = "log --graph --abbrev-commit --decorate --format=format:'%C(bold blue)%h%C(reset) - %C(bold cyan)%aD%C(reset) %C(bold green)(%ar)%C(reset)%C(bold yellow)%d%C(reset)%n'' %C(white)%s%C(reset) %C(dim white)- %an%C(reset)' --all";
forcepush = "push --force-with-lease --force-if-includes"; forcepush = "push --force-with-lease --force-if-includes";
authors = "shortlog --summary --numbered --email"; authors = "shortlog --summary --numbered --email";
switch-interactive = "!cat <(git branch) <(git branch -r) | grep -v '^\\*\\|HEAD ->' | ${pkgs.fzf}/bin/fzf --reverse --info=inline --preview 'echo {} | xargs git show --color' | sed 's|\\s*.*/||' | xargs git switch"; switch-interactive = "!cat <(git branch) <(git branch -r) | grep -v '^\\*\\|HEAD ->' | ${pkgs.fzf}/bin/fzf --reverse --info=inline --preview 'echo {} | xargs git show --color' | sed 's|\\s*.*/||' | xargs git switch";
si = "switch-interactive"; si = "switch-interactive";
rebase-author = "rebase -i -x \"git commit --amend --reset-author -CHEAD\""; rebase-author = "rebase -i -x \"git commit --amend --reset-author -CHEAD\"";
}; };
extraConfig = { extraConfig = {
@ -40,10 +40,6 @@
editor = "nvim"; editor = "nvim";
}; };
rerere.enabled = true;
branch.sort = "-committerdate";
"color \"branch\"".upstream = "cyan"; "color \"branch\"".upstream = "cyan";
color.ui = "auto"; color.ui = "auto";
@ -81,8 +77,6 @@
github.user = "h7x4"; github.user = "h7x4";
"url \"git@github:\"".insteadOf = "https://github.com/";
web.browser = "google-chrome-stable"; web.browser = "google-chrome-stable";
"filter \"lfs\"" = { "filter \"lfs\"" = {

View File

@ -1,4 +1,4 @@
{ pkgs, config, ... }: { config, ... }:
{ {
programs.gpg = { programs.gpg = {
enable = true; enable = true;
@ -14,7 +14,7 @@
services.gpg-agent = { services.gpg-agent = {
enable = true; enable = true;
pinentryPackage = pkgs.pinentry-curses; pinentryFlavor = "curses";
enableExtraSocket = true; enableExtraSocket = true;
enableSshSupport = true; enableSshSupport = true;
enableScDaemon = true; enableScDaemon = true;

View File

@ -99,20 +99,6 @@
vnoremap <A-j> :m '>+1<CR>gv=gv vnoremap <A-j> :m '>+1<CR>gv=gv
vnoremap <A-k> :m '<-2<CR>gv=gv vnoremap <A-k> :m '<-2<CR>gv=gv
''; '';
extraLuaConfig = ''
local function paste_buf()
local content = os.getenv("NVIM_CLIPBOARD")
local line = vim.api.nvim_get_current_line()
local indent = string.match(line, " +")
vim.fn.setreg("a", indent .. content)
vim.cmd("put a")
end
vim.keymap.set('n', ';', paste_buf)
'';
}; };
home.sessionVariables = { EDITOR = "nvim"; }; home.sessionVariables = { EDITOR = "nvim"; };

View File

@ -304,12 +304,8 @@ in
shardulm94.trailing-spaces shardulm94.trailing-spaces
usernamehw.errorlens usernamehw.errorlens
rust-lang.rust-analyzer rust-lang.rust-analyzer
mkhl.direnv
waderyan.gitblame
# vs-liveshare # vs-liveshare
vscodevim.vim vscodevim.vim
ms-dotnettools.csharp
] ++ pkgs.vscode-utils.extensionsFromVscodeMarketplace [ ] ++ pkgs.vscode-utils.extensionsFromVscodeMarketplace [
{ {
name = "monokai-st3"; name = "monokai-st3";

View File

@ -1,15 +1,7 @@
{ config, pkgs, lib, ... }: { pkgs, ... }:
let
cfg = config.services.sxhkd;
keybindingsStr = lib.concatStringsSep "\n" (lib.mapAttrsToList (hotkey: command:
lib.optionalString (command != null) ''
${hotkey}
${command}
'') cfg.keybindings);
in
{ {
services.sxhkd = { services.sxhkd = {
enable = false; enable = true;
keybindings = { keybindings = {
# make sxhkd reload its configuration files: # make sxhkd reload its configuration files:
@ -52,7 +44,8 @@ in
"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}";
# fcitx5 # fcitx5
"super + {b,n,m}" = "${pkgs.fcitx5}/bin/fcitx5-remote -s {mozc,keyboard-no,keyboard-us}"; "super + {b,n,m}" = "${pkgs.fcitx5}/bin/fcitx5-remote -s {mozc,keyboard-no,keyboard-us}";
@ -79,24 +72,4 @@ in
"super + shift + e" = "sleep 0.3; ${pkgs.xdotool}/bin/xdotool key U00E9"; "super + shift + e" = "sleep 0.3; ${pkgs.xdotool}/bin/xdotool key U00E9";
}; };
}; };
xdg.configFile."sxhkd/sxhkdrc".text =
lib.concatStringsSep "\n" [ keybindingsStr cfg.extraConfig ];
home.packages = [ cfg.package ];
systemd.user.services.sxhkd = {
Unit = {
Description = "Simple X hotkey daemon";
PartOf = [ "graphical-session.target" ];
After = [ "graphical-session.target" ];
};
Service = {
ExecStart = "${cfg.package}/bin/sxhkd ${toString cfg.extraOptions}";
Restart = "always";
};
Install.WantedBy = [ "graphical-session.target" ];
};
} }

View File

@ -41,7 +41,7 @@ in {
htop = "${pkgs.bottom}/bin/btm"; htop = "${pkgs.bottom}/bin/btm";
hhtop = p "htop"; hhtop = p "htop";
dig = p "dogdns"; dig = p "dog";
# Flags are incompatible, so they are suffixed by -x # Flags are incompatible, so they are suffixed by -x
psx = p "procs"; psx = p "procs";
@ -92,6 +92,9 @@ in {
nxr-hm = "sudo nixos-rebuild switch --flake ~/nix#home-manager-tester"; nxr-hm = "sudo nixos-rebuild switch --flake ~/nix#home-manager-tester";
nxr-ks = "sudo nixos-rebuild switch --flake ~/nix#kasei"; nxr-ks = "sudo nixos-rebuild switch --flake ~/nix#kasei";
hms = toString inputs.nix-attr-search.packages.${pkgs.system}.home-manager-search;
nxo = toString inputs.nix-attr-search.packages.${pkgs.system}.nix-option-search;
# TODO: does this need to be a function? # TODO: does this need to be a function?
# ofborg-build = {}; # ofborg-build = {};
@ -248,7 +251,7 @@ in {
}; };
m = p "ncmpcpp"; m = p "ncmpcpp";
p = "${pkgs.python3Packages.ipython}/bin/ipython"; p = "${pkgs.python39Packages.ipython}/bin/ipython";
s = p "sxiv"; s = p "sxiv";
v = p "mpv"; v = p "mpv";
zt = p "zathura"; zt = p "zathura";

View File

@ -4,14 +4,6 @@ let
in { in {
sops.defaultSopsFile = ../secrets/default.yaml; sops.defaultSopsFile = ../secrets/default.yaml;
sops.secrets = {
"ssh/nix-builders/tsuki/key" = { };
"ssh/nix-builders/tsuki/pub" = { };
"ssh/nix-builders/isvegg/key" = { };
"ssh/nix-builders/bob/key" = { };
# "ssh/nix-builders/isvegg/pub" = { };
};
nix = { nix = {
package = unstable-pkgs.nixVersions.stable; package = unstable-pkgs.nixVersions.stable;
distributedBuilds = config.networking.hostName != "tsuki"; distributedBuilds = config.networking.hostName != "tsuki";
@ -28,110 +20,55 @@ in {
}; };
buildMachines = [ buildMachines = [
# {
# # Login details configured in ssh module in nix-secrets
# hostName = "nix-builder-tsukir";
# system = "x86_64-linux";
# speedFactor = 2;
# maxJobs = 8;
# supportedFeatures = [
# "nixos-test"
# "benchmark"
# "big-paralell"
# ];
# mandatoryFeatures = [ ];
# sshUser = "nix-ssh";
# sshKey = config.sops.secrets."ssh/nix-builders/tsuki/key".path;
# }
{ {
# Login details configured in ssh module in nix-secrets # Login details configured in ssh module in nix-secrets
hostName = "nix-builder-isvegg"; hostName = "nix-builder-tsukir";
system = "x86_64-linux";
speedFactor = 1;
maxJobs = 8;
supportedFeatures = [ ];
mandatoryFeatures = [ ];
sshUser = secrets.ssh.users.pvv.normalUser;
sshKey = config.sops.secrets."ssh/nix-builders/isvegg/key".path;
}
{
# Login details configured in ssh module in nix-secrets
hostName = "nix-builder-bob";
system = "x86_64-linux"; system = "x86_64-linux";
speedFactor = 5; speedFactor = 5;
maxJobs = 24; maxJobs = 8;
supportedFeatures = [ supportedFeatures = [
"nixos-test" "nixos-test"
"benchmark" "benchmark"
"big-paralell" "big-paralell"
]; ];
mandatoryFeatures = [ ]; mandatoryFeatures = [];
# sshUser = secrets.ssh.users.pvv.normalUser; sshUser = "nix-ssh";
# sshKey = config.sops.secrets."ssh/nix-builders/bob/key".path; sshKey = secrets.keys.ssh.nixBuilders.tsuki.private;
}
{
# Login details configured in ssh module in nix-secrets
hostName = "nix-builder-isvegg";
system = "x86_64-linux";
speedFactor = 7;
maxJobs = 16;
supportedFeatures = [
"benchmark"
"big-paralell"
];
mandatoryFeatures = [];
sshUser = secrets.ssh.users.pvv.normalUser;
sshKey = secrets.keys.ssh.nixBuilders.isvegg.private;
} }
]; ];
registry = { # registry = {
home.to = {
type = "path"; # };
path = "/home/h7x4/nix";
};
wack.to = {
type = "path";
path = "/home/h7x4/git/wack-ctf-flake";
};
nxpt.to = {
type = "path";
path = "/home/h7x4/git/nixpkgs-tools";
};
};
}; };
programs.ssh = { programs.ssh = {
extraConfig = '' extraConfig = ''
Host nix-builder-isvegg Host nix-builder-isvegg
HostName isvegg.pvv.ntnu.no HostName isvegg.pvv.ntnu.no
User oysteikt
IdentityFile ${config.sops.secrets."ssh/nix-builders/isvegg/key".path}
Host nix-builder-bob
HostName bob.pvv.ntnu.no
ProxyJump nix-builder-isvegg
User oysteikt
IdentityFile ${config.sops.secrets."ssh/nix-builders/bob/key".path}
Host nix-builder-tsukir Host nix-builder-tsukir
HostName gingakei.loginto.me HostName gingakei.loginto.me
Port ${toString secrets.ports.ssh.home-in} Port ${toString secrets.ports.ssh.home-in}
''; '';
knownHosts = { knownHosts = {
bob = { tsukir = {
hostNames = [ hostNames = [ "nani.wtf" "gingakei.loginto.me" ];
"bob.pvv.ntnu.no" publicKeyFile = secrets.keys.ssh.nixBuilders.tsuki.public;
"bob.pvv.org"
];
publicKey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIGJSgh20qDIYEXiK4MUZhc879dJIyH0K/s0RZ+9wFI0F";
}; };
hildring = {
hostNames = [
"hildring.pvv.ntnu.no"
"hildring.pvv.org"
"login.pvv.ntnu.no"
"login.pvv.org"
];
publicKey = "ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBGurF7rdnrDP/VgIK2Tx38of+bX/QGCGL+alrWnZ1Ca5llGneMulUt1RB9xZzNLHiaWIE+HOP0i4spEaeZhilfU=";
};
isvegg = {
hostNames = [
"isvegg.pvv.ntnu.no"
"isvegg.pvv.org"
];
publicKey = "ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBGurF7rdnrDP/VgIK2Tx38of+bX/QGCGL+alrWnZ1Ca5llGneMulUt1RB9xZzNLHiaWIE+HOP0i4spEaeZhilfU=";
};
# tsukir = {
# hostNames = [ "nani.wtf" "gingakei.loginto.me" ];
# # publicKeyFile = config.sops.secrets."ssh/nix-builders/tsuki/pub".path;
# publicKeyFile = "/var/keys/tsuki_nix-builder.pub";
# };
}; };
}; };
@ -158,33 +95,9 @@ in {
enabled = "fcitx5"; enabled = "fcitx5";
fcitx5.addons = with pkgs; [ fcitx5.addons = with pkgs; [
fcitx5-mozc fcitx5-mozc
fcitx5-gtk # fcitx5-gtk
# fcitx5-chinese-addons # fcitx5-chinese-addons
]; ];
fcitx5.ignoreUserConfig = true;
fcitx5.settings.inputMethod = {
"Groups/0" = {
"Name" = "Default";
"Default Layout" = "ch";
"DefaultIM" = "mozc";
};
"Groups/0/Items/0" = {
"Name" = "keybord-us";
"Layout" = null;
};
"Groups/0/Items/1" = {
"Name" = "keybord-no";
"Layout" = null;
};
"Groups/0/Items/2" = {
"Name" = "mozc";
"Layout" = null;
};
"GroupOrder" = {
"0" = "Default";
};
};
}; };
}; };
@ -218,6 +131,12 @@ in {
]; ];
etc = { etc = {
# TODO: move this out of etc, and reference it directly in sudo config.
sudoLecture = {
target = "sudo.lecture";
text = extendedLib.termColors.front.red "Be careful or something, idk...\n";
};
currentSystemPackages = { currentSystemPackages = {
target = "current-system-packages"; target = "current-system-packages";
text = let text = let
@ -246,10 +165,11 @@ in {
}; };
fonts = { fonts = {
enableDefaultFonts = true;
fontDir.enable = true; fontDir.enable = true;
enableDefaultPackages = true; fonts = with pkgs; [
packages = with pkgs; [
cm_unicode cm_unicode
dejavu_fonts dejavu_fonts
fira-code fira-code
@ -302,7 +222,6 @@ in {
"networkmanager" "networkmanager"
"video" "video"
"wheel" "wheel"
"wireshark"
]; ];
}; };
@ -342,19 +261,14 @@ in {
]; ];
}; };
libinput = {
enable = !config.machineVars.headless;
touchpad.disableWhileTyping = true;
};
displayManager.defaultSession = "none+xmonad";
xserver = { xserver = {
enable = !config.machineVars.headless; enable = !config.machineVars.headless;
layout = "us";
xkbOptions = "caps:escape";
xkb = { libinput = {
layout = "us"; enable = true;
options = "caps:escape"; touchpad.disableWhileTyping = true;
}; };
desktopManager = { desktopManager = {
@ -362,8 +276,6 @@ in {
xfce.enable = !config.machineVars.headless; xfce.enable = !config.machineVars.headless;
}; };
displayManager.lightdm.enable = !config.machineVars.headless;
windowManager.xmonad = { windowManager.xmonad = {
enable = true; enable = true;
enableContribAndExtras = true; enableContribAndExtras = true;
@ -373,6 +285,8 @@ in {
]; ];
}; };
displayManager.lightdm.enable = !config.machineVars.headless;
displayManager.defaultSession = "none+xmonad";
}; };
}; };
@ -386,7 +300,6 @@ in {
zsh.enable = true; zsh.enable = true;
gnupg.agent.enable = true; gnupg.agent.enable = true;
gnupg.agent.pinentryPackage = pkgs.pinentry-curses;
neovim = { neovim = {
enable = true; enable = true;
@ -464,11 +377,9 @@ in {
hardware.pulseaudio.enable = !config.machineVars.headless; hardware.pulseaudio.enable = !config.machineVars.headless;
security.sudo.extraConfig = let security.sudo.extraConfig = ''
sudoLecture = pkgs.writeText "sudo-lecture.txt" (extendedLib.termColors.front.red "Be careful or something, idk...\n");
in ''
Defaults lecture = always Defaults lecture = always
Defaults lecture_file = ${sudoLecture} Defaults lecture_file = /etc/${config.environment.etc.sudoLecture.target}
''; '';
system.stateVersion = "22.05"; system.stateVersion = "22.05";

View File

@ -7,18 +7,8 @@
./services/postgres.nix ./services/postgres.nix
./services/stable-diffusion.nix ./services/stable-diffusion.nix
./services/tailscale.nix ./services/tailscale.nix
./services/keybase.nix
nix.settings.system-features = [
"kvm"
"benchmark"
"big-parallel"
"nixos-test"
]; ];
i18n.extraLocaleSettings = {
LC_ALL = "en_US.UTF-8";
};
machineVars = { machineVars = {
headless = false; headless = false;
gaming = true; gaming = true;
@ -56,7 +46,7 @@
hostName = "kasei"; hostName = "kasei";
networkmanager.enable = true; networkmanager.enable = true;
interfaces.enp6s0.useDHCP = true; interfaces.enp6s0.useDHCP = true;
firewall.enable = false; firewall.enable = true;
hostId = "f0660cef"; hostId = "f0660cef";
}; };
@ -65,18 +55,8 @@
enable = true; enable = true;
settings.X11Forwarding = true; settings.X11Forwarding = true;
}; };
xserver.videoDrivers = [ "nvidia" ]; xserver.videoDrivers = ["nvidia"];
tailscale.enable = true; tailscale.enable = true;
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";
};
}; };
boot = { boot = {
@ -131,15 +111,5 @@
cpu.amd.updateMicrocode = true; cpu.amd.updateMicrocode = true;
enableRedistributableFirmware = true; enableRedistributableFirmware = true;
keyboard.zsa.enable = true; keyboard.zsa.enable = true;
opengl = {
enable = true;
driSupport = true;
driSupport32Bit = true;
};
nvidia = {
modesetting.enable = true;
nvidiaSettings = true;
};
}; };
} }

View File

@ -1,15 +0,0 @@
{ config, pkgs, lib, ... }:
{
services.keybase.enable = true;
services.kbfs = {
enable = true;
extraFlags = [
"-label kbfs"
"-mount-type normal"
];
# enableRedirector = true;
};
environment.systemPackages = with pkgs; [ keybase keybase-gui kbfs ];
}