add niri wm

This commit is contained in:
Vinzenz Schroeter 2025-03-16 10:25:59 +01:00
parent e75cd528d0
commit 8b79ccd411
23 changed files with 719 additions and 202 deletions

View file

@ -0,0 +1,32 @@
{ pkgs, ... }:
{
config = {
environment = {
systemPackages = with pkgs; [
ncdu
glances
iotop
pciutils
lsof
dig
screen
tldr
neofetch
];
};
programs = {
zsh.enable = true;
htop.enable = true;
iotop.enable = true;
git.enable = true;
nano = {
enable = true;
syntaxHighlight = true;
};
};
};
}

View file

@ -0,0 +1,46 @@
{
"org/gnome/desktop/interface" = {
color-scheme = "prefer-dark";
clock-show-seconds = true;
show-battery-percentage = true;
};
"org/gnome/mutter" = {
edge-tiling = true;
dynamic-workspaces = true;
};
"org/gnome/desktop/peripherals/keyboard" = {
numlock-state = true;
};
"org/gnome/desktop/peripherals/touchpad" = {
tap-to-click = true;
two-finger-scrolling-enabled = true;
};
"org/gnome/tweaks" = {
show-extensions-notice = false;
};
"org/gnome/shell" = {
disable-user-extensions = false;
disabled-extensions = [ ];
enabled-extensions = [
"tailscale@joaophi.github.com"
"appindicatorsupport@rgcjonas.gmail.com"
"workspace-indicator@gnome-shell-extensions.gcampax.github.com"
"caffeine@patapon.info"
];
};
"ca/desrt/dconf-editor" = {
show-warning = false;
};
"org/gnome/desktop/wm/keybindings" = {
switch-windows = [ "<Alt>Tab" ];
switch-windows-backward = [ "<Shift><Alt>Tab" ];
switch-applications = [ "<Super>Tab" ];
switch-applications-backward = [ "<Shift><Super>Tab" ];
};
"org/gnome/shell/extensions/alphabetical-app-grid" = {
folder-order-position = "start";
};
"org/gnome/shell/extensions/gsconnect" = {
enabled = true;
};
}

View file

@ -64,5 +64,44 @@
# RDP connections
networking.firewall.allowedTCPPorts = [ 3389 ];
home-manager.sharedModules = [
{
home.packages =
with pkgs;
[
gitg
meld
simple-scan
pinta
dconf-editor
gpaste
# graphical installer for flatpak apps
gnome-software
]
++ (with gnomeExtensions; [
caffeine
appindicator
]);
dconf.settings = import ./gnome-shared-dconf.nix;
gtk = {
enable = true;
iconTheme.name = "Adwaita";
cursorTheme.name = "Adwaita";
theme = {
name = "adw-gtk3-dark";
package = pkgs.adw-gtk3;
};
};
}
{
home.packages = with pkgs; [ trayscale ] ++ (with gnomeExtensions; [ tailscale-qs ]);
dconf.settings."org/gnome/shell".enabled-extensions = [ "tailscale@joaophi.github.com" ];
}
];
};
}

61
modules/home-manager.nix Normal file
View file

@ -0,0 +1,61 @@
_: {
home-manager = {
useGlobalPkgs = true;
useUserPackages = true;
sharedModules = [
# set stateVersion
{ home.stateVersion = "22.11"; }
# make nano the default editor
{
home = {
sessionVariables.EDITOR = "nano";
file.".nanorc".text = ''
set linenumbers
set mouse
'';
};
}
# command line niceness
{
programs = {
command-not-found.enable = true;
dircolors.enable = true;
zsh = {
enable = true;
syntaxHighlighting.enable = true;
autosuggestion.enable = true;
enableVteIntegration = true;
};
};
}
# common git config
{
programs = {
git = {
enable = true;
extraConfig.init.defaultBranch = "main";
};
gh = {
enable = true;
gitCredentialHelper.enable = true;
};
};
}
# Templates
{
home.file = {
"Templates/Empty file".text = "";
"Templates/Empty bash script".text = ''
#!/usr/bin/env bash
# abort on error, undefined variables
set -eu
# print commands before execution
set -x
'';
};
}
];
};
}

19
modules/i18n.nix Normal file
View file

@ -0,0 +1,19 @@
_: {
config = {
time.timeZone = "Europe/Berlin";
i18n = {
defaultLocale = "en_US.UTF-8";
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";
};
};
};
}

23
modules/networking.nix Normal file
View file

@ -0,0 +1,23 @@
_: {
config = {
services.openssh = {
enable = true;
openFirewall = true;
settings = {
PermitRootLogin = "without-password";
PasswordAuthentication = false;
KbdInteractiveAuthentication = false;
};
};
services.tailscale = {
enable = true;
openFirewall = true;
};
networking.firewall = {
enable = true;
checkReversePath = "loose";
};
};
}

7
modules/niri.nix Normal file
View file

@ -0,0 +1,7 @@
{ pkgs, ... }:
{
programs.niri = {
enable = true;
package = pkgs.niri-stable;
};
}

59
modules/nixpkgs.nix Normal file
View file

@ -0,0 +1,59 @@
{ config, lib, ... }:
{
options.allowedUnfreePackages = lib.mkOption {
type = lib.types.listOf lib.types.str;
default = [ ];
example = [ "steam" ];
};
config = {
nixpkgs.config = {
# https://github.com/NixOS/nixpkgs/issues/197325#issuecomment-1579420085
allowUnfreePredicate = pkg: builtins.elem (lib.getName pkg) config.allowedUnfreePackages;
};
nix = {
settings = {
substituters = [
"https://cache.nixos.org/"
"https://nix-community.cachix.org"
"https://cache.lix.systems"
"https://niri.cachix.org"
];
trusted-public-keys = [
"cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY="
"nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="
"cache.lix.systems:aBnZUw8zA7H35Cz2RyKFVs3H4PlGTLawyY5KRbvJR8o="
"niri.cachix.org-1:Wv0OmO7PsuocRKzfDoJ3mulSl7Z6oezYhGhR+3W2964="
];
experimental-features = [
"nix-command"
"flakes"
];
};
gc = {
automatic = true;
dates = "daily";
options = "--delete-older-than 7d";
};
optimise.automatic = true;
};
system = {
stateVersion = "22.11";
# enable auto updates
autoUpgrade = {
enable = true;
dates = "daily";
flake = "git+https://git.berlin.ccc.de/vinzenz/nixos-configuration.git";
};
};
documentation = {
enable = true; # documentation of packages
nixos.enable = false; # nixos documentation
man.enable = true; # manual pages and the man command
info.enable = false; # info pages and the info command
doc.enable = false; # documentation distributed in packages' /share/doc
};
};
}