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

This commit is contained in:
fwastring 2025-04-07 14:21:35 +02:00
commit 82a0300eec
19 changed files with 1047 additions and 565 deletions

View file

@ -6,7 +6,8 @@
config,
pkgs,
...
}: {
}:
{
imports = [
# ../shared/vial.nix
];
@ -18,7 +19,9 @@
};
};
nix.registry = (lib.mapAttrs (_: flake: {inherit flake;})) ((lib.filterAttrs (_: lib.isType "flake")) inputs);
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;
@ -32,13 +35,10 @@
fi
'';
};
environment.etc =
lib.mapAttrs'
(name: value: {
environment.etc = lib.mapAttrs' (name: value: {
name = "nix/path/${name}";
value.source = value.flake;
})
config.nix.registry;
}) config.nix.registry;
nix.settings = {
experimental-features = "nix-command flakes";
@ -97,7 +97,6 @@
})
];
i18n.defaultLocale = "en_US.UTF-8";
i18n.extraLocaleSettings = {
LC_ADDRESS = "sv_SE.UTF-8";
@ -129,19 +128,21 @@
git
openssh
rofi
(wrapHelm kubernetes-helm {
plugins = with pkgs.kubernetes-helmPlugins; [
helm-secrets
helm-diff
helm-s3
helm-git
];
})
k3sup
nixfmt-rfc-style
nixd
vault
];
services = {
# udev = {
# extraRules = ''
# KERNEL=="ttyACM0", MODE:="666"
# '';
# packages = with pkgs; [
# vial
# via
# ];
# };
picom.enable = true;
openssh = {
enable = true;
@ -179,4 +180,3 @@
system.stateVersion = "23.11";
}

176
config/home-desktop.nix Normal file
View file

@ -0,0 +1,176 @@
# 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/dwm.nix
../shared/vscode.nix
../shared/dmenu.nix
../shared/rofi.nix
../shared/kitty.nix
../shared/alacritty.nix
../shared/tmux.nix
../shared/vim.nix
../shared/fish.nix
../shared/git.nix
../shared/nixpkgs.nix
../shared/firefox.nix
../shared/zathura.nix
../shared/lazygit.nix
../shared/ssh.nix
../shared/aerc.nix
../shared/oh-my-posh.nix
];
nixpkgs = {
overlays = [];
config = {
allowUnfree = true;
allowUnfreePredicate = _: true;
};
};
home.packages = with pkgs; [
# System
xsel
unzip
zip
wget
alsa-utils
upower
gcc
gnumake
cmake
arion
htop
pavucontrol
procps
openssh
networkmanager
fd
bat
bluez
bluez-tools
unstable.betterlockscreen
tmux
unstable.fzf
eza
btop
thttpd
xcolor
openssl
dig
jq
# Dev
unstable.deno
unstable.hugo
unstable.logstash
ngrok
tailwindcss
nodejs_22
gh-f
gh
yarn
plantuml
go
dotnetCorePackages.sdk_8_0_3xx
templ
#Tools
qrencode
air
k9s
git
lazydocker
kubectl
#LSP
roslyn
roslyn-ls
python312Packages.python-lsp-server
yaml-language-server
nil
jdt-language-server
texlab
marksman
nodePackages_latest.bash-language-server
typescript
nodePackages_latest.typescript-language-server
nodePackages_latest.vls
nodePackages_latest.volar
lua-language-server
tree-sitter
gopls
rust-analyzer
# UI
rofi-bluetooth
pastel
imagemagick
#VPN
openvpn
networkmanagerapplet
networkmanager-l2tp
strongswan
# Display
scrot
xbanish
feh
brightnessctl
dunst
# Documents
ripgrep
grc
texliveFull
pandoc
poppler_utils
#Desktop
unstable.feishin
firefox
libreoffice
unstable.signal-desktop
pinta
zathura
vial
thunderbird
alacritty
unstable.neovim
fastfetch
lazygit
byzanz
remmina
obsidian
# Utils
speedcrunch
#Unfree
discord
slack
];
programs.home-manager.enable = true;
programs.fish.enable = true;
programs.man.generateCaches = false;
xsession.enable = true;
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";
home.stateVersion = "23.11"; # Did you read the comment?
systemd.user.startServices = "sd-switch";
}

View file

@ -7,7 +7,8 @@
pkgs,
myhostname,
...
}: {
}:
{
imports = [
../shared/dwm.nix
../shared/vscode.nix
@ -37,7 +38,6 @@
};
};
home.packages = with pkgs; [
# System
xsel
@ -86,8 +86,6 @@
yarn
plantuml
go
# dotnetCorePackages.sdk_8_0_3xx
dotnetCorePackages.sdk_9_0_1xx
templ
goa
azuredatastudio
@ -97,7 +95,7 @@
#Tools
qrencode
air
k9s
unstable.k9s
git
lazydocker
kubectl
@ -177,7 +175,13 @@
programs.man.generateCaches = false;
xsession.enable = true;
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";
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";

View file

@ -1,7 +1,9 @@
{ config
, pkgs
, ...
}: {
{
config,
pkgs,
...
}:
{
# TODO: Configure your system-wide user settings (groups, etc), add more users as needed.
users = {
defaultUserShell = pkgs.bash;

22
flake.lock generated
View file

@ -23,43 +23,43 @@
]
},
"locked": {
"lastModified": 1726989464,
"narHash": "sha256-Vl+WVTJwutXkimwGprnEtXc/s/s8sMuXzqXaspIGlwM=",
"lastModified": 1736373539,
"narHash": "sha256-dinzAqCjenWDxuy+MqUQq0I4zUSfaCvN9rzuCmgMZJY=",
"owner": "nix-community",
"repo": "home-manager",
"rev": "2f23fa308a7c067e52dfcc30a0758f47043ec176",
"rev": "bd65bc3cde04c16755955630b344bc9e35272c56",
"type": "github"
},
"original": {
"owner": "nix-community",
"ref": "release-24.05",
"ref": "release-24.11",
"repo": "home-manager",
"type": "github"
}
},
"nixpkgs": {
"locked": {
"lastModified": 1730327045,
"narHash": "sha256-xKel5kd1AbExymxoIfQ7pgcX6hjw9jCgbiBjiUfSVJ8=",
"lastModified": 1739055578,
"narHash": "sha256-2MhC2Bgd06uI1A0vkdNUyDYsMD0SLNGKtD8600mZ69A=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "080166c15633801df010977d9d7474b4a6c549d7",
"rev": "a45fa362d887f4d4a7157d95c28ca9ce2899b70e",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixos-24.05",
"ref": "nixos-24.11",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs-unstable": {
"locked": {
"lastModified": 1730531603,
"narHash": "sha256-Dqg6si5CqIzm87sp57j5nTaeBbWhHFaVyG7V6L8k3lY=",
"lastModified": 1739020877,
"narHash": "sha256-mIvECo/NNdJJ/bXjNqIh8yeoSjVLAuDuTUzAo7dzs8Y=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "7ffd9ae656aec493492b44d0ddfb28e79a1ea25d",
"rev": "a79cfe0ebd24952b580b1cf08cd906354996d547",
"type": "github"
},
"original": {

100
flake.nix
View file

@ -12,14 +12,16 @@
home-manager.inputs.nixpkgs.follows = "nixpkgs";
};
outputs = {
outputs =
{
self,
nixpkgs,
home-manager,
nixpkgs-unstable,
fw-pkgs,
...
} @ inputs: let
}@inputs:
let
inherit (self) outputs;
system = "x86_64-linux";
overlay-unstable = final: prev: {
@ -34,7 +36,8 @@
config.allowUnfree = false;
};
};
in {
in
{
# NixOS configuration entrypoint
# Available through 'nixos-rebuild --flake .#your-hostname'
nixosConfigurations = {
@ -44,7 +47,12 @@
myhostname = "laptop";
};
modules = [
({nixpkgs, ... }: { nixpkgs.overlays = [ overlay-unstable ]; })
(
{ nixpkgs, ... }:
{
nixpkgs.overlays = [ overlay-unstable ];
}
)
./maskiner/laptop/configuration.nix
];
};
@ -54,7 +62,12 @@
myhostname = "desktop";
};
modules = [
({nixpkgs, ... }: { nixpkgs.overlays = [ overlay-unstable ]; })
(
{ nixpkgs, ... }:
{
nixpkgs.overlays = [ overlay-unstable ];
}
)
./maskiner/desktop/configuration.nix
];
};
@ -72,6 +85,13 @@
};
modules = [ ./maskiner/work-desktop/configuration.nix ];
};
lillen = nixpkgs.lib.nixosSystem {
specialArgs = {
inherit inputs outputs;
myhostname = "lillen";
};
modules = [ ./maskiner/lillen/configuration.nix ];
};
macmini = nixpkgs.lib.nixosSystem {
specialArgs = {
inherit inputs outputs;
@ -92,8 +112,18 @@
};
modules = [
./config/home.nix
({nixpkgs, ... }: { nixpkgs.overlays = [ overlay-unstable ]; })
({nixpkgs, ... }: { nixpkgs.overlays = [ overlay-fw-pkgs ]; })
(
{ nixpkgs, ... }:
{
nixpkgs.overlays = [ overlay-unstable ];
}
)
(
{ nixpkgs, ... }:
{
nixpkgs.overlays = [ overlay-fw-pkgs ];
}
)
];
};
"fw@desktop" = home-manager.lib.homeManagerConfiguration {
@ -105,8 +135,18 @@
# > Our main home-manager configuration file <
modules = [
./config/home.nix
({nixpkgs, ... }: { nixpkgs.overlays = [ overlay-unstable ]; })
({nixpkgs, ... }: { nixpkgs.overlays = [ overlay-fw-pkgs ]; })
(
{ nixpkgs, ... }:
{
nixpkgs.overlays = [ overlay-unstable ];
}
)
(
{ nixpkgs, ... }:
{
nixpkgs.overlays = [ overlay-fw-pkgs ];
}
)
];
};
"fw@jobb" = home-manager.lib.homeManagerConfiguration {
@ -118,8 +158,18 @@
# > Our main home-manager configuration file <
modules = [
./config/home.nix
({nixpkgs, ... }: { nixpkgs.overlays = [ overlay-unstable ]; })
({nixpkgs, ... }: { nixpkgs.overlays = [ overlay-fw-pkgs ]; })
(
{ nixpkgs, ... }:
{
nixpkgs.overlays = [ overlay-unstable ];
}
)
(
{ nixpkgs, ... }:
{
nixpkgs.overlays = [ overlay-fw-pkgs ];
}
)
];
};
"fw@work-desktop" = home-manager.lib.homeManagerConfiguration {
@ -131,8 +181,18 @@
# > Our main home-manager configuration file <
modules = [
./config/home.nix
({nixpkgs, ... }: { nixpkgs.overlays = [ overlay-unstable ]; })
({nixpkgs, ... }: { nixpkgs.overlays = [ overlay-fw-pkgs ]; })
(
{ nixpkgs, ... }:
{
nixpkgs.overlays = [ overlay-unstable ];
}
)
(
{ nixpkgs, ... }:
{
nixpkgs.overlays = [ overlay-fw-pkgs ];
}
)
];
};
"fw@lillen" = home-manager.lib.homeManagerConfiguration {
@ -144,8 +204,18 @@
# > Our main home-manager configuration file <
modules = [
./config/lill-home.nix
({nixpkgs, ... }: { nixpkgs.overlays = [ overlay-unstable ]; })
({nixpkgs, ... }: { nixpkgs.overlays = [ overlay-fw-pkgs ]; })
(
{ nixpkgs, ... }:
{
nixpkgs.overlays = [ overlay-unstable ];
}
)
(
{ nixpkgs, ... }:
{
nixpkgs.overlays = [ overlay-fw-pkgs ];
}
)
];
};
};

View file

@ -1,7 +1,9 @@
{ config
, pkgs
, ...
}: {
{
config,
pkgs,
...
}:
{
# TODO: Configure your system-wide user settings (groups, etc), add more users as needed.
users = {
defaultUserShell = pkgs.bash;

84
jobb/users.nix.bak Normal file
View file

@ -0,0 +1,84 @@
{ config
, pkgs
, ...
}: {
# TODO: Configure your system-wide user settings (groups, etc), add more users as needed.
users = {
defaultUserShell = pkgs.bash;
users = {
ifacts = {
isNormalUser = true;
description = "iFacts";
extraGroups = [ "networkmanager" "wheel" "docker" ];
packages = with pkgs; [];
};
docker = {
isNormalUser = true;
description = "Docker User";
extraGroups = [ "docker" ];
packages = with pkgs; [];
};
kube = {
isNormalUser = true;
description = "Kubernetes User";
extraGroups = [];
packages = with pkgs; [];
};
bastian = {
isNormalUser = true;
description = "Bastian Lemström";
extraGroups = [ "networkmanager" "wheel" "docker" ];
packages = with pkgs; [];
};
emilian = {
isNormalUser = true;
description = "Emilian Ionascu";
extraGroups = [ "networkmanager" "wheel" "docker" ];
packages = with pkgs; [];
};
bob = {
isNormalUser = true;
description = "Bob Haq";
extraGroups = [ "networkmanager" "wheel" "docker" ];
packages = with pkgs; [];
};
george = {
isNormalUser = true;
description = "George Caraus";
extraGroups = [ "networkmanager" "wheel" "docker" ];
packages = with pkgs; [];
};
max = {
isNormalUser = true;
description = "Max Huldin";
extraGroups = [ "networkmanager" "wheel" "docker" ];
packages = with pkgs; [];
};
sebnor = {
isNormalUser = true;
description = "Sebastian Nordin";
extraGroups = [ "networkmanager" "wheel" "docker" ];
packages = with pkgs; [];
};
fw = {
isNormalUser = true;
shell = pkgs.fish;
description = "Fredrik Wastring";
extraGroups = [ "networkmanager" "wheel" "docker" ];
packages = with pkgs; [
neovim
fastfetch
cmake
fzf
];
};
};
};
}

View file

@ -7,7 +7,8 @@
pkgs,
myhostname,
...
}: {
}:
{
# You can import other NixOS modules here
imports = [
./hardware-configuration.nix
@ -24,18 +25,6 @@
k3sup
];
# boot.loader = {
# efi = {
# canTouchEfiVariables = true;
# };
# grub = {
# enable = true;
# efiSupport = true;
# useOSProber = true;
# };
# };
services.xserver.dpi = 140;
services = {

View file

@ -7,7 +7,8 @@
pkgs,
myhostname,
...
}: {
}:
{
# You can import other NixOS modules here
imports = [
./hardware-configuration.nix
@ -19,10 +20,18 @@
environment.systemPackages = with pkgs; [
kubectl
azure-cli
dotnetCorePackages.sdk_8_0_3xx
k3s
cifs-utils
nfs-utils
];
services.k3s.enable = false;
services.openiscsi = {
enable = true;
name = "iqn.2016-04.com.open-iscsi:work-desktop";
};
networking.hostName = myhostname;

View file

@ -16,4 +16,3 @@ in
{
home.packages = [ dmenu ];
}

View file

@ -1,4 +1,9 @@
{ pkgs, lib, myhostname, ... }:
{
pkgs,
lib,
myhostname,
...
}:
let
dwm = pkgs.dwm.overrideAttrs (old: {
src = builtins.fetchGit {
@ -12,12 +17,16 @@ let
xorg.libXinerama
];
});
dwmblocks = if myhostname == "desktop" then pkgs.dwmblocks.overrideAttrs (old: {
dwmblocks =
if myhostname == "desktop" then
pkgs.dwmblocks.overrideAttrs (old: {
src = builtins.fetchGit {
url = "https://github.com/FredzyW/dwmblocks.git";
rev = "7c81c55390f2deec2a3804217abe80221ef6f46a";
};
}) else pkgs.dwmblocks.overrideAttrs (old: {
})
else
pkgs.dwmblocks.overrideAttrs (old: {
src = builtins.fetchGit {
url = "https://github.com/FredzyW/dwmblocks.git";
rev = "ec1b1a61a80e0ba92842e5117736ff977bb6cfa5";
@ -25,8 +34,8 @@ let
});
in
{
home.packages = [ dwm dwmblocks ];
home.packages = [
dwm
dwmblocks
];
}

View file

@ -42,6 +42,8 @@
n = "eza -l --no-time --no-permissions --no-user";
ls = "eza -l --no-time --no-permissions --no-user";
dev = "nix develop --command fish";
k = "kubectl";
ka = "kubectl apply -f";
spot = "steam-run ~/program/spotify_player";
sc = "sc-im";
e = "nvim";

View file

@ -1,13 +1,22 @@
{ pkgs, lib, myhostname, ... }:
{
pkgs,
lib,
myhostname,
...
}:
{
programs.kitty = {
enable = true;
font = if myhostname == "laptop" then {
font =
if myhostname == "laptop" then
{
# name = "Iosevka Nerd Font Bold";
# name = "ComicShannsMono Nerd Font Bold";
name = "Hack Nerd Font Mono Bold";
size = 15;
} else {
}
else
{
# name = "Iosevka Nerd Font Bold";
# name = "ComicShannsMono Nerd Font Bold";
name = "Hack Nerd Font Mono Bold";

View file

@ -1,11 +1,119 @@
{ pkgs, lib, ... }:
{ config, pkgs, lib, ... }:
{
programs.rofi = {
enable = true;
plugins = with pkgs; [
rofi-calc
rofi-pulse-select
];
font = "FiraCode NerdFont 17";
# theme =
# let
# inherit (config.lib.formats.rasi) mkLiteral;
# in {
# "*" = {
# bg-col = mkLiteral "#1e1e2e";
# bg-col-light = mkLiteral "#1e1e2e";
# border-col = mkLiteral "#1e1e2e";
# selected-col = mkLiteral "#1e1e2e";
# blue = mkLiteral "#89b4fa";
# fg-col = mkLiteral "#cdd6f4";
# fg-col2 = mkLiteral "#f38ba8";
# grey = mkLiteral "#6c7086";
# };
#
# "element-text, element-icon, mode-switcher" = { # Combine selectors
# background-color = mkLiteral "inherit";
# text-color = mkLiteral "inherit";
# };
#
# "#window" = { # Use # for IDs
# height = mkLiteral "360px"; # Important: Use mkLiteral for dimensions and units
# border = mkLiteral "3px"; # Important: Use mkLiteral for dimensions and units
# border-color = mkLiteral "@border-col";
# background-color = mkLiteral "@bg-col";
# };
#
# "#mainbox" = {
# background-color = mkLiteral "@bg-col";
# };
#
# "#inputbar" = {
# children = map mkLiteral ["prompt" "entry"];
# background-color = mkLiteral "@bg-col";
# border-radius = mkLiteral "5px"; # Important: Use mkLiteral for dimensions and units
# padding = mkLiteral "2px"; # Important: Use mkLiteral for dimensions and units
# };
#
# "#prompt" = {
# background-color = mkLiteral "@blue";
# padding = mkLiteral "6px"; # Important: Use mkLiteral for dimensions and units
# text-color = mkLiteral "@bg-col";
# border-radius = mkLiteral "3px"; # Important: Use mkLiteral for dimensions and units
# margin = mkLiteral "20px 0px 0px 20px"; # Important: Use mkLiteral for dimensions and units
# };
#
# "#textbox-prompt-colon" = {
# expand = false;
# str = mkLiteral ":";
# };
#
# "#entry" = {
# padding = mkLiteral "6px"; # Important: Use mkLiteral for dimensions and units
# margin = mkLiteral "20px 0px 0px 10px"; # Important: Use mkLiteral for dimensions and units
# text-color = mkLiteral "@fg-col";
# background-color = mkLiteral "@bg-col";
# };
#
# "#listview" = {
# border = mkLiteral "0px 0px 0px"; # Important: Use mkLiteral for dimensions and units
# padding = mkLiteral "6px 0px 0px"; # Important: Use mkLiteral for dimensions and units
# margin = mkLiteral "10px 0px 0px 20px"; # Important: Use mkLiteral for dimensions and units
# columns = mkLiteral "2"; # Important: Use mkLiteral for dimensions and units
# lines = mkLiteral "5"; # Important: Use mkLiteral for dimensions and units
# background-color = mkLiteral "@bg-col";
# };
#
# "#element" = {
# padding = mkLiteral "5px"; # Important: Use mkLiteral for dimensions and units
# background-color = mkLiteral "@bg-col";
# text-color = mkLiteral "@fg-col";
# };
#
# "#element-icon" = {
# size = mkLiteral "25px"; # Important: Use mkLiteral for dimensions and units
# };
#
# "element.selected" = { # Use . for classes
# background-color = mkLiteral "@selected-col";
# text-color = mkLiteral "@fg-col2";
# };
#
# "#mode-switcher" = {
# spacing = mkLiteral "0";
# };
#
# "#button" = {
# padding = mkLiteral "10px"; # Important: Use mkLiteral for dimensions and units
# background-color = mkLiteral "@bg-col-light";
# text-color = mkLiteral "@grey";
# vertical-align = mkLiteral "0.5";
# horizontal-align = mkLiteral "0.5";
# };
#
# "button.selected" = { # Use . for classes
# background-color = mkLiteral "@bg-col";
# text-color = mkLiteral "@blue";
# };
#
# "#message" = {
# background-color = mkLiteral "@bg-col-light";
# margin = mkLiteral "2px"; # Important: Use mkLiteral for dimensions and units
# padding = mkLiteral "2px"; # Important: Use mkLiteral for dimensions and units
# border-radius = mkLiteral "5px"; # Important: Use mkLiteral for dimensions and units
# };
#
# "#textbox" = {
# padding = mkLiteral "6px"; # Important: Use mkLiteral for dimensions and units
# margin = mkLiteral "20px 0px 0px 20px"; # Important: Use mkLiteral for dimensions and units
# text-color = mkLiteral "@blue";
# background-color = mkLiteral "@bg-col-light";
# };
# };
};
}

View file

@ -62,6 +62,18 @@
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;

View file

@ -29,7 +29,14 @@
extraConfig = ''
set -g base-index 1
setw -g pane-base-index 1
set-option -ga terminal-overrides ",alacritty:Tc"
set -g default-terminal "xterm-kitty"
set -g terminal-overrides "xterm-kitty"
# true colours support
# set -ga terminal-overrides ",*256col*:Tc"
set -ga terminal-overrides ",xterm-256color:Tc"
set -as terminal-overrides ',*:Smulx=\E[4::%p1%dm'
# underscore colours - needs tmux-3.0
set -as terminal-overrides ',*:Setulc=\E[58::2::%p1%{65536}%/%d::%p1%{256}%/%{255}%&%d::%p1%{255}%&%d%;m'
'';
};
}