Moved all to moduler

This commit is contained in:
fwastring 2025-09-06 13:18:48 +02:00
parent 72dafab57f
commit 70b6634137
41 changed files with 35 additions and 52 deletions

88
moduler/aerc.nix Normal file
View file

@ -0,0 +1,88 @@
{ pkgs, lib, ... }:
{
programs.aerc = {
enable = true;
extraConfig = {
general = {
"pgp-provider" = "gpg";
"log-file" = "~/.config/aerc/messages.log";
};
filters = {
"text/plain"="bat";
"text/calendar"="calendar";
"message/delivery-status"="colorize";
"message/rfc822"="colorize";
"text/html"="pandoc -f html -t plain | colorize";
"image/*"="feh -";
"application/pdf"="zathura -";
};
ui = {
"border-char-vertical"="";
"border-char-horizontal"="";
"styleset-name"="catppuccin-latte";
"icon-unencrypted" = "🔓";
"icon-encrypted" = "🔒";
"icon-signed" = "";
"icon-signed-encrypted" = "";
};
templates = {
"new-message" = "signature.txt";
};
};
stylesets = {
catppuccin-latte = ''
*.default=true
*.normal=true
default.fg=#4c4f69
error.fg=#d20f39
warning.fg=#fe640b
success.fg=#40a02b
tab.fg=#9ca0b0
tab.bg=#e6e9ef
tab.selected.fg=#4c4f69
tab.selected.bg=#eff1f5
tab.selected.bold=true
border.fg=#dce0e8
border.bold=true
msglist_unread.bold=true
msglist_flagged.fg=#df8e1d
msglist_flagged.bold=true
msglist_result.fg=#1e66f5
msglist_result.bold=true
msglist_*.selected.bold=true
msglist_*.selected.bg=#ccd0da
dirlist_*.selected.bold=true
dirlist_*.selected.bg=#ccd0da
statusline_default.fg=#7c7f93
statusline_default.bg=#ccd0da
statusline_error.bold=true
statusline_success.bold=true
completion_default.selected.bg=#ccd0da
[viewer]
url.fg=#1e66f5
url.underline=true
header.bold=true
signature.dim=true
diff_meta.bold=true
diff_chunk.fg=#1e66f5
diff_chunk_func.fg=#1e66f5
diff_chunk_func.bold=true
diff_add.fg=#40a02b
diff_del.fg=#d20f39
quote_*.fg=#9ca0b0
quote_1.fg=#7c7f93
'';
};
};
}

196
moduler/base.nix Normal file
View file

@ -0,0 +1,196 @@
# This is your system's configuration file.
# Use this to configure your system environment (it replaces /etc/nixos/configuration.nix)
{
inputs,
lib,
config,
pkgs,
...
}:
{
imports = [
./dev.nix
./lsp.nix
./network.nix
./programs.nix
./system.nix
./sway.nix
];
nixpkgs = {
overlays = [
];
config = {
allowUnfree = true;
};
};
nix.registry = (lib.mapAttrs (_: flake: { inherit flake; })) (
(lib.filterAttrs (_: lib.isType "flake")) inputs
);
nix.nixPath = [ "/etc/nix/path" ];
users.defaultUserShell = pkgs.bash;
documentation.man.generateCaches = false;
programs.fish.enable = true;
programs.bash = {
interactiveShellInit = ''
if [[ $(${pkgs.procps}/bin/ps --no-header --pid=$PPID --format=comm) != "fish" && -z ''${BASH_EXECUTION_STRING} ]]
then
shopt -q login_shell && LOGIN_OPTION='--login' || LOGIN_OPTION=""
exec ${pkgs.fish}/bin/fish $LOGIN_OPTION
fi
'';
};
environment.etc = lib.mapAttrs' (name: value: {
name = "nix/path/${name}";
value.source = value.flake;
}) config.nix.registry;
nix.settings = {
experimental-features = "nix-command flakes";
auto-optimise-store = true;
};
virtualisation = {
podman = {
enable = true;
# Create a `docker` alias for podman, to use it as a drop-in replacement
dockerCompat = true;
# Required for containers under podman-compose to be able to talk to each other.
defaultNetwork.settings.dns_enabled = true;
};
docker = {
enable = true;
liveRestore = false;
};
};
services.pulseaudio.enable = false;
security.rtkit.enable = true;
services = {
tailscale = {
enable = true;
};
pipewire = {
enable = true;
alsa.enable = true;
alsa.support32Bit = true;
pulse.enable = true;
};
};
hardware = {
bluetooth = {
enable = true;
powerOnBoot = true;
settings = {
General = {
Disable = "Headset";
};
};
};
};
networking.networkmanager.enable = true;
environment.sessionVariables = {
EDITOR = "nvim";
VISUAL = "nvim";
TERM = "xterm-256color";
};
time.timeZone = "Europe/Stockholm";
fonts.packages = with pkgs; [
nerd-fonts.comic-shanns-mono
nerd-fonts.fira-code
];
i18n.defaultLocale = "en_US.UTF-8";
i18n.extraLocaleSettings = {
LC_ADDRESS = "sv_SE.UTF-8";
LC_IDENTIFICATION = "sv_SE.UTF-8";
LC_MEASUREMENT = "sv_SE.UTF-8";
LC_MONETARY = "sv_SE.UTF-8";
LC_NAME = "sv_SE.UTF-8";
LC_NUMERIC = "sv_SE.UTF-8";
LC_PAPER = "sv_SE.UTF-8";
LC_TELEPHONE = "sv_SE.UTF-8";
LC_TIME = "sv_SE.UTF-8";
};
boot.loader = {
efi = {
canTouchEfiVariables = false;
};
grub = {
efiSupport = true;
efiInstallAsRemovable = true;
device = "nodev";
};
};
console.keyMap = "sv-latin1";
environment.systemPackages = with pkgs; [
waypipe
(st.overrideAttrs (oldAttrs: rec {
src = builtins.fetchGit {
url = "https://github.com/fwastring/st";
rev = "0ce5cc9c342d02668b25b83099feb95bfc865b47";
};
buildInputs = oldAttrs.buildInputs ++ [ xorg.libX11.dev xorg.libXft imlib2 xorg.libXinerama pkg-config];
}))
(dmenu.overrideAttrs (oldAttrs: rec {
src = builtins.fetchGit {
url = "https://github.com/fwastring/dmenu";
rev = "2f09f9ead8c2736dbca838393f97e5a0e4e55a2e";
};
buildInputs = oldAttrs.buildInputs ++ [ xorg.libX11.dev xorg.libXft imlib2 xorg.libXinerama pkg-config];
}))
];
programs.slock = {
enable = true;
package = with pkgs; (slock.overrideAttrs (oldAttrs: rec {
src = builtins.fetchGit {
url = "https://github.com/fwastring/slock";
rev = "53ada91fefc22f6c9c76ef71b9741b385b6bedfb";
};
buildInputs = oldAttrs.buildInputs ++ [ xorg.libX11.dev xorg.libXft imlib2 xorg.libXinerama pkg-config xorg.libXrandr xorg.xrandr libxcrypt xorg.libXext xorg.xorgproto];
}));
};
services = {
picom.enable = true;
clipmenu.enable = true;
openssh = {
enable = true;
};
strongswan = {
enable = true;
secrets = [
"ipsec.d/ipsec.nm-l2tp.secrets"
];
};
# xserver = {
# displayManager = {
# startx.enable = true;
# };
# enable = true;
# xkb = {
# layout = "se";
# variant = "";
# };
# windowManager.dwm = {
# enable = true;
# };
# };
blueman = {
enable = true;
};
};
system.stateVersion = "23.11";
}

View file

@ -0,0 +1,11 @@
--- a/drivers/bluetooth/btusb.c
+++ b/drivers/bluetooth/btusb.c
@@ -725,6 +725,8 @@ static const struct usb_device_id quirks_table[] = {
BTUSB_WIDEBAND_SPEECH },
{ USB_DEVICE(0x13d3, 0x3630), .driver_info = BTUSB_MEDIATEK |
BTUSB_WIDEBAND_SPEECH },
+ { USB_DEVICE(0x2c7c, 0x7009), .driver_info = BTUSB_MEDIATEK |
+ BTUSB_WIDEBAND_SPEECH },
/* Additional Realtek 8723AE Bluetooth devices */
{ USB_DEVICE(0x0930, 0x021d), .driver_info = BTUSB_REALTEK },

34
moduler/btusb.nix Normal file
View file

@ -0,0 +1,34 @@
{ pkgs, lib, kernel ? pkgs.linuxPackages_latest.kernel}:
pkgs.stdenv.mkDerivation {
pname = "btusb-kernel-module";
inherit (kernel) src version postPatch nativeBuildInputs;
kernel_dev = kernel.dev;
kernelVersion = kernel.modDirVersion;
# The key change is here: point to the correct module path for btusb.
modulePath = "drivers/bluetooth";
buildPhase = ''
BUILT_KERNEL=$kernel_dev/lib/modules/$kernelVersion/build
cp $BUILT_KERNEL/Module.symvers .
cp $BUILT_KERNEL/.config .
cp $kernel_dev/vmlinux .
make "-j$NIX_BUILD_CORES" modules_prepare
make "-j$NIX_BUILD_CORES" M=$modulePath modules
'';
installPhase = ''
make \
INSTALL_MOD_PATH="$out" \
XZ="xz -T$NIX_BUILD_CORES" \
M="$modulePath" \
modules_install
'';
meta = {
description = "btusb kernel module";
license = lib.licenses.gpl3;
};
}

79
moduler/dev.nix Normal file
View file

@ -0,0 +1,79 @@
{
inputs,
lib,
config,
pkgs,
myhostname,
...
}:
let
go-migrate-pg = pkgs.go-migrate.overrideAttrs(oldAttrs: {
tags = ["postgres"];
});
in
{
nix.settings.trusted-users = [ "root" "fw" ];
environment.systemPackages = with pkgs; [
timewarrior
devenv
# Containers
kubectl
docker-slim
dive
buildkit
containerd
cri-tools
yq
skopeo
umoci
velero
podman-tui
azure-cli
dotnetCorePackages.dotnet_9.sdk
google-cloud-sdk
jira-cli-go
gh
allure
kubectx
python314
awscli
unstable.minio-client
hugo
sqlc
postgresql
go-migrate-pg
argocd
ngrok
tailwindcss
yarn
plantuml
go
templ
goa
prettierd
qrencode
air
git
lazydocker
gcc
gnumake
cmake
jq
git
(wrapHelm kubernetes-helm {
plugins = with pkgs.kubernetes-helmPlugins; [
helm-secrets
helm-diff
helm-s3
helm-git
];
})
k3sup
];
}

15
moduler/dmenu.nix Normal file
View file

@ -0,0 +1,15 @@
{ pkgs, lib, ... }:
let
dmenu = pkgs.dmenu.overrideAttrs (old: {
# nativeBuildInputs = with pkgs; [
# xorg.libX11.dev
# xorg.libXft
# imlib2
# xorg.libXinerama
# ];
patches = [ ../moduler/dmenu-center.diff ];
});
in
{
home.packages = [ dmenu ];
}

25
moduler/dunst.nix Normal file
View file

@ -0,0 +1,25 @@
{ config
, pkgs
, ...
}: {
services.dunst = {
enable = true;
settings = {
global = {
width = 300;
height = 300;
follow = "keyboard";
offset = "30x50";
origin = "top-right";
transparency = 5;
frame_color = "#eceff1";
corner_radius = 10;
};
urgency_normal = {
background = "#181818";
foreground = "#dfdfdf";
timeout = 10;
};
};
};
}

33
moduler/dwm.nix Normal file
View file

@ -0,0 +1,33 @@
{
pkgs,
lib,
myhostname,
...
}:
let
dwm = pkgs.dwm.overrideAttrs (old: {
src = builtins.fetchGit {
url = "https://github.com/FredzyW/dwm-conf.git";
rev = "916a68db2dc57f8e0c87c6fb13a2eb3edd0d6144";
};
nativeBuildInputs = with pkgs; [
xorg.libX11.dev
xorg.libXft
imlib2
xorg.libXinerama
];
});
dwmblocks =
pkgs.dwmblocks.overrideAttrs (old: {
src = builtins.fetchGit {
url = "https://github.com/FredzyW/dwmblocks.git";
rev = "d60ccc8c1180aa617fb1033bf1e44a2866647764";
};
});
in
{
home.packages = [
dwm
dwmblocks
];
}

9
moduler/firefox.nix Normal file
View file

@ -0,0 +1,9 @@
{ pkgs, lib, ... }:
{
programs.firefox = {
enable = true;
profiles.default = {
isDefault = true;
};
};
}

78
moduler/fish.nix Normal file
View file

@ -0,0 +1,78 @@
{ pkgs, ... }:
{
programs.fish = {
enable = true;
plugins = [
{
name = "z";
src = pkgs.fetchFromGitHub {
owner = "jethrokuan";
repo = "z";
rev = "e0e1b9dfdba362f8ab1ae8c1afc7ccf62b89f7eb";
sha256 = "0dbnir6jbwjpjalz14snzd3cgdysgcs3raznsijd6savad3qhijc";
};
}
{
name = "autopair";
src = pkgs.fishPlugins.autopair.src;
}
{
name = "foreign-env";
src = pkgs.fishPlugins.foreign-env.src;
}
{
name = "fzf";
src = pkgs.fishPlugins.fzf.src;
}
{
name = "done";
src = pkgs.fishPlugins.done.src;
}
{
name = "grc";
src = pkgs.fishPlugins.grc.src;
}
];
shellAbbrs = {
ls = "eza -l";
ka = "kubectl apply -f";
t = "timew";
todo = "jira issue list -a 'Fredrik Wastring' -s ~Done -s ~Closed -s ~Released --plain";
cam = "jira issue create && jira issue assign && jira issue move";
e = "kubectx";
s = {
setCursor = "%";
expansion = "cha https://search.wastring.com/search?q=%";
};
c = {
setCursor = "%";
expansion = "ssh 'fw:%@gateway.internalifacts.se' -p 2222";
};
dl = {
setCursor = "&";
expansion = "yt-dlp -o \"~/videor/%(title)s - %(uploader)s\" \"&\"";
};
};
interactiveShellInit = ''
fish_vi_key_bindings
set fish_greeting # Disable greeting
set FLAKE_DIR "/home/fw/nix"
set HM_DIR "$FLAKE_DIR#fw@jobb"
set SYSTEM_DIR "$FLAKE_DIR#jobb"
set -Ux FZF_CTRL_R_OPTS "--reverse"
set -Ux FZF_TMUX_OPTS "-p"
set -e GOROOT
set -e GOPATH
gh completion -s fish > ~/.config/fish/completions/gh.fish
set -gx PATH $PATH $HOME/.krew/bin
# Mocha
set -Ux FZF_DEFAULT_OPTS "\
--color=bg+:#313244,bg:#1e1e2e,spinner:#f5e0dc,hl:#f38ba8 \
--color=fg:#cdd6f4,header:#f38ba8,info:#cba6f7,pointer:#f5e0dc \
--color=marker:#b4befe,fg+:#cdd6f4,prompt:#cba6f7,hl+:#f38ba8 \
--color=selected-bg:#45475a \
--multi"
'';
};
}

11
moduler/git.nix Normal file
View file

@ -0,0 +1,11 @@
{ pkgs, lib, ... }:
{
programs.git = {
enable = true;
userName = "fwastring";
userEmail = "fredrik@wastring.com";
extraConfig = {
url."git@github.com:".insteadOf = "https://github.com/";
};
};
}

19
moduler/gtk.nix Normal file
View file

@ -0,0 +1,19 @@
{ pkgs, ... }:
let
bibata-modern-ice = pkgs.runCommand "bibata-modern-ice" { } ''
mkdir -p $out/share/icons
ln -s ${pkgs.fetchzip {
url = "https://github.com/ful1e5/Bibata_Cursor/releases/download/v2.0.7/Bibata-Modern-Ice.tar.xz";
hash = "sha256-SG/NQd3K9DHNr9o4m49LJH+UC/a1eROUjrAQDSn3TAU=";
}} $out/share/icons/Bibata-Modern-Ice
'';
in
{
home.pointerCursor = {
package = bibata-modern-ice;
name = "Bibata-Modern-Ice";
size = 48;
gtk.enable = true;
x11.enable = true;
};
}

40
moduler/headless-home.nix Normal file
View file

@ -0,0 +1,40 @@
# This is your home-manager configuration file
# Use this to configure your home environment (it replaces ~/.config/nixpkgs/home.nix)
{
inputs,
lib,
config,
pkgs,
myhostname,
...
}:
{
imports = [
../shared/tmux.nix
../shared/fish.nix
../shared/git.nix
../shared/nixpkgs.nix
../shared/lazygit.nix
../shared/ssh.nix
../shared/oh-my-posh.nix
];
nixpkgs = {
overlays = [ ];
config = {
allowUnfree = true;
allowUnfreePredicate = _: true;
};
};
programs.home-manager.enable = true;
programs.fish.enable = true;
programs.man.generateCaches = false;
home.username = "fw";
home.homeDirectory = "/home/fw";
home.stateVersion = "25.05"; # Did you read the comment?
systemd.user.startServices = "sd-switch";
}

40
moduler/home.nix Normal file
View file

@ -0,0 +1,40 @@
{
inputs,
lib,
config,
pkgs,
myhostname,
...
}:
{
imports = [
../shared/dwm.nix
../shared/tmux.nix
../shared/fish.nix
../shared/git.nix
../shared/kitty.nix
../shared/dunst.nix
../shared/nixpkgs.nix
../shared/firefox.nix
../shared/zathura.nix
../shared/lazygit.nix
../shared/ssh.nix
../shared/aerc.nix
../shared/oh-my-posh.nix
../shared/gtk.nix
../shared/neovim.nix
../shared/k9s.nix
];
programs.home-manager.enable = true;
programs.fish.enable = true;
programs.man.generateCaches = false;
home.username = "fw";
home.homeDirectory = "/home/fw";
home.stateVersion = "25.05"; # Did you read the comment?
systemd.user.startServices = "sd-switch";
}

234
moduler/hyprland.nix Normal file
View file

@ -0,0 +1,234 @@
{ host
, config
, pkgs
, inputs
, ...
}:
let
in
{
environment.systemPackages = with pkgs; [
swww
grim
slurp
wl-clipboard
swappy
ydotool
hyprpolkitagent
hyprland-qtutils # needed for banners and ANR messages
];
nix.settings = {
substituters = ["https://hyprland.cachix.org"];
trusted-substituters = ["https://hyprland.cachix.org"];
trusted-public-keys = ["hyprland.cachix.org-1:a7pgxzMz7+chwVL3/pzj6jIBMioiJM7ypFP8PwtkuGc="];
};
programs.hyprland = {
enable = true;
# set the flake package
package = inputs.hyprland.packages.${pkgs.stdenv.hostPlatform.system}.hyprland;
# make sure to also set the portal package, so that they are in sync
portalPackage = inputs.hyprland.packages.${pkgs.stdenv.hostPlatform.system}.xdg-desktop-portal-hyprland;
};
home-manager.users.fw =
{ pkgs, ... }:
{
services = {
cliphist = {
enable = true;
};
};
wayland.windowManager.hyprland = {
enable = true;
xwayland = {
enable = true;
};
settings = {
"$terminal" = "kitty";
"$mod" = "ALT";
monitor = [
"DP-1, 1920x1080@144, 0x0, 1"
",prefered,auto,1"
];
xwayland = {
force_zero_scaling = true;
};
general = {
gaps_in = 6;
gaps_out = 6;
border_size = 2;
layout = "dwindle";
allow_tearing = true;
};
input = {
kb_layout = "se";
kb_options = [
"caps:escape"
];
follow_mouse = true;
touchpad = {
natural_scroll = true;
};
accel_profile = "flat";
sensitivity = 0;
};
decoration = {
rounding = 0;
active_opacity = 0.9;
inactive_opacity = 0.8;
fullscreen_opacity = 0.9;
blur = {
enabled = true;
xray = true;
special = false;
new_optimizations = true;
size = 14;
passes = 4;
brightness = 1;
noise = 0.01;
contrast = 1;
popups = true;
popups_ignorealpha = 0.6;
ignore_opacity = false;
};
};
animations = {
enabled = false;
bezier = [
"linear, 0, 0, 1, 1"
"md3_standard, 0.2, 0, 0, 1"
"md3_decel, 0.05, 0.7, 0.1, 1"
"md3_accel, 0.3, 0, 0.8, 0.15"
"overshot, 0.05, 0.9, 0.1, 1.1"
"crazyshot, 0.1, 1.5, 0.76, 0.92"
"hyprnostretch, 0.05, 0.9, 0.1, 1.0"
"menu_decel, 0.1, 1, 0, 1"
"menu_accel, 0.38, 0.04, 1, 0.07"
"easeInOutCirc, 0.85, 0, 0.15, 1"
"easeOutCirc, 0, 0.55, 0.45, 1"
"easeOutExpo, 0.16, 1, 0.3, 1"
"softAcDecel, 0.26, 0.26, 0.15, 1"
"md2, 0.4, 0, 0.2, 1"
];
animation = [
"windows, 1, 3, md3_decel, popin 60%"
"windowsIn, 1, 3, md3_decel, popin 60%"
"windowsOut, 1, 3, md3_accel, popin 60%"
"border, 1, 10, default"
"fade, 1, 3, md3_decel"
"layersIn, 1, 3, menu_decel, slide"
"layersOut, 1, 1.6, menu_accel"
"fadeLayersIn, 1, 2, menu_decel"
"fadeLayersOut, 1, 4.5, menu_accel"
"workspaces, 1, 7, menu_decel, slide"
"specialWorkspace, 1, 3, md3_decel, slidevert"
];
};
cursor = {
enable_hyprcursor = true;
};
dwindle = {
pseudotile = true;
preserve_split = true;
smart_split = false;
smart_resizing = false;
};
misc = {
disable_hyprland_logo = true;
disable_splash_rendering = true;
};
bind = [
# General
"$mod, return, exec, $terminal"
"$mod SHIFT, q, killactive"
"$mod SHIFT, e, exit"
"$mod SHIFT, x, exec, ${pkgs.hyprlock}/bin/hyprlock"
# Screen focus
"$mod, v, togglefloating"
"$mod, u, focusurgentorlast"
"$mod, tab, focuscurrentorlast"
"$mod, f, fullscreen"
# Screen resize
"$mod CTRL, h, resizeactive, -20 0"
"$mod CTRL, l, resizeactive, 20 0"
"$mod CTRL, k, resizeactive, 0 -20"
"$mod CTRL, j, resizeactive, 0 20"
# Workspaces
"$mod, 1, workspace, 1"
"$mod, 2, workspace, 2"
"$mod, 3, workspace, 3"
"$mod, 4, workspace, 4"
"$mod, 5, workspace, 5"
"$mod, 6, workspace, 6"
"$mod, 7, workspace, 7"
"$mod, 8, workspace, 8"
"$mod, 9, workspace, 9"
"$mod, 0, workspace, 10"
# Move to workspaces
"$mod SHIFT, 1, movetoworkspace,1"
"$mod SHIFT, 2, movetoworkspace,2"
"$mod SHIFT, 3, movetoworkspace,3"
"$mod SHIFT, 4, movetoworkspace,4"
"$mod SHIFT, 5, movetoworkspace,5"
"$mod SHIFT, 6, movetoworkspace,6"
"$mod SHIFT, 7, movetoworkspace,7"
"$mod SHIFT, 8, movetoworkspace,8"
"$mod SHIFT, 9, movetoworkspace,9"
"$mod SHIFT, 0, movetoworkspace,10"
# Navigation
"$mod, h, movefocus, l"
"$mod, l, movefocus, r"
"$mod, k, movefocus, u"
"$mod, j, movefocus, d"
# Applications
"$mod, q, exec, ${pkgs.firefox}/bin/firefox"
"$mod, d, exec, ${pkgs.rofi}/bin/rofi"
# Screencapture
"$mod, S, exec, ${pkgs.grim}/bin/grim | wl-copy"
"$mod SHIFT+ALT, S, exec, ${pkgs.grim}/bin/grim -g \"$(slurp)\" - | ${pkgs.swappy}/bin/swappy -f -"
];
bindm = [
"$mod, mouse:272, movewindow"
"$mod, mouse:273, resizewindow"
];
env = [
"NIXOS_OZONE_WL,1"
"_JAVA_AWT_WM_NONREPARENTING,1"
"QT_WAYLAND_DISABLE_WINDOWDECORATION,1"
"QT_QPA_PLATFORM,wayland"
"SDL_VIDEODRIVER,wayland"
"GDK_BACKEND,wayland"
"XDG_SESSION_TYPE,wayland"
"XDG_SESSION_DESKTOP,Hyprland"
"XDG_CURRENT_DESKTOP,Hyprland"
];
};
systemd = {
enable = true;
};
};
};
}

46
moduler/k3s.nix Normal file
View file

@ -0,0 +1,46 @@
{
inputs,
lib,
config,
pkgs,
myhostname,
...
}:
let
in
{
networking.firewall.allowedTCPPorts = [
6443
5173
8080
3000
];
services.k3s = {
enable = true;
role = "server";
extraFlags = toString ([
"--write-kubeconfig-mode \"0644\""
"--cluster-init"
"--disable servicelb"
"--disable traefik"
"--disable local-storage"
]);
clusterInit = true;
};
systemd.tmpfiles.rules = [
"L+ /usr/local/bin - - - - /run/current-system/sw/bin/"
];
services.openiscsi = {
enable = true;
name = "iqn.2016-04.com.open-iscsi:${myhostname}";
};
environment.systemPackages = with pkgs; [
k3s
cifs-utils
nfs-utils
git
];
}

10
moduler/k9s.nix Normal file
View file

@ -0,0 +1,10 @@
{ config, inputs, pkgs, ... }:
let
in
{
programs.k9s.enable = true;
xdg.configFile."k9s".source = inputs.k9s-config;
}

26
moduler/kitty.nix Normal file
View file

@ -0,0 +1,26 @@
{
pkgs,
lib,
myhostname,
...
}:
{
programs.kitty = {
enable = true;
font =
{
name = "ComicShannsMono Nerd Font";
size = 12;
};
shellIntegration = {
mode = "no-cursor";
};
themeFile = "Catppuccin-Latte";
settings = {
confirm_os_window_close = 2;
cursor_shape = "block";
cursor_blink_interval = 0;
enable_audio_bell = false;
};
};
}

29
moduler/lazygit.nix Normal file
View file

@ -0,0 +1,29 @@
{ pkgs, lib, ... }:
{
programs.lazygit = {
enable = true;
settings = {
gui = {
theme = {
activeBorderColor = [ "#fe640b" "bold" ];
inactiveBorderColor = [ "#6c6f85" ];
optionsTextColor = [ "#1e66f5" ];
selectedLineBgColor = [ "#ccd0da" ];
cherryPickedCommitBgColor = [ "#bcc0cc" ];
cherryPickedCommitFgColor = [ "#fe640b" ];
unstagedChangesColor = [ "#d20f39" ];
defaultFgColor = [ "#4c4f69" ];
searchingActiveBorderColor = [ "#df8e1d" ];
};
authorColors = {
"*" = "#7287fd";
};
showRandomTip = false;
showBottomLine = false;
sidePanelWidth = 0.5;
};
};
};
}

31
moduler/lsp.nix Normal file
View file

@ -0,0 +1,31 @@
# This is your system's configuration file.
# Use this to configure your system environment (it replaces /etc/nixos/configuration.nix)
{
inputs,
lib,
config,
pkgs,
myhostname,
...
}: {
environment.systemPackages = with pkgs; [
nixd
gopls
inputs.neovim-nightly-overlay.packages.${pkgs.system}.default
omnisharp-roslyn
nodePackages.vscode-json-languageserver
tailwindcss-language-server
dockerfile-language-server-nodejs
nodejs_22
bash-language-server
helm-ls
yaml-language-server
vue-language-server
vtsls
typescript
typescript-language-server
lua-language-server
marksman
];
}

13
moduler/neovim.nix Normal file
View file

@ -0,0 +1,13 @@
{ config, inputs, pkgs, ... }:
let
in
{
# Enable the Home Manager Neovim module if you haven't already
# programs.neovim.enable = true;
# Create a symlink from the Nix store to the Neovim config directory
xdg.configFile."nvim".source = inputs.nvim-config;
# Other Home Manager options...
}

29
moduler/network.nix Normal file
View file

@ -0,0 +1,29 @@
# This is your system's configuration file.
# Use this to configure your system environment (it replaces /etc/nixos/configuration.nix)
{
inputs,
lib,
config,
pkgs,
myhostname,
...
}: {
services.netbird = {
enable = true;
ui.enable = true;
package = pkgs.unstable.netbird;
};
environment.systemPackages = with pkgs; [
openvpn
networkmanagerapplet
networkmanager-l2tp
strongswan
networkmanager_strongswan
wireguard-tools
networkmanager
openssh
dig
];
}

323
moduler/nginx.nix Normal file
View file

@ -0,0 +1,323 @@
{ pkgs, lib, ... }:
{
networking.firewall = {
allowedTCPPorts = [ 80 443 ];
};
services.nginx = {
enable = true;
user = "nginx";
group = "nginx";
# Use recommended settings
recommendedGzipSettings = true;
recommendedOptimisation = true;
recommendedProxySettings = true;
recommendedTlsSettings = true;
virtualHosts = {
"brfmidgard.se" = {
sslCertificateKey = "/etc/letsencrypt/archive/brfmidgard.se/privkey1.pem";
sslCertificate = "/etc/letsencrypt/archive/brfmidgard.se/fullchain1.pem";
forceSSL = true;
locations."/" = {
proxyPass = "http://172.17.0.1:8005";
proxyWebsockets = true;
};
};
# "pass.brfmidgard.se" = {
# sslCertificateKey = "/etc/letsencrypt/archive/brfmidgard.se/privkey1.pem";
# sslCertificate = "/etc/letsencrypt/archive/brfmidgard.se/fullchain1.pem";
# forceSSL = true;
# locations."/" = {
# proxyPass = "http://172.17.0.1:21456";
# proxyWebsockets = true;
# };
# };
# "drive.brfmidgard.se" = {
# sslCertificateKey = "/etc/letsencrypt/archive/brfmidgard.se/privkey1.pem";
# sslCertificate = "/etc/letsencrypt/archive/brfmidgard.se/fullchain1.pem";
# forceSSL = true;
# locations."/" = {
# proxyPass = "http://172.16.57.1:13001";
# proxyWebsockets = true;
# };
# };
# "sandbox.brfmidgard.se" = {
# forceSSL = true;
# sslCertificateKey = "/etc/letsencrypt/archive/brfmidgard.se/privkey1.pem";
# sslCertificate = "/etc/letsencrypt/archive/brfmidgard.se/fullchain1.pem";
# locations."/" = {
# proxyPass = "http://172.16.57.1:13001";
# proxyWebsockets = true;
# };
# };
# "todo.brfmidgard.se" = {
# forceSSL = true;
# sslCertificateKey = "/etc/letsencrypt/archive/brfmidgard.se/privkey1.pem";
# sslCertificate = "/etc/letsencrypt/archive/brfmidgard.se/fullchain1.pem";
# locations."/" = {
# proxyPass = "http://172.17.0.1:13456";
# proxyWebsockets = true;
# };
# };
"wastring.com" = {
sslCertificateKey = "/certs/.lego/certificates/wastring.com.key";
sslCertificate = "/certs/.lego/certificates/wastring.com.crt";
forceSSL = true;
locations."/" = {
proxyPass = "http://172.17.0.1:8003";
proxyWebsockets = true;
};
};
"calibre.wastring.com" = {
sslCertificateKey = "/certs/.lego/certificates/wastring.com.key";
sslCertificate = "/certs/.lego/certificates/wastring.com.crt";
forceSSL = true;
locations."/" = {
proxyPass = "http://172.17.0.1:8880";
proxyWebsockets = true;
};
};
"download.wastring.com" = {
sslCertificateKey = "/certs/.lego/certificates/wastring.com.key";
sslCertificate = "/certs/.lego/certificates/wastring.com.crt";
forceSSL = true;
locations."/" = {
proxyPass = "http://172.17.0.1:28000";
proxyWebsockets = true;
};
};
"books.wastring.com" = {
sslCertificateKey = "/certs/.lego/certificates/wastring.com.key";
sslCertificate = "/certs/.lego/certificates/wastring.com.crt";
forceSSL = true;
locations."/" = {
proxyPass = "http://172.17.0.1:8083";
proxyWebsockets = true;
};
};
"rss.wastring.com" = {
sslCertificateKey = "/certs/.lego/certificates/wastring.com.key";
sslCertificate = "/certs/.lego/certificates/wastring.com.crt";
forceSSL = true;
locations."/" = {
proxyPass = "http://172.16.59.1:18080";
proxyWebsockets = true;
};
};
"shop.wastring.com" = {
sslCertificateKey = "/certs/.lego/certificates/wastring.com.key";
sslCertificate = "/certs/.lego/certificates/wastring.com.crt";
forceSSL = true;
locations."/" = {
proxyPass = "http://172.17.0.1:8980";
proxyWebsockets = true;
};
};
"todo.wastring.com" = {
sslCertificateKey = "/certs/.lego/certificates/wastring.com.key";
sslCertificate = "/certs/.lego/certificates/wastring.com.crt";
forceSSL = true;
locations."/" = {
proxyPass = "http://172.16.58.1:3456";
proxyWebsockets = true;
};
};
"secret.wastring.com" = {
sslCertificateKey = "/certs/.lego/certificates/wastring.com.key";
sslCertificate = "/certs/.lego/certificates/wastring.com.crt";
forceSSL = true;
locations."/" = {
proxyPass = "http://172.17.0.1:3004";
proxyWebsockets = true;
};
};
"budget.wastring.com" = {
sslCertificateKey = "/certs/.lego/certificates/wastring.com.key";
sslCertificate = "/certs/.lego/certificates/wastring.com.crt";
forceSSL = true;
locations."/" = {
proxyPass = "http://172.17.0.1:8098";
proxyWebsockets = true;
};
};
"bilder.wastring.com" = {
sslCertificateKey = "/certs/.lego/certificates/wastring.com.key";
sslCertificate = "/certs/.lego/certificates/wastring.com.crt";
forceSSL = true;
locations."/" = {
proxyPass = "http://172.17.0.1:2283";
proxyWebsockets = true;
extraConfig = ''
client_max_body_size 0;
'';
};
};
"git.wastring.com" = {
sslCertificateKey = "/certs/.lego/certificates/wastring.com.key";
sslCertificate = "/certs/.lego/certificates/wastring.com.crt";
forceSSL = true;
locations."/" = {
proxyPass = "http://192.168.16.1:3000";
proxyWebsockets = true;
};
};
"cal.wastring.com" = {
sslCertificateKey = "/certs/.lego/certificates/wastring.com.key";
sslCertificate = "/certs/.lego/certificates/wastring.com.crt";
forceSSL = true;
locations."/" = {
proxyPass = "http://172.17.0.1:5232";
proxyWebsockets = true;
};
};
"pass.wastring.com" = {
sslCertificateKey = "/certs/.lego/certificates/wastring.com.key";
sslCertificate = "/certs/.lego/certificates/wastring.com.crt";
forceSSL = true;
locations."/" = {
proxyPass = "http://172.24.0.1:9445";
proxyWebsockets = true;
};
};
"home.wastring.com" = {
sslCertificateKey = "/certs/.lego/certificates/wastring.com.key";
sslCertificate = "/certs/.lego/certificates/wastring.com.crt";
forceSSL = true;
locations."/" = {
# proxyPass = "http://172.17.0.1:8081";
proxyPass = "http://172.17.0.1:38080";
proxyWebsockets = true;
};
};
"drive.wastring.com" = {
sslCertificateKey = "/certs/.lego/certificates/wastring.com.key";
sslCertificate = "/certs/.lego/certificates/wastring.com.crt";
forceSSL = true;
locations."/" = {
proxyPass = "http://172.17.0.1:3001";
proxyWebsockets = true;
};
};
"sandbox.wastring.com" = {
sslCertificateKey = "/certs/.lego/certificates/wastring.com.key";
sslCertificate = "/certs/.lego/certificates/wastring.com.crt";
forceSSL = true;
locations."/" = {
proxyPass = "http://172.17.0.1:3001";
proxyWebsockets = true;
};
};
"files.wastring.com" = {
sslCertificateKey = "/certs/.lego/certificates/wastring.com.key";
sslCertificate = "/certs/.lego/certificates/wastring.com.crt";
forceSSL = true;
locations."/" = {
proxyPass = "http://172.17.0.1:8380";
proxyWebsockets = true;
};
};
"docs.wastring.com" = {
sslCertificateKey = "/certs/.lego/certificates/wastring.com.key";
sslCertificate = "/certs/.lego/certificates/wastring.com.crt";
forceSSL = true;
locations."/" = {
proxyPass = "http://172.17.0.1:8000";
proxyWebsockets = true;
};
};
"search.wastring.com" = {
sslCertificateKey = "/certs/.lego/certificates/wastring.com.key";
sslCertificate = "/certs/.lego/certificates/wastring.com.crt";
forceSSL = true;
locations."/" = {
proxyPass = "http://localhost:40080";
proxyWebsockets = true;
};
};
"latex.wastring.com" = {
sslCertificateKey = "/certs/.lego/certificates/wastring.com.key";
sslCertificate = "/certs/.lego/certificates/wastring.com.crt";
forceSSL = true;
locations."/" = {
proxyPass = "http://localhost:3080";
proxyWebsockets = true;
};
};
"soulseek.wastring.com" = {
sslCertificateKey = "/certs/.lego/certificates/wastring.com.key";
sslCertificate = "/certs/.lego/certificates/wastring.com.crt";
forceSSL = true;
locations."/" = {
proxyPass = "http://localhost:5030";
proxyWebsockets = true;
};
};
"board.wastring.com" = {
sslCertificateKey = "/certs/.lego/certificates/wastring.com.key";
sslCertificate = "/certs/.lego/certificates/wastring.com.crt";
forceSSL = true;
locations."/" = {
proxyPass = "http://localhost:8038";
proxyWebsockets = true;
};
};
"status.wastring.com" = {
sslCertificateKey = "/certs/.lego/certificates/wastring.com.key";
sslCertificate = "/certs/.lego/certificates/wastring.com.crt";
forceSSL = true;
locations."/" = {
proxyPass = "http://172.17.0.1:3008";
proxyWebsockets = true;
};
};
"music.wastring.com" = {
sslCertificateKey = "/certs/.lego/certificates/wastring.com.key";
sslCertificate = "/certs/.lego/certificates/wastring.com.crt";
forceSSL = true;
locations."/" = {
proxyPass = "http://172.17.0.1:4747";
proxyWebsockets = true;
};
};
"wedding.wastring.com" = {
sslCertificateKey = "/certs/.lego/certificates/wastring.com.key";
sslCertificate = "/certs/.lego/certificates/wastring.com.crt";
forceSSL = true;
locations."/" = {
proxyPass = "http://172.17.0.1:8002";
proxyWebsockets = true;
};
};
"message.wastring.com" = {
sslCertificateKey = "/certs/.lego/certificates/wastring.com.key";
sslCertificate = "/certs/.lego/certificates/wastring.com.crt";
forceSSL = true;
locations."/" = {
proxyPass = "http://172.17.0.1:2203";
proxyWebsockets = true;
};
};
"filmer.wastring.com" = {
sslCertificateKey = "/certs/.lego/certificates/wastring.com.key";
sslCertificate = "/certs/.lego/certificates/wastring.com.crt";
forceSSL = true;
locations."/" = {
proxyPass = "http://192.168.80.1:8096";
proxyWebsockets = true;
};
};
"kube.wastring.com" = {
sslCertificateKey = "/certs/.lego/certificates/wastring.com.key";
sslCertificate = "/certs/.lego/certificates/wastring.com.crt";
forceSSL = true;
locations."/" = {
proxyPass = "http://192.168.1.100";
proxyWebsockets = true;
};
};
};
};
}

12
moduler/nixpkgs.nix Normal file
View file

@ -0,0 +1,12 @@
{ pkgs, lib, ... }:
{
nixpkgs = {
# Configure your nixpkgs instance
config = {
allowUnfree = true;
permittedInsecurePackages = [
"electron-33.4.11"
];
};
};
}

133
moduler/oh-my-posh.nix Normal file
View file

@ -0,0 +1,133 @@
{ pkgs, lib, ... }:
{
programs.oh-my-posh = {
enable = true;
enableFishIntegration = true;
settings = {
"$schema"= "https://raw.githubusercontent.com/JanDeDobbeleer/oh-my-posh/main/themes/schema.json";
# Macchiato
# "palette" = {
# "os"= "#ACB0BE";
# "closer"= "p:os";
# "pink"= "#F5BDE6";
# "lavender"= "#B7BDF8";
# "blue"= "#8aadf4";
# "peach" = "#f5a97f";
# "red" = "#ed8796";
# "green" = "#a6da95";
# "mauve" = "#c6a0f6";
# };
# Latte
"palette" = {
"os"= "#ACB0BE";
"closer"= "p:os";
"pink" = "#ea76cb";
"lavender" = "#7287FD";
"blue" = "#1e66f5";
"peach" = "#fe640b";
"red" = "#d20f39";
"green" = "#40a02b";
"mauve" = "#8839ef";
};
"blocks"= [
{
"alignment"= "left";
"newline" = true;
"type"= "prompt";
"segments" = [
{
"background"= "transparent";
"foreground"= "p:blue";
# "powerline_symbol"= "\ue0b4";
# "leading_diamond"= "\ue0b6";
"style"= "diamond";
"template"= "{{.Icon}} ";
"type"= "os";
}
{
"foreground"= "p:peach";
"properties"= {
# "folder_icon"= "..\\ue5fe..";
"home_icon"= "~";
"style"= "unique";
};
"style"= "plain";
"template"= "{{ .Path }} ";
"type"= "path";
}
{
"foreground"= "p:green";
"properties"= {
# "branch_icon"= "\\ue725 ";
# "cherry_pick_icon"= "\\ue29b ";
# "commit_icon"= "\\uf417 ";
"fetch_status"= false;
"fetch_upstream_icon"= false;
# "merge_icon"= "\\ue727 ";
# "no_commits_icon"= "\\uf0c3 ";
# "rebase_icon"= "\\ue728 ";
# "revert_icon"= "\\uf0e2 ";
# "tag_icon"= "\\uf412 ";
};
"template"= "{{ .HEAD }} ";
"style"= "plain";
"type"= "git";
}
{
"style"= "plain";
"foreground"= "p:closer";
"type"= "text";
}
{
"foreground"= "p:mauve";
"style"= "plain";
"template"= "{{ .UserName }}@";
"type"= "session";
}
{
"foreground"= "p:peach";
"style"= "plain";
"template"= "{{ .HostName }}";
"type"= "session";
}
];
}
{
"type"= "prompt";
"alignment"= "left";
"newline" = true;
"segments" = [
{
"type" = "text";
"style" = "plain";
"background"= "transparent";
"foreground_templates"= [
"{{if gt .Code 0}}p:red{{end}}"
"{{if eq .Code 0}}p:green{{end}}"
];
"template"= ">";
}
];
}
];
"final_space"= true;
"version"= 2;
"transient_prompt"= {
"background"= "transparent";
"foreground_templates"= [
"{{if gt .Code 0}}p:red{{end}}"
"{{if eq .Code 0}}p:green{{end}}"
];
"template"= ">";
};
"secondary_prompt"= {
"background"= "transparent";
"foreground_templates"= [
"{{if gt .Code 0}}p:red{{end}}"
"{{if eq .Code 0}}p:green{{end}}"
];
"template"= ">";
};
};
};
}

17
moduler/openssh.nix Normal file
View file

@ -0,0 +1,17 @@
{ config, pkgs, ... }:
{
# Enable the OpenSSH daemon.
services.openssh = {
enable = true;
settings = {
AuthenticationMethods = "publickey password";
TrustedUserCAKeys = "/etc/ssh/ssh_ca.pub";
X11Forwarding = true;
Banner = "none";
PasswordAuthentication = true;
# PasswordAuthentication = false;
PubKeyAuthentication = true;
Port = 22;
};
};
}

View file

@ -0,0 +1,40 @@
# This is your system's configuration file.
# Use this to configure your system environment (it replaces /etc/nixos/configuration.nix)
{
inputs,
lib,
config,
pkgs,
myhostname,
...
}: {
environment.systemPackages = with pkgs; [
# GUI
unstable.feishin
unstable.signal-desktop
slack
speedcrunch
remmina
thunderbird
drawio
freecad-wayland
# Capturing
byzanz
scrot
# Displaying
zathura
feh
# System
pavucontrol
pulseaudio
devour # Swallow windows
caligula # Burn ISOs
# Transforms
imagemagick
pandoc
];
}

70
moduler/programs.nix Normal file
View file

@ -0,0 +1,70 @@
# This is your system's configuration file.
# Use this to configure your system environment (it replaces /etc/nixos/configuration.nix)
{
inputs,
lib,
config,
pkgs,
myhostname,
...
}: {
services.udev = {
extraRules = ''
KERNEL=="ttyACM0", MODE:="666"
ACTION=="add", KERNEL=="sd[a-e][0-9]", ENV{ID_FS_UUID}=="3039-3932", RUN+="${pkgs.systemd}/bin/systemd-mount --no-block -A -G -o gid=users,fmask=113,dmask=002 /dev/%k /mnt/sdcard"
ACTION=="add", KERNEL=="sd[a-e]", ENV{ID_FS_UUID}=="66BA-4EBA", RUN+="${pkgs.systemd}/bin/systemd-mount --no-block -A -G -o gid=users,fmask=113,dmask=002 /dev/%k /mnt/kobo"
'';
packages = with pkgs; [
vial
via
];
};
environment.systemPackages = with pkgs; [
# GUI
unstable.feishin
unstable.signal-desktop
thunderbird
libreoffice
discord
slack
speedcrunch
remmina
vial
via
drawio
freecad-wayland
ghostty
kdePackages.okular
xdg-user-dirs
# Browsers
librewolf
chawan
# Capturing
byzanz
scrot
# Displaying
zathura
feh
mpv
# System
pavucontrol
pulseaudio
devour # Swallow windows
caligula # Burn ISOs
ptouch-print
# Transforms
yt-dlp
imagemagick
pandoc
pinta
pastel
ffmpeg
darktable
];
}

73
moduler/ssh.nix Normal file
View file

@ -0,0 +1,73 @@
{ pkgs, lib, ... }:
{
programs.ssh = {
enable = true;
matchBlocks = {
"lth" = {
hostname = "login.student.lth.se";
port = 22;
user = "fr7658wa-s";
identityFile = "/home/fw/.ssh/id_rsa";
};
"git.wastring.com" = {
hostname = "git.wastring.com";
port = 80;
user = "git";
identityFile = "/home/fw/.ssh/id_ed25519";
};
"dm2" = {
hostname = "192.168.0.190";
port = 22;
user = "fw";
identityFile = "/home/fw/.ssh/fw-ssh-key";
};
"mac" = {
hostname = "192.168.0.149";
port = 22;
user = "ifacts";
identityFile = "/home/fw/.ssh/ifacts-ssh-key";
};
"malmo" = {
hostname = "192.168.0.138";
port = 22;
user = "ifacts";
identityFile = "/home/fw/.ssh/ifacts-ssh-key";
};
"kobo" = {
hostname = "192.168.1.192";
port = 22;
user = "root";
};
"kube01" = {
hostname = "192.168.0.177";
port = 22;
user = "fw";
identityFile = "/home/fw/.ssh/fw-ssh-key";
};
"kube02" = {
hostname = "192.168.0.159";
port = 22;
user = "fw";
identityFile = "/home/fw/.ssh/fw-ssh-key";
};
"kube03" = {
hostname = "192.168.0.182";
port = 22;
user = "fw";
identityFile = "/home/fw/.ssh/fw-ssh-key";
};
"runner01" = {
hostname = "192.168.0.184";
port = 22;
user = "fw";
identityFile = "/home/fw/.ssh/fw-ssh-key";
};
"docker03" = {
hostname = "192.168.0.118";
port = 22;
user = "fw";
identityFile = "/home/fw/.ssh/fw-ssh-key";
};
};
};
}

12
moduler/st.nix Normal file
View file

@ -0,0 +1,12 @@
{ pkgs, ...}:
{
environment.systemPackages = with pkgs; [
(st.overrideAttrs (oldAttrs: rec {
src = builtins.fetchGit {
url = "https://github.com/fwastring/st";
rev = "2c6e38d2e735116e902962d03e8d7c88db8094bd";
};
buildInputs = oldAttrs.buildInputs ++ [ xorg.libX11.dev xorg.libXft imlib2 xorg.libXinerama pkg-config];
}))
];
}

30
moduler/sway.nix Normal file
View file

@ -0,0 +1,30 @@
{ config, pkgs, lib, ... }:
{
environment.systemPackages = with pkgs; [
grim # screenshot functionality
slurp # screenshot functionality
wl-clipboard # wl-copy and wl-paste for copy/paste from stdin / stdout
mako # notification system developed by swaywm maintainer
waypipe
];
# Enable the gnome-keyring secrets vault.
# Will be exposed through DBus to programs willing to store secrets.
services.gnome.gnome-keyring.enable = true;
# enable Sway window manager
programs.sway = {
enable = true;
wrapperFeatures.gtk = true;
};
services.greetd = {
enable = true;
settings = {
default_session = {
command = "${pkgs.greetd.tuigreet}/bin/tuigreet --time --cmd sway";
user = "greeter";
};
};
};
}

86
moduler/system.nix Normal file
View file

@ -0,0 +1,86 @@
# This is your system's configuration file.
# Use this to configure your system environment (it replaces /etc/nixos/configuration.nix)
{
inputs,
lib,
config,
pkgs,
myhostname,
...
}: {
services.pcscd.enable = true;
programs.gnupg.agent = {
enable = true;
enableSSHSupport = true;
};
programs.nh = {
enable = true;
clean.enable = true;
clean.extraArgs = "--keep-since 4d --keep 3";
flake = "/home/fw/nix";
};
environment.systemPackages = with pkgs; [
# System
libnotify
lf
xsel
xbanish
unzip
zip
wget
alsa-utils
htop
procps
fzf
eza
btop
xclip
dysk
rsync
procs
dust
brightnessctl
lolcat
fortune
cowsay
ripgrep
poppler_utils
grc
pkg-config
vim
bat
fd
bluez
bluez-tools
openssl
imagemagick
pandoc
texliveFull
fastfetch
keyutils
pinentry-all
(pass.withExtensions (ext: with ext; [
pass-import
pass-genphrase
pass-update
]))
lazygit
chawan
go-passbolt-cli
waypipe
wl-clipboard
smartmontools
# Typesetting
typst
typstyle
tinymist
websocat
nix-search-cli
libsixel
];
}

45
moduler/tmux.nix Normal file
View file

@ -0,0 +1,45 @@
{ pkgs, ... }:
{
programs.tmux = {
enable = true;
mouse = true;
prefix = "C-a";
terminal = "st";
keyMode = "vi";
escapeTime = 0;
baseIndex = 1;
plugins = with pkgs; [
tmuxPlugins.sensible
tmuxPlugins.pain-control
tmuxPlugins.sessionist
{
plugin = fw-pkgs.tmuxPlugins.minimal;
extraConfig = ''
bind-key b set-option status
'';
}
];
extraConfig = ''
set -g set-clipboard on
set -g base-index 1
set-window-option -g pane-base-index 1
set-window-option -g mode-keys vi
bind-key -T copy-mode-vi v send-keys -X begin-selection
bind -T copy-mode-vi y send-keys -X copy-pipe-and-cancel 'xclip -in -selection clipboard'
bind -T copy-mode-vi MouseDragEnd1Pane send-keys -X copy-pipe-and-cancel "xclip -i -f -selection primary | xclip -i -selection clipboard"
set -g default-terminal "st-256color"
set -g terminal-overrides "st-256color"
# set -g default-terminal "xterm-kitty"
# set -g terminal-overrides "xterm-kitty"
set -ga terminal-overrides ",xterm-256color:Tc"
set -as terminal-overrides ',*:Smulx=\E[4::%p1%dm'
set -as terminal-overrides ',*:Setulc=\E[58::2::%p1%{65536}%/%d::%p1%{256}%/%{255}%&%d::%p1%{255}%&%d%;m'
'';
};
}

31
moduler/users.nix Normal file
View file

@ -0,0 +1,31 @@
{
config,
pkgs,
...
}:
{
users = {
defaultUserShell = pkgs.bash;
users = {
fw = {
initialPassword = "password";
isNormalUser = true;
description = "Fredrik Wastring";
extraGroups = [
"networkmanager"
"wheel"
"audio"
"docker"
"input"
];
openssh.authorizedKeys = {
keys = [
"ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQDALsdpwvC0w/Aj+1fWtzJyyWoUrGkdh8o2thVHeQQBNo0D7cmVberYmi4Cv9gWGX6PaElrnOl0KRdGyro2wxOYokSxgk2VgWW67BFITAQAbKyG2NhXXPbhb4jccDo7WH7TtOG8IofuJTPRu1Duda6k4RN0I0CkyAN6LGX+zy49cq0qKf9ijXYhCDYNih3+Fu/ig0aW/SYmsVoUl2VFTWdI5x5/wLvIjTEZhmAtYIeYADaLnom356cFrUysZa++FUujQAz3Ow236BvP95XZdTsqvfWNZFNIpC9VYF72JeIDCs5wDIr0GFmanF2On1nar+jJpoOE8SdHt357p5g/PqXV5TisN2xQRkqVwO9tWtMl4sF84jA4ULnY2gQWv9jErMxymUQ1IwuPUzDDlbRHCtfexAtkBy7wv6xslKAzG1QahvF/btNs5Caj3LN31rgAuxyooCbKGKTeBP3kHPKcz1iupgidfbO/QqVXBRQJTEdGyAKa8hVmLQZZPC/XUhxESAk= fw@fw-nix"
"ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC8ku8iCb7tXd/tfxYDW+Tj8K9kpfrYZciYUZ6tBpO80inm4EImtfyEeJTuqDWMKov2BftUKs8brNeTBCXUEvU1P0+cpOP9RtYA5tfBXf3su+iVSswJJStIxNboXHrEGKdJJRNsTv/9agshDSUBy6G5TI1cXhv/updornfA4fwOMqOmtlYEn6XCRnsrO6NBLc/uLckdbF75HOsoLvezRvuqTLjpapjaUKGVPrgNXiclIKHmuOx71kgD4FX3rSz9FgKjnfu3a7DBbrHsf/g+N9PjNF1muN9UOV6nK3WwiO9BMWi7NpAWfzJOeZg9chqzI+U6CcsqYVeESgL41so+dnv3 fw@laptop"
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIP34dnsZSnWdDvd+3BXDwcw7wP0PjPEx2eCdBQJyGD6O fw@laptop"
];
};
};
};
};
}

13
moduler/zathura.nix Normal file
View file

@ -0,0 +1,13 @@
{ pkgs, lib, ... }:
{
programs.zathura = {
enable = true;
options = {
selection-clipboard = "clipboard";
font = "FiraCodeNerdFont Normal 12";
};
extraConfig = ''
include catppuccin-latte
'';
};
}