Compare commits

...

19 Commits

Author SHA1 Message Date
Oystein Kristoffer Tveit 65ef9efd77
start update to nixpkgs 24.05 by updating kasei and common 2024-06-02 17:13:29 +02:00
Oystein Kristoffer Tveit c3e52087ad
packages: temporarily disable pcloud 2024-06-02 16:40:31 +02:00
Oystein Kristoffer Tveit 4cb72a22c5
neovim: add paste function 2024-06-02 16:38:31 +02:00
Oystein Kristoffer Tveit 8f73eaf1b4
fonts: fix deprecated option names 2024-06-02 16:36:22 +02:00
Oystein Kristoffer Tveit 299eee4238
common: add more nix builder declarations 2024-06-02 16:34:07 +02:00
Oystein Kristoffer Tveit 29579969a4
common: declare local flake registry 2024-06-02 16:32:23 +02:00
Oystein Kristoffer Tveit 5dca478291
fcitx: use declarative config 2024-06-02 16:31:08 +02:00
Oystein Kristoffer Tveit a8bfbbc532
common: add h7x4 to wireshark group 2024-06-02 16:30:31 +02:00
Oystein Kristoffer Tveit 4f561c1dae
gnupg: use curses pinentry 2024-06-02 16:30:09 +02:00
Oystein Kristoffer Tveit c902040ade
common: move sudo-lecture out of etc 2024-06-02 16:29:48 +02:00
Oystein Kristoffer Tveit 347a731839
kasei: misc general config 2024-06-02 16:26:44 +02:00
Oystein Kristoffer Tveit 1f269acb6b
home/sxhkd: launch through systemd 2024-06-02 16:25:58 +02:00
Oystein Kristoffer Tveit e023648b1a
home/vscode: add some extensions 2024-06-02 16:25:16 +02:00
Oystein Kristoffer Tveit f1e25dabe6
home/git: misc changes 2024-06-02 16:24:39 +02:00
Oystein Kristoffer Tveit 13201436da
home/gh: set pager to bat 2024-06-02 16:24:05 +02:00
Oystein Kristoffer Tveit 044ac93785
shell: fix dig alias to point to dogdns 2024-06-02 16:23:28 +02:00
Oystein Kristoffer Tveit 613d61f7a0
flake: git.nani.wtf -> git.pvv.ntnu.no 2024-06-02 16:22:38 +02:00
Oystein Kristoffer Tveit 4e1b80f036
home: remove usage of nix-attr-search 2024-06-02 16:21:55 +02:00
Oystein Kristoffer Tveit fce206e772
kasei: setup keybase using module 2024-06-02 16:18:56 +02:00
13 changed files with 258 additions and 82 deletions

View File

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

View File

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

View File

@ -37,8 +37,6 @@ in {
ouch
pandoc
parallel
pinentry
pinentry-curses
progress
python3
rclone
@ -107,7 +105,7 @@ in {
mpc_cli
nyxt
# obsidian
pcloud
# pcloud
pulseaudio
pulsemixer
# scrcpy
@ -141,10 +139,11 @@ 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,9 +1,10 @@
{ ... }:
{ 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,6 +40,10 @@
editor = "nvim";
};
rerere.enabled = true;
branch.sort = "-committerdate";
"color \"branch\"".upstream = "cyan";
color.ui = "auto";
@ -77,6 +81,8 @@
github.user = "h7x4";
"url \"git@github:\"".insteadOf = "https://github.com/";
web.browser = "google-chrome-stable";
"filter \"lfs\"" = {

View File

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

View File

@ -99,6 +99,20 @@
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,8 +304,12 @@ 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,7 +1,15 @@
{ pkgs, ... }:
{ 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
{
services.sxhkd = {
enable = true;
enable = false;
keybindings = {
# make sxhkd reload its configuration files:
@ -44,8 +52,7 @@
"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}";
@ -72,4 +79,24 @@
"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 "dog";
dig = p "dogdns";
# Flags are incompatible, so they are suffixed by -x
psx = p "procs";
@ -92,9 +92,6 @@ 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 = {};
@ -251,7 +248,7 @@ in {
};
m = p "ncmpcpp";
p = "${pkgs.python39Packages.ipython}/bin/ipython";
p = "${pkgs.python3Packages.ipython}/bin/ipython";
s = p "sxiv";
v = p "mpv";
zt = p "zathura";

View File

@ -4,6 +4,14 @@ 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";
@ -20,55 +28,110 @@ 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-tsukir";
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";
system = "x86_64-linux";
speedFactor = 5;
maxJobs = 8;
maxJobs = 24;
supportedFeatures = [
"nixos-test"
"benchmark"
"big-paralell"
];
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;
mandatoryFeatures = [ ];
# sshUser = secrets.ssh.users.pvv.normalUser;
# sshKey = config.sops.secrets."ssh/nix-builders/bob/key".path;
}
];
# 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 = {
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 = {
tsukir = {
hostNames = [ "nani.wtf" "gingakei.loginto.me" ];
publicKeyFile = secrets.keys.ssh.nixBuilders.tsuki.public;
bob = {
hostNames = [
"bob.pvv.ntnu.no"
"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";
# };
};
};
@ -95,9 +158,33 @@ 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";
};
};
};
};
@ -131,12 +218,6 @@ 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
@ -165,11 +246,10 @@ in {
};
fonts = {
enableDefaultFonts = true;
fontDir.enable = true;
fonts = with pkgs; [
enableDefaultPackages = true;
packages = with pkgs; [
cm_unicode
dejavu_fonts
fira-code
@ -222,6 +302,7 @@ in {
"networkmanager"
"video"
"wheel"
"wireshark"
];
};
@ -261,14 +342,19 @@ in {
];
};
libinput = {
enable = !config.machineVars.headless;
touchpad.disableWhileTyping = true;
};
displayManager.defaultSession = "none+xmonad";
xserver = {
enable = !config.machineVars.headless;
layout = "us";
xkbOptions = "caps:escape";
libinput = {
enable = true;
touchpad.disableWhileTyping = true;
xkb = {
layout = "us";
options = "caps:escape";
};
desktopManager = {
@ -276,6 +362,8 @@ in {
xfce.enable = !config.machineVars.headless;
};
displayManager.lightdm.enable = !config.machineVars.headless;
windowManager.xmonad = {
enable = true;
enableContribAndExtras = true;
@ -285,8 +373,6 @@ in {
];
};
displayManager.lightdm.enable = !config.machineVars.headless;
displayManager.defaultSession = "none+xmonad";
};
};
@ -300,6 +386,7 @@ in {
zsh.enable = true;
gnupg.agent.enable = true;
gnupg.agent.pinentryPackage = pkgs.pinentry-curses;
neovim = {
enable = true;
@ -377,9 +464,11 @@ in {
hardware.pulseaudio.enable = !config.machineVars.headless;
security.sudo.extraConfig = ''
security.sudo.extraConfig = let
sudoLecture = pkgs.writeText "sudo-lecture.txt" (extendedLib.termColors.front.red "Be careful or something, idk...\n");
in ''
Defaults lecture = always
Defaults lecture_file = /etc/${config.environment.etc.sudoLecture.target}
Defaults lecture_file = ${sudoLecture}
'';
system.stateVersion = "22.05";

View File

@ -7,8 +7,18 @@
./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;
@ -46,7 +56,7 @@
hostName = "kasei";
networkmanager.enable = true;
interfaces.enp6s0.useDHCP = true;
firewall.enable = true;
firewall.enable = false;
hostId = "f0660cef";
};
@ -55,8 +65,18 @@
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 = {
@ -111,5 +131,15 @@
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

@ -0,0 +1,15 @@
{ 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 ];
}