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

View file

@ -30,13 +30,17 @@ in
yq
skopeo
umoci
velero
podman-tui
azure-cli
dotnetCorePackages.sdk_8_0_3xx
dotnetCorePackages.dotnet_9.sdk
google-cloud-sdk
jira-cli-go
gh
allure
kubectx
python314
awscli
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-language-server
lua-language-server
marksman
];
}

View file

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

View file

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

View file

@ -34,21 +34,19 @@
}
];
shellAbbrs = {
ls = "eza -l --no-time --no-permissions --no-user";
k = "kubectl";
ls = "eza -l";
ka = "kubectl apply -f";
e = "nvim";
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";
latest = "git log | head -1 | awk '{print $2;}' | xsel -ib";
vpnup = "nmcli con up 'iFacts VPN'";
e = "kubectx";
s = {
setCursor = "%";
expansion = "cha https://search.wastring.com/search?q=%";
};
vpndown = {
c = {
setCursor = "%";
expansion = "nmcli con down 'iFacts VPN'";
expansion = "ssh 'fw:%@gateway.internalifacts.se' -p 2222";
};
dl = {
setCursor = "&";
@ -65,6 +63,8 @@
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 "\

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