Merge branch 'main' of github.com:fwastring/nix

This commit is contained in:
fwastring 2025-09-03 09:36:24 +02:00
commit 32da6a2b70
8 changed files with 133 additions and 27 deletions

View file

@ -14,6 +14,7 @@
./network.nix ./network.nix
./programs.nix ./programs.nix
./system.nix ./system.nix
./sway.nix
]; ];
nixpkgs = { nixpkgs = {
overlays = [ overlays = [
@ -49,10 +50,21 @@
auto-optimise-store = true; auto-optimise-store = true;
}; };
virtualisation.docker = { 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; enable = true;
liveRestore = false; liveRestore = false;
}; };
};
services.pulseaudio.enable = false; services.pulseaudio.enable = false;
security.rtkit.enable = true; security.rtkit.enable = true;
@ -120,6 +132,7 @@
console.keyMap = "sv-latin1"; console.keyMap = "sv-latin1";
environment.systemPackages = with pkgs; [ environment.systemPackages = with pkgs; [
waypipe
(st.overrideAttrs (oldAttrs: rec { (st.overrideAttrs (oldAttrs: rec {
src = builtins.fetchGit { src = builtins.fetchGit {
url = "https://github.com/fwastring/st"; url = "https://github.com/fwastring/st";
@ -160,19 +173,19 @@
"ipsec.d/ipsec.nm-l2tp.secrets" "ipsec.d/ipsec.nm-l2tp.secrets"
]; ];
}; };
xserver = { # xserver = {
displayManager = { # displayManager = {
startx.enable = true; # startx.enable = true;
}; # };
enable = true; # enable = true;
xkb = { # xkb = {
layout = "se"; # layout = "se";
variant = ""; # variant = "";
}; # };
windowManager.dwm = { # windowManager.dwm = {
enable = true; # enable = true;
}; # };
}; # };
blueman = { blueman = {
enable = true; enable = true;
}; };

View file

@ -30,13 +30,17 @@ in
yq yq
skopeo skopeo
umoci umoci
velero
podman-tui
azure-cli azure-cli
dotnetCorePackages.sdk_8_0_3xx dotnetCorePackages.dotnet_9.sdk
google-cloud-sdk google-cloud-sdk
jira-cli-go jira-cli-go
gh gh
allure allure
kubectx
python314
awscli awscli
unstable.minio-client unstable.minio-client

46
config/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
];
}

View file

@ -26,5 +26,6 @@
typescript typescript
typescript-language-server typescript-language-server
lua-language-server lua-language-server
marksman
]; ];
} }

View file

@ -63,6 +63,10 @@
])) ]))
lazygit lazygit
chawan chawan
go-passbolt-cli
waypipe
wl-clipboard
smartmontools
# Typesetting # Typesetting
typst typst

View file

@ -18,6 +18,7 @@
../../config/lsp.nix ../../config/lsp.nix
../../config/network.nix ../../config/network.nix
../../config/system.nix ../../config/system.nix
../../config/k3s.nix
]; ];
nixpkgs = { nixpkgs = {
overlays = [ overlays = [
@ -53,10 +54,24 @@
auto-optimise-store = true; auto-optimise-store = true;
}; };
virtualisation.docker = {
# virtualisation.containers.enable = 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; enable = true;
liveRestore = false; liveRestore = false;
}; };
};
networking.networkmanager.enable = true; networking.networkmanager.enable = true;

View file

@ -34,21 +34,19 @@
} }
]; ];
shellAbbrs = { shellAbbrs = {
ls = "eza -l --no-time --no-permissions --no-user"; ls = "eza -l";
k = "kubectl";
ka = "kubectl apply -f"; ka = "kubectl apply -f";
e = "nvim";
t = "timew"; 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"; cam = "jira issue create && jira issue assign && jira issue move";
latest = "git log | head -1 | awk '{print $2;}' | xsel -ib"; e = "kubectx";
vpnup = "nmcli con up 'iFacts VPN'";
s = { s = {
setCursor = "%"; setCursor = "%";
expansion = "cha https://search.wastring.com/search?q=%"; expansion = "cha https://search.wastring.com/search?q=%";
}; };
vpndown = { c = {
setCursor = "%"; setCursor = "%";
expansion = "nmcli con down 'iFacts VPN'"; expansion = "ssh 'fw:%@gateway.internalifacts.se' -p 2222";
}; };
dl = { dl = {
setCursor = "&"; setCursor = "&";
@ -65,6 +63,8 @@
set -Ux FZF_TMUX_OPTS "-p" set -Ux FZF_TMUX_OPTS "-p"
set -e GOROOT set -e GOROOT
set -e GOPATH set -e GOPATH
gh completion -s fish > ~/.config/fish/completions/gh.fish
set -gx PATH $PATH $HOME/.krew/bin
# Mocha # Mocha
set -Ux FZF_DEFAULT_OPTS "\ set -Ux FZF_DEFAULT_OPTS "\

23
uninstal.sh Executable file
View file

@ -0,0 +1,23 @@
#!/bin/sh
set -x
systemctl stop k3s
systemctl disable k3s
systemctl daemon-reload
rm -f /etc/systemd/system/k3s.service
rm -f /usr/local/bin/k3s
if [ -L /usr/local/bin/kubectl ]; then
rm -f /usr/local/bin/kubectl
fi
if [ -L /usr/local/bin/crictl ]; then
rm -f /usr/local/bin/crictl
fi
if [ -e /sys/fs/cgroup/systemd/system.slice/k3s.service/cgroup.procs ]; then
kill -9 `cat /sys/fs/cgroup/systemd/system.slice/k3s.service/cgroup.procs`
fi
umount `cat /proc/self/mounts | awk '{print $2}' | grep '^/run/k3s'`
umount `cat /proc/self/mounts | awk '{print $2}' | grep '^/var/lib/rancher/k3s'`
rm -rf /var/lib/rancher/k3s
rm -rf /etc/rancher/k3s
rm -f /usr/local/bin/k3s-uninstall.sh