Compare commits

...

37 Commits

Author SHA1 Message Date
03c95b7b6f 359 current 1970-01-01 01:00:00 24.05.20240611.47b604b 6.6.31-rt31 * 2024-06-12 12:02:40 +02:00
6d1afe26eb 358 current 1970-01-01 01:00:00 24.05.20240611.47b604b 6.6.31-rt31 * 2024-06-12 12:01:14 +02:00
e1853bdbb5 357 current 1970-01-01 01:00:00 24.05.20240611.47b604b 6.6.31-rt31 * 2024-06-12 11:58:18 +02:00
23631f0391 356 current 1970-01-01 01:00:00 24.05.20240611.47b604b 6.6.31-rt31 * 2024-06-12 11:56:33 +02:00
b1d0a85100 356 current 1970-01-01 01:00:00 24.05.20240611.47b604b 6.6.31-rt31 * 2024-06-12 11:41:20 +02:00
1110b28c36 355 current 1970-01-01 01:00:00 24.05.20240611.47b604b 6.6.31-rt31 * 2024-06-12 11:37:14 +02:00
7429f4e861 354 current 1970-01-01 01:00:00 24.05.20240611.47b604b 6.6.31-rt31 * 2024-06-12 11:08:47 +02:00
1a7ab84cbd 348 current 1970-01-01 01:00:00 23.11.20240522.4639777 6.6.30-rt30 * 2024-05-26 18:39:40 +02:00
0be300aa7b 347 current 1970-01-01 01:00:00 23.11.20240522.4639777 6.6.30-rt30 * 2024-05-26 18:10:08 +02:00
71fa64ccfa 346 current 1970-01-01 01:00:00 23.11.20240522.4639777 6.6.30-rt30 * 2024-05-26 14:56:58 +02:00
9baa192388 345 current 1970-01-01 01:00:00 23.11.20240522.4639777 6.6.30-rt30 * 2024-05-26 14:28:55 +02:00
fec2bba6fc 344 current 1970-01-01 01:00:00 23.11.20240522.4639777 6.6.30-rt30 * 2024-05-26 14:23:53 +02:00
539f35cf2e 343 current 1970-01-01 01:00:00 23.11.20240522.4639777 6.6.30-rt30 * 2024-05-26 14:16:38 +02:00
b9e6e8e28b 342 current 1970-01-01 01:00:00 23.11.20240522.4639777 6.6.30-rt30 * 2024-05-26 14:09:44 +02:00
9cf8e67377 341 current 1970-01-01 01:00:00 23.11.20240522.4639777 6.6.30-rt30 * 2024-05-26 14:00:59 +02:00
d8ba3bc590 340 current 1970-01-01 01:00:00 23.11.20240522.4639777 6.6.30-rt30 * 2024-05-26 13:24:46 +02:00
2310f2fa90 339 current 1970-01-01 01:00:00 23.11.20240522.4639777 6.6.30-rt30 * 2024-05-26 13:16:57 +02:00
6c76023edc 338 current 1970-01-01 01:00:00 23.11.20240522.4639777 6.6.30-rt30 * 2024-05-26 13:11:21 +02:00
45a7046b35 336 current 1970-01-01 01:00:00 23.11.20240520.a8695cb 6.6.30-rt30 * 2024-05-21 13:32:45 +02:00
4cc4d51655 335 current 1970-01-01 01:00:00 23.11.20240520.a8695cb 6.6.30-rt30 * 2024-05-21 13:30:07 +02:00
9973c8ccad 333 current 1970-01-01 01:00:00 23.11.20240518.e7cc617 6.6.30-rt30 * 2024-05-20 21:49:58 +02:00
9dc1ca3175 332 current 1970-01-01 01:00:00 23.11.20240518.e7cc617 6.6.30-rt30 * 2024-05-20 21:37:38 +02:00
54b53e5026 331 current 1970-01-01 01:00:00 23.11.20240518.e7cc617 6.6.30-rt30 * 2024-05-20 21:33:04 +02:00
2072020b9c 330 current 1970-01-01 01:00:00 23.11.20240518.e7cc617 6.6.30-rt30 * 2024-05-20 21:22:40 +02:00
d613665f5c 329 current 1970-01-01 01:00:00 23.11.20240518.e7cc617 6.6.30-rt30 * 2024-05-20 21:20:37 +02:00
1c8ffbf289 328 current 1970-01-01 01:00:00 23.11.20240518.e7cc617 6.6.30-rt30 * 2024-05-20 21:15:16 +02:00
da0bf720dd 327 current 1970-01-01 01:00:00 23.11.20240518.e7cc617 6.6.30-rt30 * 2024-05-20 20:53:29 +02:00
3667246bf0 326 current 1970-01-01 01:00:00 23.11.20240518.e7cc617 6.6.30-rt30 * 2024-05-20 20:37:11 +02:00
d712b4d00d 325 current 1970-01-01 01:00:00 23.11.20240518.e7cc617 6.6.30-rt30 * 2024-05-20 19:58:09 +02:00
01275a4785 324 current 1970-01-01 01:00:00 23.11.20240518.e7cc617 6.6.30-rt30 * 2024-05-20 19:40:05 +02:00
0cd6a8708e 323 current 1970-01-01 01:00:00 23.11.20240518.e7cc617 6.6.30-rt30 * 2024-05-20 19:33:41 +02:00
308fab0078 322 current 1970-01-01 01:00:00 23.11.20240518.e7cc617 6.6.30-rt30 * 2024-05-20 19:23:10 +02:00
67b147c22f 320 current 1970-01-01 01:00:00 23.11.20240514.9ddcaff 5.4.271-rt89 * 2024-05-20 19:17:07 +02:00
00d63a90a7 319 current 1970-01-01 01:00:00 23.11.20240514.9ddcaff 6.1.90 * 2024-05-18 23:22:16 +02:00
f0719ab51c 318 current 1970-01-01 01:00:00 23.11.20240514.9ddcaff 5.4.271-rt89 * 2024-05-18 23:13:22 +02:00
3c58cead1c 317 current 1970-01-01 01:00:00 23.11.20240514.9ddcaff 6.1.90 * 2024-05-18 23:07:08 +02:00
e5a70822ad 316 current 1970-01-01 01:00:00 23.11.20240514.9ddcaff 6.1.90 * 2024-05-18 23:05:04 +02:00
40 changed files with 821 additions and 446 deletions

View File

@ -7,16 +7,16 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1710888565, "lastModified": 1717527182,
"narHash": "sha256-s9Hi4RHhc6yut4EcYD50sZWRDKsugBJHSbON8KFwoTw=", "narHash": "sha256-vWSkg6AMok1UUQiSYVdGMOXKD2cDFnajITiSi0Zjd1A=",
"owner": "nix-community", "owner": "nix-community",
"repo": "home-manager", "repo": "home-manager",
"rev": "f33900124c23c4eca5831b9b5eb32ea5894375ce", "rev": "845a5c4c073f74105022533907703441e0464bc3",
"type": "github" "type": "github"
}, },
"original": { "original": {
"owner": "nix-community", "owner": "nix-community",
"ref": "release-23.11", "ref": "release-24.05",
"repo": "home-manager", "repo": "home-manager",
"type": "github" "type": "github"
} }
@ -73,16 +73,16 @@
}, },
"nixpkgs_2": { "nixpkgs_2": {
"locked": { "locked": {
"lastModified": 1715668745, "lastModified": 1718086528,
"narHash": "sha256-xp62OkRkbUDNUc6VSqH02jB0FbOS+MsfMb7wL1RJOfA=", "narHash": "sha256-hoB7B7oPgypePz16cKWawPfhVvMSXj4G/qLsfFuhFjw=",
"owner": "nixos", "owner": "nixos",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "9ddcaffecdf098822d944d4147dd8da30b4e6843", "rev": "47b604b07d1e8146d5398b42d3306fdebd343986",
"type": "github" "type": "github"
}, },
"original": { "original": {
"owner": "nixos", "owner": "nixos",
"ref": "nixos-23.11", "ref": "nixos-24.05",
"repo": "nixpkgs", "repo": "nixpkgs",
"type": "github" "type": "github"
} }

View File

@ -2,12 +2,12 @@
description = "Nixos config flake"; description = "Nixos config flake";
inputs = { inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-23.11"; nixpkgs.url = "github:nixos/nixpkgs/nixos-24.05";
unstable.url = "github:nixos/nixpkgs/nixos-unstable"; unstable.url = "github:nixos/nixpkgs/nixos-unstable";
home-manager = { home-manager = {
url = "github:nix-community/home-manager/release-23.11"; url = "github:nix-community/home-manager/release-24.05";
inputs.nixpkgs.follows = "nixpkgs"; inputs.nixpkgs.follows = "nixpkgs";
}; };

View File

@ -10,96 +10,22 @@
imports = [ imports = [
# Include the results of the hardware scan. # Include the results of the hardware scan.
./hardware-configuration.nix ./hardware-configuration.nix
# script for rebuilding nixos ../../modules/nixos
../../modules/nixos/rebuild.nix
../../modules/nixos/wifi.nix
../../modules/nixos/sops.nix
# greetd login manager
../../modules/nixos/greetd.nix
# sway as window manager
../../modules/nixos/sway.nix
inputs.home-manager.nixosModules.default inputs.home-manager.nixosModules.default
]; ];
hardware.opengl = { myConfig = {
enable = true; enable = true;
extraPackages = with pkgs; [ desktop = true;
libvdpau-va-gl gpu.amd.enable = true;
libvdpau laptop = true;
libva
rocmPackages.clr.icd
amdvlk
driversi686Linux.amdvlk
];
}; };
hardware.spacenavd.enable = true;
# Bootloader.
boot.loader.systemd-boot.enable = true;
boot.loader.efi.canTouchEfiVariables = true;
networking.hostName = "MaxNixosLaptop"; # Define your hostname. networking.hostName = "MaxNixosLaptop"; # Define your hostname.
# networking.wireless.enable = true; # Enables wireless support via wpa_supplicant.
# Configure network proxy if necessary
# networking.proxy.default = "http://user:password@proxy:port/";
# networking.proxy.noProxy = "127.0.0.1,localhost,internal.domain";
# Enable networking
# networking.networkmanager.enable = true;
# Set your time zone.
time.timeZone = "Europe/Berlin";
# NIXOS # NIXOS
nix.settings.experimental-features = ["nix-command" "flakes"]; nix.settings.experimental-features = ["nix-command" "flakes"];
# Select internationalisation properties.
i18n.defaultLocale = "en_US.UTF-8";
i18n.extraLocaleSettings = {
LC_ADDRESS = "de_DE.UTF-8";
LC_IDENTIFICATION = "de_DE.UTF-8";
LC_MEASUREMENT = "de_DE.UTF-8";
LC_MONETARY = "de_DE.UTF-8";
LC_NAME = "de_DE.UTF-8";
LC_NUMERIC = "de_DE.UTF-8";
LC_PAPER = "de_DE.UTF-8";
LC_TELEPHONE = "de_DE.UTF-8";
LC_TIME = "de_DE.UTF-8";
};
# Configure console keymap
console.keyMap = "de";
# Enable CUPS to print documents.
services.printing = {
enable = true;
drivers = [pkgs.samsung-unified-linux-driver];
};
services.avahi = {
enable = true;
nssmdns = true;
openFirewall = true;
};
hardware.printers = {
ensurePrinters = [
{
name = "Samsung_ML-1630W_Series";
location = "luhbots";
deviceUri = "dnssd://Samsung%20ML-1630W%20Series%20(SEC00159937E684)._pdl-datastream._tcp.local/";
model = "samsung/ML-1630W.ppd";
ppdOptions = {
PageSize = "A4";
};
}
];
};
# Enable touchpad support (enabled default in most desktopManager).
# services.xserver.libinput.enable = true;
# Define a user account. Don't forget to set a password with passwd. # Define a user account. Don't forget to set a password with passwd.
users.users.max = { users.users.max = {
isNormalUser = true; isNormalUser = true;
@ -224,8 +150,6 @@
''; '';
}; };
services.flatpak.enable = true;
services.pipewire = { services.pipewire = {
enable = true; enable = true;
alsa.enable = true; alsa.enable = true;

View File

@ -3,12 +3,11 @@
../../modules/home ../../modules/home
]; ];
shell.enable = true; myConfig = {
git.enable = true; enable = true;
music.enable = true; desktop = true;
sway.enable = true; laptop = true;
sway.laptop = true; };
myPrograms.enable = true;
# Home Manager needs a bit of information about you and the paths it should # Home Manager needs a bit of information about you and the paths it should
# manage. # manage.
@ -23,15 +22,4 @@
# want to update the value, then make sure to first check the Home Manager # want to update the value, then make sure to first check the Home Manager
# release notes. # release notes.
home.stateVersion = "23.11"; # Please read the comment before changing. home.stateVersion = "23.11"; # Please read the comment before changing.
xdg.enable = true;
# Let Home Manager install and manage itself.
programs.home-manager.enable = true;
programs.direnv = {
enable = true;
enableBashIntegration = true;
enableZshIntegration = true;
};
} }

View File

@ -1,3 +1,33 @@
{...}: { {
lib,
config,
...
}: let
cfg = config.myConfig;
in {
imports = [./git ./music ./programs ./shell ./sway]; imports = [./git ./music ./programs ./shell ./sway];
options.myConfig = {
enable = lib.mkEnableOption "custom home-manager config";
desktop = lib.mkEnableOption "custom home-manager config for desktop use";
laptop = lib.mkEnableOption "extra settings for laptop use";
};
config = lib.mkIf cfg.enable {
myConfig = {
shell.enable = true;
git.enable = true;
sway.enable = lib.mkIf cfg.desktop true;
music.enable = lib.mkIf cfg.desktop true;
programs.enable = lib.mkIf cfg.desktop true;
sway.laptop = lib.mkIf cfg.laptop true;
};
xdg.enable = true;
# Let Home Manager install and manage itself.
programs.home-manager.enable = true;
};
} }

View File

@ -3,16 +3,16 @@
config, config,
... ...
}: let }: let
cfg = config.git; cfg = config.myConfig.git;
in { in {
imports = [./lazygit.nix]; imports = [./lazygit.nix];
options = { options.myConfig.git = {
git.enable = lib.mkEnableOption "git"; enable = lib.mkEnableOption "git";
}; };
config = lib.mkIf cfg.enable { config = lib.mkIf cfg.enable {
git.lazygit.enable = lib.mkDefault true; myConfig.git.lazygit.enable = lib.mkDefault true;
programs.git = { programs.git = {
enable = true; enable = true;

View File

@ -3,10 +3,10 @@
config, config,
... ...
}: let }: let
cfg = config.git.lazygit; cfg = config.myConfig.git.lazygit;
in { in {
options = { options.myConfig.git.lazygit = {
git.lazygit.enable = lib.mkEnableOption "lazygit, a git tui"; enable = lib.mkEnableOption "lazygit, a git tui";
}; };
config = lib.mkIf cfg.enable { config = lib.mkIf cfg.enable {

View File

@ -4,15 +4,15 @@
inputs, inputs,
... ...
}: let }: let
cfg = config.music; cfg = config.myConfig.music;
in { in {
imports = [./mpd.nix]; imports = [./mpd.nix];
options = { options.myConfig.music = {
music.enable = lib.mkEnableOption "make the system ready for listening to music"; enable = lib.mkEnableOption "make the system ready for listening to music";
}; };
config = lib.mkIf cfg.enable { config = lib.mkIf cfg.enable {
music.mpd.enable = lib.mkDefault true; myConfig.music.mpd.enable = lib.mkDefault true;
}; };
} }

View File

@ -4,10 +4,10 @@
pkgs, pkgs,
... ...
}: let }: let
cfg = config.music.mpd; cfg = config.myConfig.music.mpd;
in { in {
options = { options.myConfig.music.mpd = {
music.mpd.enable = lib.mkEnableOption "Music Player Daemon"; enable = lib.mkEnableOption "Music Player Daemon";
}; };
config = lib.mkIf cfg.enable { config = lib.mkIf cfg.enable {

View File

@ -4,19 +4,21 @@
pkgs, pkgs,
... ...
}: let }: let
cfg = config.myPrograms; cfg = config.myConfig.programs;
in { in {
imports = [./foot.nix ./thunderbird.nix ./nextcloud.nix ./udiskie.nix]; imports = [./foot.nix ./thunderbird.nix ./nextcloud.nix ./udiskie.nix];
options = { options.myConfig.programs = {
myPrograms.enable = lib.mkEnableOption "programs for desktop use"; enable = lib.mkEnableOption "programs for desktop use";
}; };
config = lib.mkIf cfg.enable { config = lib.mkIf cfg.enable {
myPrograms.foot.enable = lib.mkDefault true; myConfig.programs = {
myPrograms.thunderbird.enable = lib.mkDefault true; foot.enable = lib.mkDefault true;
myPrograms.nextcloud.enable = lib.mkDefault true; thunderbird.enable = lib.mkDefault true;
myPrograms.udiskie.enable = lib.mkDefault true; nextcloud.enable = lib.mkDefault true;
udiskie.enable = lib.mkDefault true;
};
home.packages = with pkgs; [ home.packages = with pkgs; [
unzip unzip
@ -43,8 +45,9 @@ in {
freecad freecad
flatpak flatpak
wine wine
unstable.gyroflow gyroflow
prusa-slicer prusa-slicer
kicad
]; ];
}; };
} }

View File

@ -3,10 +3,10 @@
config, config,
... ...
}: let }: let
cfg = config.myPrograms.foot; cfg = config.myConfig.programs.foot;
in { in {
options = { options.myConfig.programs.foot = {
myPrograms.foot.enable = lib.mkEnableOption "foot, a lightweight wayland terminal emulator"; enable = lib.mkEnableOption "foot, a lightweight wayland terminal emulator";
}; };
config = lib.mkIf cfg.enable { config = lib.mkIf cfg.enable {

View File

@ -3,10 +3,10 @@
config, config,
... ...
}: let }: let
cfg = config.myPrograms.nextcloud; cfg = config.myConfig.programs.nextcloud;
in { in {
options = { options.myConfig.programs.nextcloud = {
myPrograms.nextcloud.enable = lib.mkEnableOption "nextcloud client"; enable = lib.mkEnableOption "nextcloud client";
}; };
config = lib.mkIf cfg.enable { config = lib.mkIf cfg.enable {

View File

@ -3,10 +3,10 @@
config, config,
... ...
}: let }: let
cfg = config.myPrograms.thunderbird; cfg = config.myConfig.programs.thunderbird;
in { in {
options = { options.myConfig.programs.thunderbird = {
myPrograms.thunderbird.enable = lib.mkEnableOption "thunderbird, a email client"; enable = lib.mkEnableOption "thunderbird, a email client";
}; };
config = lib.mkIf cfg.enable { config = lib.mkIf cfg.enable {

View File

@ -3,10 +3,10 @@
config, config,
... ...
}: let }: let
cfg = config.myPrograms.udiskie; cfg = config.myConfig.programs.udiskie;
in { in {
options = { options.myConfig.programs.udiskie = {
myPrograms.udiskie.enable = lib.mkEnableOption "auto media mounting"; enable = lib.mkEnableOption "auto media mounting";
}; };
config = lib.mkIf cfg.enable { config = lib.mkIf cfg.enable {

View File

@ -3,10 +3,10 @@
config, config,
... ...
}: let }: let
cfg = config.shell.bat; cfg = config.myConfig.shell.bat;
in { in {
options = { options.myConfig.shell.bat = {
shell.bat.enable = lib.mkEnableOption "bat, a cat replacement with syntax highlighting"; enable = lib.mkEnableOption "bat, a cat replacement with syntax highlighting";
}; };
config = lib.mkIf cfg.enable { config = lib.mkIf cfg.enable {

View File

@ -4,10 +4,10 @@
pkgs, pkgs,
... ...
}: let }: let
cfg = config.shell.btop; cfg = config.myConfig.shell.btop;
in { in {
options = { options.myConfig.shell.btop = {
shell.btop.enable = lib.mkEnableOption "btop, a system monitor"; enable = lib.mkEnableOption "btop, a system monitor";
}; };
config = lib.mkIf cfg.enable { config = lib.mkIf cfg.enable {

View File

@ -3,18 +3,21 @@
config, config,
... ...
}: let }: let
cfg = config.shell; cfg = config.myConfig.shell;
in { in {
imports = [./zsh.nix ./bat.nix ./btop.nix ./neovim.nix]; imports = [./zsh.nix ./bat.nix ./btop.nix ./neovim.nix ./direnv.nix];
options = { options.myConfig.shell = {
shell.enable = lib.mkEnableOption "my shell environment"; enable = lib.mkEnableOption "my shell environment";
}; };
config = lib.mkIf cfg.enable { config = lib.mkIf cfg.enable {
shell.zsh.enable = lib.mkDefault true; myConfig.shell = {
shell.neovim.enable = lib.mkDefault true; zsh.enable = lib.mkDefault true;
shell.btop.enable = lib.mkDefault true; neovim.enable = lib.mkDefault true;
shell.bat.enable = lib.mkDefault true; btop.enable = lib.mkDefault true;
bat.enable = lib.mkDefault true;
direnv.enable = lib.mkDefault true;
};
}; };
} }

View File

@ -0,0 +1,19 @@
{
lib,
config,
...
}: let
cfg = config.myConfig.shell.direnv;
in {
options.myConfig.shell.direnv = {
enable = lib.mkEnableOption "direnv for changing the environment when entering a directory";
};
config = lib.mkIf cfg.enable {
programs.direnv = {
enable = true;
enableBashIntegration = true;
enableZshIntegration = true;
};
};
}

View File

@ -4,16 +4,34 @@
pkgs, pkgs,
... ...
}: let }: let
cfg = config.shell.neovim; cfg = config.myConfig.shell.neovim;
in { in {
options = { options.myConfig.shell.neovim = {
shell.neovim.enable = lib.mkEnableOption "neovim"; enable = lib.mkEnableOption "neovim";
}; };
config = lib.mkIf cfg.enable { config = lib.mkIf cfg.enable {
home.packages = with pkgs; [neovim]; programs.neovim = {
home.sessionVariables = { enable = true;
EDITOR = "${pkgs.neovim}/bin/nvim"; defaultEditor = true;
plugins = with pkgs.vimPlugins; [
lazy-nvim
];
extraLuaConfig = ''
require "lazy_setup"
'';
extraPackages = with pkgs; [
gnumake
clang
gcc
zig
cargo
rust-analyzer
rustup
nodejs
];
}; };
home.file.".config/nvim/lua".source = ./nvim-lua;
}; };
} }

View File

@ -0,0 +1,24 @@
return {
"AstroNvim/astrocommunity",
{ import = "astrocommunity.pack.bash" },
{ import = "astrocommunity.pack.cmake" },
{ import = "astrocommunity.pack.cpp" },
{ import = "astrocommunity.pack.docker" },
{ import = "astrocommunity.pack.html-css" },
{ import = "astrocommunity.pack.json" },
{ import = "astrocommunity.pack.lua" },
{ import = "astrocommunity.pack.markdown" },
{ import = "astrocommunity.pack.nix" },
{ import = "astrocommunity.pack.python" },
{ import = "astrocommunity.pack.rust" },
{ import = "astrocommunity.pack.toml" },
{ import = "astrocommunity.pack.yaml" },
{ import = "astrocommunity.git.git-blame-nvim" },
{ import = "astrocommunity.markdown-and-latex.vimtex" },
{ import = "astrocommunity.lsp.lsp-inlayhints-nvim" },
{ import = "astrocommunity.lsp.lsp-lens-nvim" },
{ import = "astrocommunity.lsp.lsp-signature-nvim" },
{ import = "astrocommunity.lsp.nvim-lsp-file-operations" },
{ import = "astrocommunity.bars-and-lines.vim-illuminate" },
}

View File

@ -0,0 +1,33 @@
require("lazy").setup({
{
"AstroNvim/AstroNvim",
version = "^4", -- Remove version tracking to elect for nighly AstroNvim
import = "astronvim.plugins",
opts = { -- AstroNvim options must be set here with the `import` key
mapleader = " ", -- This ensures the leader key must be configured before Lazy is set up
maplocalleader = ",", -- This ensures the localleader key must be configured before Lazy is set up
icons_enabled = true, -- Set to false to disable icons (if no Nerd Font is available)
pin_plugins = nil, -- Default will pin plugins when tracking `version` of AstroNvim, set to true/false to override
update_notifications = true, -- Enable/disable notification about running `:Lazy update` twice to update pinned plugins
},
},
{ import = "community" },
{ import = "plugins" },
} --[[@as LazySpec]], {
-- Configure any other `lazy.nvim` configuration options here
install = { colorscheme = { "astrodark", "habamax" } },
ui = { backdrop = 100 },
performance = {
rtp = {
-- disable some rtp plugins, add more to your liking
disabled_plugins = {
"gzip",
"netrwPlugin",
"tarPlugin",
"tohtml",
"zipPlugin",
},
},
},
} --[[@as LazyConfig]])

View File

@ -0,0 +1,35 @@
---@type LazySpec
return {
"AstroNvim/astrocore",
opts = {
options = {
opt = {
relativenumber = false,
number = true,
spell = true,
signcolumn = "yes",
wrap = true,
colorcolumn = "80,120",
},
g = {
inlay_hints_enabled = true,
},
},
lsp = {
config = {
rust_analyzer = {
settings = {
["rust-analyzer"] = {
cargo = { buildScripts = { enable = true } },
procMacro = { enable = true },
check = {
command = "clippy",
},
},
},
},
clangd = { capabilities = { offsetEncoding = "utf-8" } },
},
},
},
}

View File

@ -0,0 +1,29 @@
return {
{
"p00f/clangd_extensions.nvim",
optional = true,
opts = { extensions = { autoSetHints = true } },
init = function()
--load clangd extensions when clangd attaches
local augroup = vim.api.nvim_create_augroup("clangd_extensions", { clear = true })
vim.api.nvim_create_autocmd("LspAttach", {
group = augroup,
desc = "Load clangd_extensions with clangd",
callback = function(args)
if assert(vim.lsp.get_client_by_id(args.data.client_id)).name == "clangd" then
require("clangd_extensions")
require("clangd_extensions.inlay_hints").setup_autocmd()
require("clangd_extensions.inlay_hints").set_inlay_hints()
vim.api.nvim_del_augroup_by_id(augroup)
end
end,
})
end,
},
{
"simrat39/rust-tools.nvim",
optional = true,
opts = { tools = { inlay_hints = { auto = true } } },
},
}

View File

@ -4,16 +4,16 @@
pkgs, pkgs,
... ...
}: let }: let
cfg = config.shell.zsh; cfg = config.myConfig.shell.zsh;
in { in {
options = { options.myConfig.shell.zsh = {
shell.zsh.enable = lib.mkEnableOption "Zsh, an advanced shell"; enable = lib.mkEnableOption "Zsh, an advanced shell";
}; };
config = lib.mkIf cfg.enable { config = lib.mkIf cfg.enable {
programs.zsh = { programs.zsh = {
enable = true; enable = true;
enableAutosuggestions = true; autosuggestion.enable = true;
enableCompletion = true; enableCompletion = true;
defaultKeymap = "emacs"; defaultKeymap = "emacs";
dotDir = ".config/zsh"; dotDir = ".config/zsh";

View File

@ -4,7 +4,7 @@
lib, lib,
... ...
}: let }: let
cfg = config.sway; cfg = config.myConfig.sway;
rotate_lisgd = pkgs.writeShellScriptBin "rotate_lisgd" '' rotate_lisgd = pkgs.writeShellScriptBin "rotate_lisgd" ''
# PREV_ORIENTATION and ORIENTATION are given by rot8 # PREV_ORIENTATION and ORIENTATION are given by rot8
@ -44,19 +44,22 @@
in { in {
imports = [./kanshi.nix ./waybar.nix ./theme.nix ./mako.nix]; imports = [./kanshi.nix ./waybar.nix ./theme.nix ./mako.nix];
options = { options.myConfig.sway = {
sway.enable = lib.mkEnableOption "sway, a lightweight window manager"; enable = lib.mkEnableOption "sway, a lightweight window manager";
sway.laptop = lib.mkEnableOption "laptop config"; laptop = lib.mkEnableOption "laptop config";
}; };
config = lib.mkIf cfg.enable { config = lib.mkIf cfg.enable {
sway.kanshi.enable = lib.mkDefault true; myConfig.sway = {
sway.waybar.enable = lib.mkDefault true; kanshi.enable = lib.mkDefault true;
sway.theming.enable = lib.mkDefault true; waybar.enable = lib.mkDefault true;
sway.mako.enable = lib.mkDefault true; theming.enable = lib.mkDefault true;
sway.waybar.battery = lib.mkIf cfg.laptop (lib.mkDefault true); mako.enable = lib.mkDefault true;
sway.waybar.backlight = lib.mkIf cfg.laptop (lib.mkDefault true); waybar.battery = lib.mkIf cfg.laptop (lib.mkDefault true);
sway.waybar.squeekboard = lib.mkIf cfg.laptop (lib.mkDefault true); waybar.backlight = lib.mkIf cfg.laptop (lib.mkDefault true);
waybar.squeekboard = lib.mkIf cfg.laptop (lib.mkDefault true);
kanshi.laptop = lib.mkIf cfg.laptop (lib.mkDefault true);
};
home.packages = with pkgs; [ home.packages = with pkgs; [
swaylock # screen locking swaylock # screen locking

View File

@ -4,25 +4,28 @@
pkgs, pkgs,
... ...
}: let }: let
cfg = config.sway.kanshi; cfg = config.myConfig.sway.kanshi;
in { in {
options = { options.myConfig.sway.kanshi = {
sway.kanshi.enable = lib.mkEnableOption "kanshi, a dynamic display recognizer"; enable = lib.mkEnableOption "kanshi, a dynamic display recognizer";
sway.kanshi.laptop = lib.mkEnableOption "laptop workspaces"; laptop = lib.mkEnableOption "laptop workspaces";
}; };
config = lib.mkIf cfg.enable { config = lib.mkIf cfg.enable {
services.kanshi = { services.kanshi = {
enable = true; enable = true;
profiles = lib.mkIf cfg.laptop { settings = lib.mkIf cfg.laptop [
laptop.outputs = [ {
{ profile.name = "laptop";
criteria = "eDP-1"; profile.outputs = [
position = "0,0"; {
} criteria = "eDP-1";
]; position = "0,0";
dock_luhbots = { }
outputs = [ ];
}
{
profile.outputs = [
{ {
criteria = "eDP-1"; criteria = "eDP-1";
position = "0,1080"; position = "0,1080";
@ -37,16 +40,16 @@ in {
position = "1920,0"; position = "1920,0";
} }
]; ];
exec = [ profile.exec = [
"${pkgs.sway}/bin/swaymsg workspace 1, move workspace to DP-4" "${pkgs.sway}/bin/swaymsg workspace 1, move workspace to DP-4"
"${pkgs.sway}/bin/swaymsg workspace 2, move workspace to DP-5" "${pkgs.sway}/bin/swaymsg workspace 2, move workspace to DP-5"
"${pkgs.sway}/bin/swaymsg workspace 3, move workspace to eDP-1" "${pkgs.sway}/bin/swaymsg workspace 3, move workspace to eDP-1"
"${pkgs.sway}/bin/swaymsg workspace 4, move workspace to eDP-1" "${pkgs.sway}/bin/swaymsg workspace 4, move workspace to eDP-1"
"${pkgs.sway}/bin/swaymsg workspace 5, move workspace to DP-4" "${pkgs.sway}/bin/swaymsg workspace 5, move workspace to DP-4"
]; ];
}; }
dock_luhbots2 = { {
outputs = [ profile.outputs = [
{ {
criteria = "eDP-1"; criteria = "eDP-1";
position = "1080,1080"; position = "1080,1080";
@ -61,16 +64,16 @@ in {
position = "0,0"; position = "0,0";
} }
]; ];
exec = [ profile.exec = [
"${pkgs.sway}/bin/swaymsg workspace 1, move workspace to DP-4" "${pkgs.sway}/bin/swaymsg workspace 1, move workspace to DP-4"
"${pkgs.sway}/bin/swaymsg workspace 2, move workspace to DP-5" "${pkgs.sway}/bin/swaymsg workspace 2, move workspace to DP-5"
"${pkgs.sway}/bin/swaymsg workspace 3, move workspace to eDP-1" "${pkgs.sway}/bin/swaymsg workspace 3, move workspace to eDP-1"
"${pkgs.sway}/bin/swaymsg workspace 4, move workspace to eDP-1" "${pkgs.sway}/bin/swaymsg workspace 4, move workspace to eDP-1"
"${pkgs.sway}/bin/swaymsg workspace 5, move workspace to DP-4" "${pkgs.sway}/bin/swaymsg workspace 5, move workspace to DP-4"
]; ];
}; }
dock_luhbots3 = { {
outputs = [ profile.outputs = [
{ {
criteria = "eDP-1"; criteria = "eDP-1";
position = "0,1080"; position = "0,1080";
@ -85,16 +88,16 @@ in {
position = "1920,0"; position = "1920,0";
} }
]; ];
exec = [ profile.exec = [
"${pkgs.sway}/bin/swaymsg workspace 1, move workspace to DP-6" "${pkgs.sway}/bin/swaymsg workspace 1, move workspace to DP-6"
"${pkgs.sway}/bin/swaymsg workspace 2, move workspace to DP-7" "${pkgs.sway}/bin/swaymsg workspace 2, move workspace to DP-7"
"${pkgs.sway}/bin/swaymsg workspace 3, move workspace to eDP-1" "${pkgs.sway}/bin/swaymsg workspace 3, move workspace to eDP-1"
"${pkgs.sway}/bin/swaymsg workspace 4, move workspace to eDP-1" "${pkgs.sway}/bin/swaymsg workspace 4, move workspace to eDP-1"
"${pkgs.sway}/bin/swaymsg workspace 5, move workspace to DP-6" "${pkgs.sway}/bin/swaymsg workspace 5, move workspace to DP-6"
]; ];
}; }
dock_luhbots4 = { {
outputs = [ profile.outputs = [
{ {
criteria = "eDP-1"; criteria = "eDP-1";
position = "1080,1080"; position = "1080,1080";
@ -109,16 +112,17 @@ in {
position = "0,0"; position = "0,0";
} }
]; ];
exec = [ profile.exec = [
"${pkgs.sway}/bin/swaymsg workspace 1, move workspace to DP-3" "${pkgs.sway}/bin/swaymsg workspace 1, move workspace to DP-3"
"${pkgs.sway}/bin/swaymsg workspace 2, move workspace to DP-4" "${pkgs.sway}/bin/swaymsg workspace 2, move workspace to DP-4"
"${pkgs.sway}/bin/swaymsg workspace 3, move workspace to eDP-1" "${pkgs.sway}/bin/swaymsg workspace 3, move workspace to eDP-1"
"${pkgs.sway}/bin/swaymsg workspace 4, move workspace to eDP-1" "${pkgs.sway}/bin/swaymsg workspace 4, move workspace to eDP-1"
"${pkgs.sway}/bin/swaymsg workspace 5, move workspace to DP-3" "${pkgs.sway}/bin/swaymsg workspace 5, move workspace to DP-3"
]; ];
}; }
laptop_hannspree = { {
outputs = [ profile.name = "docked-4k";
profile.outputs = [
{ {
criteria = "eDP-1"; criteria = "eDP-1";
position = "320,1440"; position = "320,1440";
@ -130,15 +134,15 @@ in {
scale = 1.5; scale = 1.5;
} }
]; ];
exec = [ profile.exec = [
"${pkgs.sway}/bin/swaymsg workspace 1, move workspace to HDMI-A-1" "${pkgs.sway}/bin/swaymsg workspace 1, move workspace to HDMI-A-1"
"${pkgs.sway}/bin/swaymsg workspace 2, move workspace to eDP-1" "${pkgs.sway}/bin/swaymsg workspace 2, move workspace to eDP-1"
"${pkgs.sway}/bin/swaymsg workspace 3, move workspace to eDP-1" "${pkgs.sway}/bin/swaymsg workspace 3, move workspace to eDP-1"
"${pkgs.sway}/bin/swaymsg workspace 4, move workspace to eDP-1" "${pkgs.sway}/bin/swaymsg workspace 4, move workspace to eDP-1"
"${pkgs.sway}/bin/swaymsg workspace 5, move workspace to HDMI-A-1" "${pkgs.sway}/bin/swaymsg workspace 5, move workspace to HDMI-A-1"
]; ];
}; }
}; ];
}; };
}; };
} }

View File

@ -3,10 +3,10 @@
config, config,
... ...
}: let }: let
cfg = config.sway.mako; cfg = config.myConfig.sway.mako;
in { in {
options = { options.myConfig.sway.mako = {
sway.mako.enable = lib.mkEnableOption "mako, a notification deamon"; enable = lib.mkEnableOption "mako, a notification deamon";
}; };
config = lib.mkIf cfg.enable { config = lib.mkIf cfg.enable {

View File

@ -4,7 +4,7 @@
pkgs, pkgs,
... ...
}: let }: let
cfg = config.sway.theming; cfg = config.myConfig.sway.theming;
# currently, there is some friction between sway and gtk: # currently, there is some friction between sway and gtk:
# https://github.com/swaywm/sway/wiki/GTK-3-settings-on-Wayland # https://github.com/swaywm/sway/wiki/GTK-3-settings-on-Wayland
@ -13,8 +13,8 @@
gsettings set $gnome_schema gtk-theme 'Dracula' gsettings set $gnome_schema gtk-theme 'Dracula'
''; '';
in { in {
options = { options.myConfig.sway.theming = {
sway.theming.enable = lib.mkEnableOption "theming for sway"; enable = lib.mkEnableOption "theming for sway";
}; };
config = lib.mkIf cfg.enable { config = lib.mkIf cfg.enable {

View File

@ -4,7 +4,7 @@
pkgs, pkgs,
... ...
}: let }: let
cfg = config.sway.waybar; cfg = config.myConfig.sway.waybar;
schema = "org.gnome.desktop.a11y.applications"; schema = "org.gnome.desktop.a11y.applications";
key = "screen-keyboard-enabled"; key = "screen-keyboard-enabled";
@ -25,12 +25,12 @@
fi fi
''; '';
in { in {
options = { options.myConfig.sway.waybar = {
sway.waybar.enable = lib.mkEnableOption "waybar, a status bar for wayland compositors"; enable = lib.mkEnableOption "waybar, a status bar for wayland compositors";
sway.waybar.squeekboard = lib.mkEnableOption "squeekboard"; squeekboard = lib.mkEnableOption "squeekboard";
sway.waybar.mpd = lib.mkEnableOption "mpd"; mpd = lib.mkEnableOption "mpd";
sway.waybar.battery = lib.mkEnableOption "battery"; battery = lib.mkEnableOption "battery";
sway.waybar.backlight = lib.mkEnableOption "backlight"; backlight = lib.mkEnableOption "backlight";
}; };
config = lib.mkIf cfg.enable { config = lib.mkIf cfg.enable {

View File

@ -0,0 +1,21 @@
{
lib,
config,
...
}: let
cfg = config.myConfig.bootloader;
in {
options.myConfig.bootloader = {
enable = lib.mkEnableOption "enable systemd bootloader";
};
config = lib.mkIf cfg.enable {
boot.loader = {
timeout = 0;
systemd-boot.enable = true;
systemd-boot.memtest86.enable = true;
systemd-boot.editor = false;
efi.canTouchEfiVariables = true;
};
};
}

47
modules/nixos/cups.nix Normal file
View File

@ -0,0 +1,47 @@
{
lib,
config,
pkgs,
...
}: let
cfg = config.myConfig.cups;
in {
options.myConfig.cups = {
enable = lib.mkEnableOption "printing";
};
config = {
# Enable CUPS to print documents.
services.printing = {
enable = true;
drivers = [pkgs.samsung-unified-linux-driver];
};
services.avahi = {
enable = true;
nssmdns4 = true;
openFirewall = true;
};
hardware.printers = {
ensurePrinters = [
{
name = "Samsung_ML-1630W_Series";
location = "luhbots";
deviceUri = "dnssd://Samsung%20ML-1630W%20Series%20(SEC00159937E684)._pdl-datastream._tcp.local/";
model = "samsung/ML-1630W.ppd";
ppdOptions = {
PageSize = "A4";
};
}
{
name = "Brother_HL-L3210CW_series";
location = "Max Zimmer";
deviceUri = "dnssd://Brother%20HL-L3210CW%20series._ipp._tcp.local/?uuid=e3248000-80ce-11db-8000-900f0c617136";
model = "drv:///sample.drv/generic.ppd";
ppdOptions = {
PageSize = "A4";
};
}
];
};
};
}

30
modules/nixos/default.nix Normal file
View File

@ -0,0 +1,30 @@
{
lib,
config,
...
}: let
cfg = config.myConfig;
in {
imports = [./bootloader.nix ./locale.nix ./greetd.nix ./rebuild.nix ./sops.nix ./sway.nix ./wifi.nix ./music.nix ./cups.nix ./gpu/amd.nix];
options.myConfig = {
enable = lib.mkEnableOption "my custom config";
desktop = lib.mkEnableOption "custom config with desktop support";
laptop = lib.mkEnableOption "extra stuff for laptops like wifi";
};
config.myConfig = lib.mkIf cfg.enable {
bootloader.enable = true;
locale.enable = true;
rebuild.enable = true;
greetd.enable = lib.mkIf cfg.desktop true;
sway.enable = lib.mkIf cfg.desktop true;
music.enable = lib.mkIf cfg.desktop true;
cups.enable = lib.mkIf cfg.desktop true;
wifi.tray = lib.mkIf cfg.desktop true;
sway.laptop = lib.mkIf cfg.laptop true;
wifi.enable = lib.mkIf cfg.laptop true;
};
}

40
modules/nixos/gpu/amd.nix Normal file
View File

@ -0,0 +1,40 @@
{
lib,
config,
pkgs,
...
}: let
cfg = config.myConfig.gpu.amd;
in {
options.myConfig.gpu.amd = {
enable = lib.mkEnableOption "enable amd gpu hardware acceleration";
};
config = lib.mkIf cfg.enable {
boot.initrd.kernelModules = ["amdgpu"];
services.xserver.videoDrivers = ["amdgpu"];
systemd.tmpfiles.rules = [
"L+ /opt/rocm/hip - - - - ${pkgs.rocmPackages.clr}"
];
hardware.opengl = {
enable = true;
extraPackages = with pkgs; [
rocmPackages.clr.icd
amdvlk
];
extraPackages32 = with pkgs; [
driversi686Linux.amdvlk
];
driSupport = true;
driSupport32Bit = true;
};
environment.systemPackages = with pkgs; [
glxinfo
vulkan-tools
gpu-viewer
];
};
}

View File

@ -1,52 +1,59 @@
{ {
config,
lib, lib,
config,
pkgs, pkgs,
... ...
}: let }: let
cfg = config.myConfig.greetd;
themeEnv = '' themeEnv = ''
export XDG_DATA_DIRS="${pkgs.whitesur-gtk-theme}/share:$XDG_DATA_DIRS" export XDG_DATA_DIRS="${pkgs.whitesur-gtk-theme}/share:$XDG_DATA_DIRS"
export XDG_DATA_DIRS="${pkgs.whitesur-icon-theme}/share:$XDG_DATA_DIRS" export XDG_DATA_DIRS="${pkgs.whitesur-icon-theme}/share:$XDG_DATA_DIRS"
export XDG_DATA_DIRS="${pkgs.whitesur-cursors}/share:$XDG_DATA_DIRS" export XDG_DATA_DIRS="${pkgs.whitesur-cursors}/share:$XDG_DATA_DIRS"
''; '';
in { in {
environment.extraInit = themeEnv; options.myConfig.greetd = {
programs.regreet = { enable = lib.mkEnableOption "greetd, a light weight greater deamon";
enable = true; };
settings = {
background = { config = lib.mkIf cfg.enable {
fit = "Contain"; environment.extraInit = themeEnv;
path = "/home/max/Documents/Blender/desktop background Informatiker/render 4K new color.png"; programs.regreet = {
}; enable = true;
gtk = { settings = {
application_prefer_dark_theme = true; background = {
cursor_theme_name = "capitaine-cursors-white"; fit = "Contain";
font_name = "FiraCode Nerd Font 20"; path = ../../assets/bg4k.png;
icon_theme_name = "WhiteSur-dark"; };
theme_name = "WhiteSur-Dark"; GTK = {
}; application_prefer_dark_theme = true;
commands = { cursor_theme_name = "capitaine-cursors-white";
reboot = ["systemctl" "reboot"]; font_name = "FiraCode Nerd Font 20";
poweroff = ["systemctl" "poweroff"]; icon_theme_name = "WhiteSur-dark";
theme_name = "WhiteSur-Dark";
};
commands = {
reboot = ["systemctl" "reboot"];
poweroff = ["systemctl" "poweroff"];
};
}; };
}; };
users.users.greeter = {
isNormalUser = false;
description = "Greeter";
extraGroups = [];
};
services.greetd.enable = true;
environment.etc."greetd/environments".text = ''
sway
'';
environment.systemPackages = with pkgs; [
whitesur-gtk-theme
whitesur-icon-theme
whitesur-cursors
];
}; };
users.users.greeter = {
isNormalUser = false;
description = "Greeter";
extraGroups = [];
};
services.greetd.enable = true;
environment.etc."greetd/environments".text = ''
sway
'';
environment.systemPackages = with pkgs; [
whitesur-gtk-theme
whitesur-icon-theme
whitesur-cursors
];
} }

34
modules/nixos/locale.nix Normal file
View File

@ -0,0 +1,34 @@
{
lib,
config,
...
}: let
cfg = config.myConfig.locale;
in {
options.myConfig.locale = {
enable = lib.mkEnableOption "custom locale";
};
config = lib.mkIf cfg.enable {
# Set your time zone.
time.timeZone = "Europe/Berlin";
# Select internationalisation properties.
i18n.defaultLocale = "en_US.UTF-8";
i18n.extraLocaleSettings = {
LC_ADDRESS = "de_DE.UTF-8";
LC_IDENTIFICATION = "de_DE.UTF-8";
LC_MEASUREMENT = "de_DE.UTF-8";
LC_MONETARY = "de_DE.UTF-8";
LC_NAME = "de_DE.UTF-8";
LC_NUMERIC = "de_DE.UTF-8";
LC_PAPER = "de_DE.UTF-8";
LC_TELEPHONE = "de_DE.UTF-8";
LC_TIME = "de_DE.UTF-8";
};
# Configure console keymap
console.keyMap = "de";
};
}

33
modules/nixos/music.nix Normal file
View File

@ -0,0 +1,33 @@
{
lib,
config,
pkgs,
...
}: let
cfg = config.myConfig.music;
in {
options.myConfig.music = {
enable = lib.mkEnableOption "sound system";
};
config = lib.mkIf cfg.enable {
musnix = {
enable = true;
rtcqs.enable = true;
kernel.realtime = true;
kernel.packages = pkgs.linuxPackages-rt_latest;
};
users.users.max.extraGroups = ["audio"];
sound.enable = true;
services.pipewire = {
enable = true;
alsa.enable = true;
alsa.support32Bit = true;
pulse.enable = true;
jack.enable = true;
wireplumber.enable = true;
};
security.rtkit.enable = true;
};
}

View File

@ -1,4 +1,11 @@
{pkgs, ...}: let {
lib,
config,
pkgs,
...
}: let
cfg = config.myConfig.rebuild;
# script for rebuilding nixos # script for rebuilding nixos
rebuild = pkgs.writeShellScriptBin "rebuild" '' rebuild = pkgs.writeShellScriptBin "rebuild" ''
# A rebuild script that commits on a successful build # A rebuild script that commits on a successful build
@ -37,5 +44,11 @@
${pkgs.libnotify}/bin/notify-send -e "NixOS Rebuilt OK!" --icon=software-update-available ${pkgs.libnotify}/bin/notify-send -e "NixOS Rebuilt OK!" --icon=software-update-available
''; '';
in { in {
environment.systemPackages = [rebuild]; options.myConfig.rebuild = {
enable = lib.mkEnableOption "rebuild script with automatic git commits";
};
config = lib.mkIf cfg.enable {
environment.systemPackages = [rebuild];
};
} }

View File

@ -1,33 +1,45 @@
{sops, ...}: { {
sops = { lib,
age.keyFile = /home/max/.config/sops/age/keys.txt; config,
secrets = { ...
"home/ssid" = { }: let
sopsFile = ../../secrets/wifi.yaml; cfg = config.myConfig.sops;
}; in {
"home/psk" = { options.myConfig.sops = {
sopsFile = ../../secrets/wifi.yaml; enable = lib.mkEnableOption "sops, an secrets manager";
}; };
"parents/ssid" = {
sopsFile = ../../secrets/wifi.yaml; config = lib.mkIf cfg.enable {
}; sops = {
"parents/psk" = { age.keyFile = /home/max/.config/sops/age/keys.txt;
sopsFile = ../../secrets/wifi.yaml; secrets = {
}; "home/ssid" = {
"eduroam/ident" = { sopsFile = ../../secrets/wifi.yaml;
sopsFile = ../../secrets/wifi.yaml; };
}; "home/psk" = {
"eduroam/psk" = { sopsFile = ../../secrets/wifi.yaml;
sopsFile = ../../secrets/wifi.yaml; };
}; "parents/ssid" = {
"luhbots/ssid" = { sopsFile = ../../secrets/wifi.yaml;
sopsFile = ../../secrets/wifi.yaml; };
}; "parents/psk" = {
"luhbots/ssid5" = { sopsFile = ../../secrets/wifi.yaml;
sopsFile = ../../secrets/wifi.yaml; };
}; "eduroam/ident" = {
"luhbots/psk" = { sopsFile = ../../secrets/wifi.yaml;
sopsFile = ../../secrets/wifi.yaml; };
"eduroam/psk" = {
sopsFile = ../../secrets/wifi.yaml;
};
"luhbots/ssid" = {
sopsFile = ../../secrets/wifi.yaml;
};
"luhbots/ssid5" = {
sopsFile = ../../secrets/wifi.yaml;
};
"luhbots/psk" = {
sopsFile = ../../secrets/wifi.yaml;
};
}; };
}; };
}; };

View File

@ -1,63 +1,47 @@
{ {
lib,
config, config,
pkgs, pkgs,
lib,
... ...
}: { }: let
environment.systemPackages = with pkgs; [ cfg = config.myConfig.sway;
dbus # make dbus-update-activation-environment available in the path in {
wayland options.myConfig.sway = {
xdg-utils # for opening default programs when clicking links enable = lib.mkEnableOption "sway";
glib # gsettings laptop = lib.mkEnableOption "enable laptop things (backlight)";
dracula-theme # gtk theme
gnome3.adwaita-icon-theme # default gnome cursors
swaylock
swayidle
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
wdisplays # tool to configure displays
libnotify
];
sound.enable = true;
services.pipewire = {
enable = true;
alsa.enable = true;
alsa.support32Bit = true;
pulse.enable = true;
jack.enable = true;
wireplumber.enable = true;
};
security.rtkit.enable = true;
# xdg-desktop-portal works by exposing a series of D-Bus interfaces
# known as portals under a well-known name
# (org.freedesktop.portal.Desktop) and object path
# (/org/freedesktop/portal/desktop).
# The portal interfaces include APIs for file access, opening URIs,
# printing and others.
services.dbus.enable = true;
xdg.portal = {
enable = true;
wlr.enable = true;
config.common.default = ["wlr" "gtk"];
# gtk portal needed to make gtk apps happy
extraPortals = [pkgs.xdg-desktop-portal-gtk];
}; };
programs.sway = { config = lib.mkIf cfg.enable {
enable = true; environment.systemPackages = with pkgs; [
wrapperFeatures.gtk = true; dbus # make dbus-update-activation-environment available in the path
libnotify
];
# xdg-desktop-portal works by exposing a series of D-Bus interfaces
# known as portals under a well-known name
# (org.freedesktop.portal.Desktop) and object path
# (/org/freedesktop/portal/desktop).
# The portal interfaces include APIs for file access, opening URIs,
# printing and others.
services.dbus.enable = true;
xdg.portal = {
enable = true;
wlr.enable = true;
config.common.default = ["wlr" "gtk"];
# gtk portal needed to make gtk apps happy
extraPortals = [pkgs.xdg-desktop-portal-gtk];
};
programs.sway = {
enable = true;
wrapperFeatures.gtk = true;
};
# make brightness keys work
users.users.max.extraGroups = ["video" "input"];
programs.light.enable = lib.mkIf cfg.laptop true;
# make swaylock work
security.pam.services.swaylock = {};
}; };
# make brightness keys work
users.users.max.extraGroups = ["video"];
programs.light.enable = true;
# make swaylock work
security.pam.services.swaylock = {};
users.extraUsers.max.extraGroups = ["input"];
} }

View File

@ -1,106 +1,147 @@
{ {
lib,
config, config,
pkgs, pkgs,
... ...
}: { }: let
sops.templates = let cfg = config.myConfig.wifi;
placeholder = config.sops.placeholder; in {
in { options.myConfig.wifi = {
"home.nmconnection".content = '' enable = lib.mkEnableOption "wifi";
[connection] tray = lib.mkEnableOption "nm tray entry";
id=${placeholder."home/ssid"}
type=wifi
autoconnect-priority=10
[wifi]
mode=infrastructure
ssid=${placeholder."home/ssid"}
[wifi-security]
key-mgmt=wpa-psk
psk=${placeholder."home/psk"}
'';
"parents.nmconnection".content = ''
[connection]
id=${placeholder."parents/ssid"}
type=wifi
autoconnect-priority=10
[wifi]
mode=infrastructure
ssid=${placeholder."parents/ssid"}
[wifi-security]
key-mgmt=wpa-psk
psk=${placeholder."parents/psk"}
'';
"eduroam.nmconnection".content = ''
[connection]
id=eduroam
type=wifi
autoconnect-priority=0
[wifi]
mode=infrastructure
ssid=eduroam
[wifi-security]
auth-alg=open
key-mgmt=wpa-eap
[802-1x]
anonymous-identity=anonymous@uni-hannover.de
ca-cert=${./T-TeleSec_GlobalRoot_Class_2.crt}
domain-suffix-match=radius-dfn.luis.uni-hannover.de
eap=ttls;
identity=${placeholder."eduroam/ident"}
password=${placeholder."eduroam/psk"}
phase2-auth=mschapv2
'';
"luhbots.nmconnection".content = ''
[connection]
id=${placeholder."luhbots/ssid"}
type=wifi
autoconnect-priority=5
[wifi]
mode=infrastructure
ssid=${placeholder."luhbots/ssid"}
autoconnect-priority=0
[wifi-security]
key-mgmt=wpa-psk
psk=${placeholder."luhbots/psk"}
'';
"luhbots5.nmconnection".content = ''
[connection]
id=${placeholder."luhbots/ssid5"}
type=wifi
autoconnect-priority=10
[wifi]
mode=infrastructure
ssid=${placeholder."luhbots/ssid5"}
autoconnect-priority=0
[wifi-security]
key-mgmt=wpa-psk
psk=${placeholder."luhbots/psk"}
'';
}; };
environment.etc = let
template = config.sops.templates;
base = "NetworkManager/system-connections";
in {
"${base}/home.nmconnection".source = template."home.nmconnection".path;
"${base}/parents.nmconnection".source = template."parents.nmconnection".path;
"${base}/eduroam.nmconnection".source = template."eduroam.nmconnection".path;
"${base}/luhbots.nmconnection".source = template."luhbots.nmconnection".path;
"${base}/luhbots5.nmconnection".source = template."luhbots5.nmconnection".path;
};
networking.networkmanager.enable = true;
environment.systemPackages = with pkgs; [ config = lib.mkIf cfg.enable {
nm-tray environment.etc = let
]; template = config.sops.templates;
base = "NetworkManager/system-connections";
in {
"${base}/home.nmconnection".source = template."home.nmconnection".path;
"${base}/parents.nmconnection".source = template."parents.nmconnection".path;
"${base}/eduroam.nmconnection".source = template."eduroam.nmconnection".path;
"${base}/luhbots.nmconnection".source = template."luhbots.nmconnection".path;
"${base}/luhbots5.nmconnection".source = template."luhbots5.nmconnection".path;
};
networking.networkmanager.enable = true;
environment.systemPackages = lib.optional cfg.tray pkgs.nm-tray;
myConfig.sops.enable = true;
sops = {
secrets = {
"home/ssid" = {
sopsFile = ../../secrets/wifi.yaml;
};
"home/psk" = {
sopsFile = ../../secrets/wifi.yaml;
};
"parents/ssid" = {
sopsFile = ../../secrets/wifi.yaml;
};
"parents/psk" = {
sopsFile = ../../secrets/wifi.yaml;
};
"eduroam/ident" = {
sopsFile = ../../secrets/wifi.yaml;
};
"eduroam/psk" = {
sopsFile = ../../secrets/wifi.yaml;
};
"luhbots/ssid" = {
sopsFile = ../../secrets/wifi.yaml;
};
"luhbots/ssid5" = {
sopsFile = ../../secrets/wifi.yaml;
};
"luhbots/psk" = {
sopsFile = ../../secrets/wifi.yaml;
};
};
templates = let
placeholder = config.sops.placeholder;
in {
"home.nmconnection".content = ''
[connection]
id=${placeholder."home/ssid"}
type=wifi
autoconnect-priority=10
[wifi]
mode=infrastructure
ssid=${placeholder."home/ssid"}
[wifi-security]
key-mgmt=wpa-psk
psk=${placeholder."home/psk"}
'';
"parents.nmconnection".content = ''
[connection]
id=${placeholder."parents/ssid"}
type=wifi
autoconnect-priority=10
[wifi]
mode=infrastructure
ssid=${placeholder."parents/ssid"}
[wifi-security]
key-mgmt=wpa-psk
psk=${placeholder."parents/psk"}
'';
"eduroam.nmconnection".content = ''
[connection]
id=eduroam
type=wifi
autoconnect-priority=0
[wifi]
mode=infrastructure
ssid=eduroam
[wifi-security]
auth-alg=open
key-mgmt=wpa-eap
[802-1x]
anonymous-identity=anonymous@uni-hannover.de
ca-cert=${./T-TeleSec_GlobalRoot_Class_2.crt}
domain-suffix-match=radius-dfn.luis.uni-hannover.de
eap=ttls;
identity=${placeholder."eduroam/ident"}
password=${placeholder."eduroam/psk"}
phase2-auth=mschapv2
'';
"luhbots.nmconnection".content = ''
[connection]
id=${placeholder."luhbots/ssid"}
type=wifi
autoconnect-priority=5
[wifi]
mode=infrastructure
ssid=${placeholder."luhbots/ssid"}
autoconnect-priority=0
[wifi-security]
key-mgmt=wpa-psk
psk=${placeholder."luhbots/psk"}
'';
"luhbots5.nmconnection".content = ''
[connection]
id=${placeholder."luhbots/ssid5"}
type=wifi
autoconnect-priority=10
[wifi]
mode=infrastructure
ssid=${placeholder."luhbots/ssid5"}
autoconnect-priority=0
[wifi-security]
key-mgmt=wpa-psk
psk=${placeholder."luhbots/psk"}
'';
};
};
};
} }