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

View File

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

View File

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

View File

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

View File

@ -22,15 +22,15 @@
};
aliases = {
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";
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";
forcepush = "push --force-with-lease --force-if-includes";
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";
si = "switch-interactive";
rebase-author = "rebase -i -x \"git commit --amend --reset-author -CHEAD\"";
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";
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";
forcepush = "push --force-with-lease --force-if-includes";
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";
si = "switch-interactive";
rebase-author = "rebase -i -x \"git commit --amend --reset-author -CHEAD\"";
};
extraConfig = {
@ -40,10 +40,6 @@
editor = "nvim";
};
rerere.enabled = true;
branch.sort = "-committerdate";
"color \"branch\"".upstream = "cyan";
color.ui = "auto";
@ -81,8 +77,6 @@
github.user = "h7x4";
"url \"git@github:\"".insteadOf = "https://github.com/";
web.browser = "google-chrome-stable";
"filter \"lfs\"" = {

View File

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

View File

@ -99,20 +99,6 @@
vnoremap <A-j> :m '>+1<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"; };

View File

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

View File

@ -1,15 +1,7 @@
{ config, pkgs, lib, ... }:
let
cfg = config.services.sxhkd;
keybindingsStr = lib.concatStringsSep "\n" (lib.mapAttrsToList (hotkey: command:
lib.optionalString (command != null) ''
${hotkey}
${command}
'') cfg.keybindings);
in
{ pkgs, ... }:
{
services.sxhkd = {
enable = false;
enable = true;
keybindings = {
# make sxhkd reload its configuration files:
@ -52,7 +44,8 @@ in
"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
"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";
};
};
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";
hhtop = p "htop";
dig = p "dogdns";
dig = p "dog";
# Flags are incompatible, so they are suffixed by -x
psx = p "procs";
@ -92,6 +92,9 @@ in {
nxr-hm = "sudo nixos-rebuild switch --flake ~/nix#home-manager-tester";
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?
# ofborg-build = {};
@ -248,7 +251,7 @@ in {
};
m = p "ncmpcpp";
p = "${pkgs.python3Packages.ipython}/bin/ipython";
p = "${pkgs.python39Packages.ipython}/bin/ipython";
s = p "sxiv";
v = p "mpv";
zt = p "zathura";

View File

@ -4,14 +4,6 @@ let
in {
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 = {
package = unstable-pkgs.nixVersions.stable;
distributedBuilds = config.networking.hostName != "tsuki";
@ -28,110 +20,55 @@ in {
};
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
hostName = "nix-builder-isvegg";
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";
hostName = "nix-builder-tsukir";
system = "x86_64-linux";
speedFactor = 5;
maxJobs = 24;
maxJobs = 8;
supportedFeatures = [
"nixos-test"
"benchmark"
"big-paralell"
];
mandatoryFeatures = [ ];
# sshUser = secrets.ssh.users.pvv.normalUser;
# sshKey = config.sops.secrets."ssh/nix-builders/bob/key".path;
mandatoryFeatures = [];
sshUser = "nix-ssh";
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 = {
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";
};
};
# registry = {
# };
};
programs.ssh = {
extraConfig = ''
Host nix-builder-isvegg
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
HostName gingakei.loginto.me
Port ${toString secrets.ports.ssh.home-in}
'';
knownHosts = {
bob = {
hostNames = [
"bob.pvv.ntnu.no"
"bob.pvv.org"
];
publicKey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIGJSgh20qDIYEXiK4MUZhc879dJIyH0K/s0RZ+9wFI0F";
tsukir = {
hostNames = [ "nani.wtf" "gingakei.loginto.me" ];
publicKeyFile = secrets.keys.ssh.nixBuilders.tsuki.public;
};
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";
fcitx5.addons = with pkgs; [
fcitx5-mozc
fcitx5-gtk
# fcitx5-gtk
# 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 = {
# 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 = {
target = "current-system-packages";
text = let
@ -246,10 +165,11 @@ in {
};
fonts = {
enableDefaultFonts = true;
fontDir.enable = true;
enableDefaultPackages = true;
packages = with pkgs; [
fonts = with pkgs; [
cm_unicode
dejavu_fonts
fira-code
@ -302,7 +222,6 @@ in {
"networkmanager"
"video"
"wheel"
"wireshark"
];
};
@ -342,19 +261,14 @@ in {
];
};
libinput = {
enable = !config.machineVars.headless;
touchpad.disableWhileTyping = true;
};
displayManager.defaultSession = "none+xmonad";
xserver = {
enable = !config.machineVars.headless;
layout = "us";
xkbOptions = "caps:escape";
xkb = {
layout = "us";
options = "caps:escape";
libinput = {
enable = true;
touchpad.disableWhileTyping = true;
};
desktopManager = {
@ -362,8 +276,6 @@ in {
xfce.enable = !config.machineVars.headless;
};
displayManager.lightdm.enable = !config.machineVars.headless;
windowManager.xmonad = {
enable = 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;
gnupg.agent.enable = true;
gnupg.agent.pinentryPackage = pkgs.pinentry-curses;
neovim = {
enable = true;
@ -464,11 +377,9 @@ in {
hardware.pulseaudio.enable = !config.machineVars.headless;
security.sudo.extraConfig = let
sudoLecture = pkgs.writeText "sudo-lecture.txt" (extendedLib.termColors.front.red "Be careful or something, idk...\n");
in ''
security.sudo.extraConfig = ''
Defaults lecture = always
Defaults lecture_file = ${sudoLecture}
Defaults lecture_file = /etc/${config.environment.etc.sudoLecture.target}
'';
system.stateVersion = "22.05";

View File

@ -7,18 +7,8 @@
./services/postgres.nix
./services/stable-diffusion.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 = {
headless = false;
gaming = true;
@ -56,7 +46,7 @@
hostName = "kasei";
networkmanager.enable = true;
interfaces.enp6s0.useDHCP = true;
firewall.enable = false;
firewall.enable = true;
hostId = "f0660cef";
};
@ -65,18 +55,8 @@
enable = true;
settings.X11Forwarding = true;
};
xserver.videoDrivers = [ "nvidia" ];
xserver.videoDrivers = ["nvidia"];
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 = {
@ -131,15 +111,5 @@
cpu.amd.updateMicrocode = true;
enableRedistributableFirmware = 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 ];
}