This commit is contained in:
fwastring 2025-09-06 13:54:37 +02:00
parent 70b6634137
commit 6a9b5e8267
16 changed files with 154 additions and 626 deletions

View file

@ -1,14 +0,0 @@
# Update Neovim
1. Update the version controlled code
2. Run:
```bash
nix flake lock --update-input nvim-config
```
3. Run:
```bash
home-manager switch --flake "/home/fw/nix#fw@jobb"
```

View file

@ -1,18 +1,5 @@
#!/bin/sh #!/bin/sh
#sudo cp /etc/nixos/hardware-configuration.nix ./$1/nixos sudo cp /etc/nixos/hardware-configuration.nix ./$1/nixos
#sudo nixos-rebuild switch --flake ".#$2" sudo nixos-rebuild switch --flake "/home/fw/nix#$1"
sudo nix-channel --add https://github.com/nix-community/home-manager/archive/release-25.05.tar.gz home-manager
sudo nix-channel --update
nix-shell '<home-manager>' -A install
#cp .xinitrc ~
#mkdir ~/wallpapers
#cp ./wallpapers/nix-black-4k.png ~/wallpapers/
#home-manager switch --flake ".#$3@$2"

View file

@ -14,9 +14,12 @@ let
btusb = pkgs.callPackage ../../moduler/btusb.nix { inherit (config.boot.kernelPackages) kernel; }; btusb = pkgs.callPackage ../../moduler/btusb.nix { inherit (config.boot.kernelPackages) kernel; };
in in
{ {
imports = imports = [
[ # Include the results of the hardware scan. # Include the results of the hardware scan.
./hardware-configuration.nix ./hardware-configuration.nix
../../moduler/base.nix
inputs.home-manager.nixosModules.home-manager inputs.home-manager.nixosModules.home-manager
../../moduler/users.nix ../../moduler/users.nix
../../moduler/network.nix ../../moduler/network.nix
@ -26,104 +29,27 @@ in
../../moduler/lsp.nix ../../moduler/lsp.nix
../../moduler/sway.nix ../../moduler/sway.nix
../../moduler/hyprland.nix ../../moduler/hyprland.nix
../../moduler/sound.nix
]; ];
home-manager.extraSpecialArgs = { inherit inputs pkgs; }; home-manager.extraSpecialArgs = { inherit inputs pkgs; };
home-manager.users.fw = { home-manager.users.fw = {
imports = [ imports = [
./../../config/home.nix ./../../moduler/home.nix
]; ];
}; };
# Bootloader. # Bootloader.
boot.loader.systemd-boot.enable = true;
boot.loader.efi.canTouchEfiVariables = true;
boot.kernelPackages = pkgs.linuxPackages_latest; boot.kernelPackages = pkgs.linuxPackages_latest;
hardware.enableRedistributableFirmware = true;
boot.extraModulePackages = [ boot.extraModulePackages = [
(btusb.overrideAttrs (_: { (btusb.overrideAttrs (_: {
patches = [ ../../config/btusb-add-mt7925.patch ]; patches = [ ../../moduler/btusb-add-mt7925.patch ];
})) }))
]; ];
hardware.enableRedistributableFirmware = true;
fonts.packages = with pkgs; [
nerd-fonts.comic-shanns-mono
nerd-fonts.fira-code
];
hardware = {
bluetooth = {
enable = true;
powerOnBoot = true;
settings = {
General = {
Disable = "Headset";
};
};
};
};
environment.sessionVariables = {
EDITOR = "nvim";
VISUAL = "nvim";
};
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;
};
networking.hostName = myhostname; # Define your hostname. networking.hostName = myhostname; # Define your hostname.
# Enable networking
networking.networkmanager.enable = true;
# Set your time zone.
time.timeZone = "Europe/Stockholm";
# Select internationalisation properties.
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";
};
# Enable the X11 windowing system.
services = { services = {
#tailscale.enable = true; #tailscale.enable = true;
@ -134,42 +60,12 @@ services = {
blueman = { blueman = {
enable = true; enable = true;
}; };
printing.enable = true;
}; };
# Configure console keymap # Configure console keymap
console.keyMap = "sv-latin1"; console.keyMap = "sv-latin1";
# Enable CUPS to print documents.
services.printing.enable = true;
# Enable sound with pipewire.
services.pulseaudio.enable = false;
security.rtkit.enable = true;
services.pipewire = {
enable = true;
alsa.enable = true;
alsa.support32Bit = true;
pulse.enable = true;
};
virtualisation.docker = {
enable = true;
};
# Define a user account. Don't forget to set a password with passwd.
users.users.fw = {
isNormalUser = true;
description = "Fredrik Wastring";
extraGroups = [ "networkmanager" "wheel" "docker" ];
};
# Install firefox.
programs.firefox.enable = true;
# Allow unfree packages
nixpkgs.config.allowUnfree = true;
services.xserver.dpi = 140; services.xserver.dpi = 140;
system.stateVersion = "25.05"; # Did you read the comment? system.stateVersion = "25.05"; # Did you read the comment?

View file

@ -1,88 +0,0 @@
{ 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
'';
};
};
}

View file

@ -8,14 +8,6 @@
... ...
}: }:
{ {
imports = [
./dev.nix
./lsp.nix
./network.nix
./programs.nix
./system.nix
./sway.nix
];
nixpkgs = { nixpkgs = {
overlays = [ overlays = [
]; ];
@ -51,46 +43,12 @@
}; };
virtualisation = { 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 = { docker = {
enable = true; enable = true;
liveRestore = false; 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; networking.networkmanager.enable = true;
environment.sessionVariables = { environment.sessionVariables = {
@ -119,74 +77,30 @@
LC_TIME = "sv_SE.UTF-8"; LC_TIME = "sv_SE.UTF-8";
}; };
boot.loader = { boot = {
loader = {
efi = { efi = {
canTouchEfiVariables = false; canTouchEfiVariables = true;
}; };
systemd-boot.enable = true;
grub = { grub = {
efiSupport = true; efiSupport = true;
efiInstallAsRemovable = true; efiInstallAsRemovable = true;
device = "nodev"; device = "nodev";
}; };
}; };
};
console.keyMap = "sv-latin1"; console.keyMap = "sv-latin1";
environment.systemPackages = with pkgs; [ environment.systemPackages = with pkgs; [
waypipe 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 = { services = {
picom.enable = true;
clipmenu.enable = true; clipmenu.enable = true;
openssh = { openssh = {
enable = true; 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 = { blueman = {
enable = true; enable = true;
}; };

View file

@ -12,13 +12,16 @@ let
}); });
in in
{ {
nix.settings.trusted-users = [ "root" "fw" ]; nix.settings.trusted-users = [
"root"
"fw"
];
environment.systemPackages = with pkgs; [ environment.systemPackages = with pkgs; [
timewarrior timewarrior
devenv devenv
nixfmt-rfc-style
# Containers # Containers
kubectl kubectl

View file

@ -1,15 +0,0 @@
{ 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 ];
}

View file

@ -1,33 +0,0 @@
{
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
];
}

View file

@ -1,40 +0,0 @@
# 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";
}

View file

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

View file

@ -10,7 +10,7 @@
}: { }: {
environment.systemPackages = with pkgs; [ environment.systemPackages = with pkgs; [
nixd unstable.nixd
gopls gopls
inputs.neovim-nightly-overlay.packages.${pkgs.system}.default inputs.neovim-nightly-overlay.packages.${pkgs.system}.default
omnisharp-roslyn omnisharp-roslyn

View file

@ -1,40 +0,0 @@
# 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
];
}

25
moduler/sound.nix Normal file
View file

@ -0,0 +1,25 @@
{ pkgs, lib, ... }:
{
services.pulseaudio.enable = false;
security.rtkit.enable = true;
services = {
pipewire = {
enable = true;
alsa.enable = true;
alsa.support32Bit = true;
pulse.enable = true;
};
};
hardware = {
bluetooth = {
enable = true;
powerOnBoot = true;
settings = {
General = {
Disable = "Headset";
};
};
};
};
}

View file

@ -1,12 +0,0 @@
{ 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];
}))
];
}

View file

@ -1,30 +0,0 @@
{ 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";
};
};
};
}

View file

@ -1,23 +0,0 @@
#!/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