Compare commits
19 Commits
a43fbd0342
...
65ef9efd77
12
flake.nix
12
flake.nix
|
@ -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 {
|
||||
|
|
|
@ -133,7 +133,7 @@ in {
|
|||
|
||||
qt = mkIf graphics {
|
||||
enable = true;
|
||||
platformTheme = "gtk";
|
||||
platformTheme.name = "gtk";
|
||||
style = {
|
||||
name = "adwaita-dark";
|
||||
package = pkgs.adwaita-qt;
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -1,9 +1,10 @@
|
|||
{ ... }:
|
||||
{ pkgs, ... }:
|
||||
{
|
||||
programs.gh = {
|
||||
enable = true;
|
||||
settings = {
|
||||
gitProtocol = "ssh";
|
||||
pager = "${pkgs.bat}/git/bat";
|
||||
aliases = {
|
||||
co = "pr checkout";
|
||||
pv = "pr view";
|
||||
|
|
|
@ -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\"" = {
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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"; };
|
||||
|
|
|
@ -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";
|
||||
|
|
|
@ -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" ];
|
||||
};
|
||||
}
|
||||
|
|
|
@ -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";
|
||||
|
|
177
hosts/common.nix
177
hosts/common.nix
|
@ -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";
|
||||
|
|
|
@ -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;
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
@ -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 ];
|
||||
}
|
Loading…
Reference in New Issue