From 6fe5df46364f5ad8a6c644bc7ad51216faf06e7d Mon Sep 17 00:00:00 2001 From: FredzyW Date: Mon, 15 Jul 2024 14:04:28 +0200 Subject: [PATCH 1/3] Added new xinitrc --- .xinitrc.jobb | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100755 .xinitrc.jobb diff --git a/.xinitrc.jobb b/.xinitrc.jobb new file mode 100755 index 0000000..814895b --- /dev/null +++ b/.xinitrc.jobb @@ -0,0 +1,24 @@ +#!/bin/sh +# +if test -z "$DBUS_SESSION_BUS_ADDRESS"; then + eval $(dbus-launch --exit-with-session --sh-syntax) +fi +systemctl --user import-environment DISPLAY XAUTHORITY + +if command -v dbus-update-activation-environment >/dev/null 2>&1; then + dbus-update-activation-environment DISPLAY XAUTHORITY +fi + +xrdb -merge ~/.Xresources +setxkbmap -option caps:swapescape + +feh --bg-scale ~/nix/wallpapers/inverted.png + +dwmblocks & +dunst & +xbanish & + +xrandr --output "DP-1-1" --auto --same-as "eDP-1" + +exec dwm + From f8cc052f3c33f2a23ef83120b517cf45deef667a Mon Sep 17 00:00:00 2001 From: FredzyW Date: Mon, 15 Jul 2024 14:04:43 +0200 Subject: [PATCH 2/3] Lots of config --- config/base.nix | 34 ++++++++--------- config/home.nix | 19 +++++++++- maskiner/desktop/configuration.nix | 1 + maskiner/jobb/configuration.nix | 59 ++++++++++++++++-------------- maskiner/laptop/configuration.nix | 5 +++ shared/fish.nix | 10 +++++ shared/git.nix | 3 ++ shared/kitty.nix | 3 +- shared/ssh.nix | 12 ++++++ 9 files changed, 98 insertions(+), 48 deletions(-) diff --git a/config/base.nix b/config/base.nix index aea7616..cc85ad8 100644 --- a/config/base.nix +++ b/config/base.nix @@ -90,23 +90,23 @@ boot.loader.efi.canTouchEfiVariables = true; console.keyMap = "sv-latin1"; - systemd.services.vdirsyncer = { - serviceConfig.Type = "oneshot"; - serviceConfig.User = "fw"; - path = with pkgs; [ vdirsyncer ]; - script = '' - vdirsyncer -c "/home/fw/.config/vdirsyncer/config" sync - ''; - }; - systemd.timers.vdirsyncer = { - wantedBy = [ "timers.target" ]; - partOf = [ "vdirsyncer.service" ]; - timerConfig = { - OnBootSec = "5m"; - OnUnitActiveSec = "5m"; - Unit = "vdirsyncer.service"; - }; - }; + # systemd.services.vdirsyncer = { + # serviceConfig.Type = "oneshot"; + # serviceConfig.User = "fw"; + # path = with pkgs; [ vdirsyncer ]; + # script = '' + # vdirsyncer -c "/home/fw/.config/vdirsyncer/config" sync + # ''; + # }; + # systemd.timers.vdirsyncer = { + # wantedBy = [ "timers.target" ]; + # partOf = [ "vdirsyncer.service" ]; + # timerConfig = { + # OnBootSec = "5m"; + # OnUnitActiveSec = "5m"; + # Unit = "vdirsyncer.service"; + # }; + # }; environment.systemPackages = [( pkgs.catppuccin-sddm.override { diff --git a/config/home.nix b/config/home.nix index 5f9e54c..b2e593e 100644 --- a/config/home.nix +++ b/config/home.nix @@ -76,14 +76,28 @@ xorg.xmodmap playerctl openssl + libiconv + pkg-config libsecret + go + ghorg + libsixel + kompose #Terminal + weechat + jira-cli-go + texliveSmall + jq + + vscode + sc-im gnuplot bison vdirsyncer + todoist todoman calcure python311Packages.urwid @@ -117,10 +131,10 @@ azuredatastudio adrs opentofu - kubernetes lazydocker #Desktop + openvpn3 aerc firefox thunderbird @@ -171,6 +185,7 @@ nodePackages_latest.vls nodePackages_latest.volar vscode-langservers-extracted + gopls #VPN openvpn @@ -183,7 +198,7 @@ programs.fish.enable = true; xsession.enable = true; - xsession.windowManager.command = if myhostname == "laptop" then "/home/fw/nix/.xinitrc.laptop" else "/home/fw/nix/.xinitrc"; + xsession.windowManager.command = if myhostname == "laptop" then "/home/fw/nix/.xinitrc.laptop" else if myhostname == "jobb" then "/home/fw/nix/.xinitrc.jobb" else "/home/fw/nix/.xinitrc"; home.username = "fw"; home.homeDirectory = "/home/fw"; diff --git a/maskiner/desktop/configuration.nix b/maskiner/desktop/configuration.nix index 0ec86cc..7e12414 100644 --- a/maskiner/desktop/configuration.nix +++ b/maskiner/desktop/configuration.nix @@ -27,6 +27,7 @@ networking.firewall = { { from = 8000; to = 8010; } ]; }; + networking.firewall.allowedUDPPorts = [ 22000 21027 ]; services = { diff --git a/maskiner/jobb/configuration.nix b/maskiner/jobb/configuration.nix index 2d56b82..edf4902 100644 --- a/maskiner/jobb/configuration.nix +++ b/maskiner/jobb/configuration.nix @@ -16,34 +16,37 @@ ]; networking.hostName = myhostname; - networking.firewall = { - enable = true; - allowedTCPPorts = [ 80 443 8384 22000]; - }; - networking.firewall.allowedUDPPorts = [ 22000 21027 ]; - services = { - syncthing = { - enable = true; - user = "fw"; - dataDir = "/home/fw/syncthing"; - configDir = "/home/fw/.config/syncthing"; - overrideDevices = true; # overrides any devices added or deleted through the WebUI - overrideFolders = true; # overrides any folders added or deleted through the WebUI - guiAddress = "0.0.0.0:8384"; - settings = { - devices = { - "desktop" = { id = "BGEQVAA-JZM7DQB-7NFEDQ6-K7Q3HQL-P6OSNJ2-TMA3N7B-E6RP3HQ-OAMWJQL"; }; - "laptop" = { id = "2VEN7O3-PB3G2MK-XJI7R5Z-6MHTNN2-WMXERIX-6G7QWSK-VKSWOSH-Q5WFDAI"; }; - }; - folders = { - "Documents" = { # Name of folder in Syncthing, also the folder ID - path = "/home/fw/docs"; # Which folder to add to Syncthing - devices = [ "desktop" ]; # Which devices to share the folder with - }; - }; - }; - }; - }; + + services.k3s = { + enable = true; + role = "server"; + token = "supersupersecretkey"; + clusterInit = true; + }; + + # services = { + # syncthing = { + # enable = true; + # user = "fw"; + # dataDir = "/home/fw/syncthing"; + # configDir = "/home/fw/.config/syncthing"; + # overrideDevices = true; # overrides any devices added or deleted through the WebUI + # overrideFolders = true; # overrides any folders added or deleted through the WebUI + # guiAddress = "0.0.0.0:8384"; + # settings = { + # devices = { + # "desktop" = { id = "BGEQVAA-JZM7DQB-7NFEDQ6-K7Q3HQL-P6OSNJ2-TMA3N7B-E6RP3HQ-OAMWJQL"; }; + # "laptop" = { id = "2VEN7O3-PB3G2MK-XJI7R5Z-6MHTNN2-WMXERIX-6G7QWSK-VKSWOSH-Q5WFDAI"; }; + # }; + # folders = { + # "Documents" = { # Name of folder in Syncthing, also the folder ID + # path = "/home/fw/docs"; # Which folder to add to Syncthing + # devices = [ "desktop" ]; # Which devices to share the folder with + # }; + # }; + # }; + # }; + # }; services.xserver.dpi = 140; diff --git a/maskiner/laptop/configuration.nix b/maskiner/laptop/configuration.nix index 7209f41..46cd0c1 100644 --- a/maskiner/laptop/configuration.nix +++ b/maskiner/laptop/configuration.nix @@ -17,6 +17,11 @@ networking.hostName = myhostname; + environment.systemPackages = with pkgs; [ + dotnet-sdk_8 + ]; + + services.xserver.dpi = 140; services = { syncthing = { diff --git a/shared/fish.nix b/shared/fish.nix index d088ed6..e0665b4 100644 --- a/shared/fish.nix +++ b/shared/fish.nix @@ -43,9 +43,18 @@ dev="nix develop --command fish"; spot="steam-run ~/program/spotify_player"; sc="sc-im"; + e="nvim"; + c="ssh"; + home="home-manager switch --flake $HM_DIR"; + reb="sudo nixos-rebuild switch --flake $SYSTEM_DIR"; + cam="jira issue create && jira issue assign && jira issue move"; }; interactiveShellInit = '' 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 GOPRIVATE "github.com/iFacts" # Macchiato set -Ux FZF_DEFAULT_OPTS "--color=fg:#f8f8f2,bg:#282a36,hl:#bd93f9 --color=fg+:#f8f8f2,bg+:#44475a,hl+:#bd93f9 --color=info:#ffb86c,prompt:#50fa7b,pointer:#ff79c6 --color=marker:#ff79c6,spinner:#ffb86c,header:#6272a4" @@ -54,6 +63,7 @@ # --color=bg+:#ccd0da,bg:#eff1f5,spinner:#dc8a78,hl:#d20f39 \ # --color=fg:#4c4f69,header:#d20f39,info:#8839ef,pointer:#dc8a78 \ # --color=marker:#dc8a78,fg+:#4c4f69,prompt:#8839ef,hl+:#d20f39" + fish_add_path /home/fw/.cargo/bin ''; }; } diff --git a/shared/git.nix b/shared/git.nix index 9f8bfcc..4470f24 100644 --- a/shared/git.nix +++ b/shared/git.nix @@ -4,5 +4,8 @@ enable = true; userName = "FredzyW"; userEmail = "fredrik@wastring.com"; + extraConfig = { + url."git@github.com:".insteadOf = "https://github.com/"; + }; }; } diff --git a/shared/kitty.nix b/shared/kitty.nix index 786138f..dc6a322 100644 --- a/shared/kitty.nix +++ b/shared/kitty.nix @@ -13,7 +13,8 @@ mode = "no-cursor"; }; # theme = "Catppuccin-Latte"; - theme = "Catppuccin-Macchiato"; + theme = "Catppuccin-Mocha"; + # theme = "Catppuccin-Macchiato"; settings = { confirm_os_window_close = 2; cursor_shape = "block"; diff --git a/shared/ssh.nix b/shared/ssh.nix index ec12ced..dc61c3c 100644 --- a/shared/ssh.nix +++ b/shared/ssh.nix @@ -50,6 +50,18 @@ user = "github"; identityFile = "/home/fw/.ssh/github-ssh-key"; }; + "backup1" = { + hostname = "192.168.0.220"; + port = 22; + user = "fw"; + identityFile = "/home/fw/.ssh/fw-ssh-key"; + }; + "dashboard" = { + hostname = "192.168.0.159"; + port = 22; + user = "fw"; + identityFile = "/home/fw/.ssh/fw-ssh-key"; + }; }; }; } From fa3d7000bfe3eec54fdc2cae546f180a4602f155 Mon Sep 17 00:00:00 2001 From: FredzyW Date: Tue, 16 Jul 2024 10:24:47 +0200 Subject: [PATCH 3/3] Add alacritty --- shared/alacritty.nix | 86 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 86 insertions(+) create mode 100644 shared/alacritty.nix diff --git a/shared/alacritty.nix b/shared/alacritty.nix new file mode 100644 index 0000000..f89c6ba --- /dev/null +++ b/shared/alacritty.nix @@ -0,0 +1,86 @@ +{ pkgs, lib, myhostname, ... }: +{ + programs.alacritty = { + enable = true; + settings = { + colors = { + primary = { + background = "#1e1e2e"; + foreground = "#cdd6f4"; + dim_foreground = "#7f849c"; + bright_foreground = "#cdd6f4"; + }; + cursor = { + text = "#1e1e2e"; + cursor = "#f5e0dc"; + }; + vi_mode_cursor = { + text = "#1e1e2e"; + cursor = "#b4befe"; + }; + search = { + matches = { + foreground = "#1e1e2e"; + background = "#a6adc8"; + }; + focused_match = { + foreground = "#1e1e2e"; + background = "#a6e3a1"; + }; + }; + footer_bar = { + foreground = "#1e1e2e"; + background = "#a6adc8"; + }; + hints = { + start = { + foreground = "#1e1e2e"; + background = "#f9e2af"; + }; + end = { + foreground = "#1e1e2e"; + background = "#a6adc8"; + }; + }; + selection = { + text = "#1e1e2e"; + background = "#f5e0dc"; + }; + normal = { + black = "#45475a"; + red = "#f38ba8"; + green = "#a6e3a1"; + yellow = "#f9e2af"; + blue = "#89b4fa"; + magenta = "#f5c2e7"; + cyan = "#94e2d5"; + white = "#bac2de"; + }; + bright = { + black = "#585b70"; + red = "#f38ba8"; + green = "#a6e3a1"; + yellow = "#f9e2af"; + blue = "#89b4fa"; + magenta = "#f5c2e7"; + cyan = "#94e2d5"; + white = "#a6adc8"; + }; + dim = { + black = "#45475a"; + red = "#f38ba8"; + green = "#a6e3a1"; + yellow = "#f9e2af"; + blue = "#89b4fa"; + magenta = "#f5c2e7"; + cyan = "#94e2d5"; + white = "#bac2de"; + }; + indexed_colors = [ + { index = 16; color = "#fab387"; } + { index = 17; color = "#f5e0dc"; } + ]; + }; + }; + }; +}