feat: big refactor

This commit is contained in:
Jacob Bachmann 2024-09-07 15:10:22 +02:00
parent 2c09c21833
commit ebedec9768
No known key found for this signature in database
GPG key ID: 7753026D577922A6
159 changed files with 1927 additions and 2222 deletions

84
flake.lock generated
View file

@ -1,6 +1,72 @@
{
"nodes": {
"agenix": {
"inputs": {
"darwin": "darwin",
"home-manager": "home-manager",
"nixpkgs": [
"nixpkgs"
],
"systems": "systems"
},
"locked": {
"lastModified": 1723293904,
"narHash": "sha256-b+uqzj+Wa6xgMS9aNbX4I+sXeb5biPDi39VgvSFqFvU=",
"owner": "ryantm",
"repo": "agenix",
"rev": "f6291c5935fdc4e0bef208cfc0dcab7e3f7a1c41",
"type": "github"
},
"original": {
"owner": "ryantm",
"repo": "agenix",
"type": "github"
}
},
"darwin": {
"inputs": {
"nixpkgs": [
"agenix",
"nixpkgs"
]
},
"locked": {
"lastModified": 1700795494,
"narHash": "sha256-gzGLZSiOhf155FW7262kdHo2YDeugp3VuIFb4/GGng0=",
"owner": "lnl7",
"repo": "nix-darwin",
"rev": "4b9b83d5a92e8c1fbfd8eb27eda375908c11ec4d",
"type": "github"
},
"original": {
"owner": "lnl7",
"ref": "master",
"repo": "nix-darwin",
"type": "github"
}
},
"home-manager": {
"inputs": {
"nixpkgs": [
"agenix",
"nixpkgs"
]
},
"locked": {
"lastModified": 1703113217,
"narHash": "sha256-7ulcXOk63TIT2lVDSExj7XzFx09LpdSAPtvgtM7yQPE=",
"owner": "nix-community",
"repo": "home-manager",
"rev": "3bfaacf46133c037bb356193bd2f1765d9dc82c1",
"type": "github"
},
"original": {
"owner": "nix-community",
"repo": "home-manager",
"type": "github"
}
},
"home-manager_2": {
"inputs": {
"nixpkgs": [
"nixpkgs"
@ -71,11 +137,27 @@
},
"root": {
"inputs": {
"home-manager": "home-manager",
"agenix": "agenix",
"home-manager": "home-manager_2",
"nixos-hardware": "nixos-hardware",
"nixpkgs": "nixpkgs",
"nixpkgs-unstable": "nixpkgs-unstable"
}
},
"systems": {
"locked": {
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
"owner": "nix-systems",
"repo": "default",
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default",
"type": "github"
}
}
},
"root": "root",

View file

@ -1,68 +1,40 @@
{
description = "Nix los hier";
description = "nix los hier";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-24.05";
nixpkgs-unstable.url = "github:NixOS/nixpkgs/nixos-unstable";
nixos-hardware.url = "github:NixOS/nixos-hardware/master";
home-manager = {
url = "github:nix-community/home-manager/release-24.05";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs = { self, nixpkgs, ... }@inputs: {
nixosConfigurations = {
W530 = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
specialArgs = inputs;
modules = [
./modules
./hosts/W530
inputs.home-manager.nixosModules.home-manager
{
imports = [ ./users/gandalf ];
}
];
};
T430 = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
specialArgs = inputs;
modules = [
./modules
./hosts/T430
inputs.home-manager.nixosModules.home-manager
{
imports = [
./users/gandalf
];
}
];
};
IROH = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
specialArgs = inputs;
modules = [
./modules
./hosts/IROH
inputs.home-manager.nixosModules.home-manager
{
imports = [ ./users/gandalf ];
}
];
};
agenix = {
url = "github:ryantm/agenix";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs =
{ nixpkgs, agenix, ... }@inputs:
let
mkSystem = host: {
"${host}" = nixpkgs.lib.nixosSystem rec {
system = "x86_64-linux";
specialArgs = inputs;
modules = [
(./hosts + "/${host}")
agenix.nixosModules.default
{ environment.systemPackages = [ agenix.packages.${system}.default ]; }
];
};
};
in
{
nixosConfigurations = nixpkgs.lib.mergeAttrsList (
nixpkgs.lib.forEach [
"APPA"
"T430"
"IROH"
] mkSystem
);
};
}

25
hosts/APPA/default.nix Normal file
View file

@ -0,0 +1,25 @@
{ ... }@inputs:
{
imports = [
inputs.nixos-hardware.nixosModules.common-pc-laptop
inputs.nixos-hardware.nixosModules.common-pc-laptop-acpi_call
inputs.nixos-hardware.nixosModules.common-pc-laptop-ssd
./services
./hardware.nix
./network.nix
./system.nix
../../modules
];
bchmnn = {
git = {
signing = {
key = "0x7753026D577922A6";
};
};
collections = {
cli-utils.enable = true;
};
};
}

78
hosts/APPA/hardware.nix Normal file
View file

@ -0,0 +1,78 @@
{
config,
lib,
modulesPath,
...
}:
{
imports = [ (modulesPath + "/installer/scan/not-detected.nix") ];
boot.initrd.availableKernelModules = [
"xhci_pci"
"ehci_pci"
"ahci"
"usb_storage"
"sd_mod"
"sdhci_pci"
];
boot.loader.systemd-boot.enable = true;
boot.loader.efi.canTouchEfiVariables = true;
boot.initrd.kernelModules = [ ];
boot.kernelModules = [ "kvm-intel" ];
boot.extraModulePackages = [ ];
fileSystems."/" = {
device = "/dev/disk/by-label/ROOT";
fsType = "btrfs";
options = [
"subvol=@"
"compress=zstd"
"noatime"
];
};
fileSystems."/nix" = {
device = "/dev/disk/by-label/ROOT";
fsType = "btrfs";
options = [
"subvol=@nix"
"compress=zstd"
"noatime"
];
};
fileSystems."/boot" = {
device = "/dev/disk/by-label/EFI";
fsType = "vfat";
options = [
"fmask=0022"
"dmask=0022"
];
};
fileSystems."/home" = {
device = "/dev/disk/by-label/HOME";
fsType = "btrfs";
options = [
"subvol=@"
"compress=zstd"
"noatime"
];
};
fileSystems."/var/lib" = {
device = "/dev/disk/by-label/HOME";
fsType = "btrfs";
options = [
"subvol=@varlib"
"compress=zstd"
"noatime"
];
};
swapDevices = [ ];
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
}

29
hosts/APPA/network.nix Normal file
View file

@ -0,0 +1,29 @@
{
networking = {
firewall.enable = true;
hostName = "APPA";
useDHCP = false;
interfaces.enp0s25 = {
useDHCP = false;
ipv4.addresses = [
{
address = "192.168.2.40";
prefixLength = 24;
}
];
ipv6.addresses = [
{
address = "fdd2:59e7:4ee1:1:2642:c13b:9bbc:7bd3";
prefixLength = 64;
}
];
};
defaultGateway = {
address = "192.168.2.1";
};
defaultGateway6 = {
address = "fdd2:59e7:4ee1:0001::1";
interface = "enp0s25";
};
};
}

View file

@ -0,0 +1,73 @@
{ config, ... }:
{
services.adguardhome = {
enable = true;
mutableSettings = true;
allowDHCP = true;
host = "127.0.0.1";
port = 8001;
settings = {
users = [
{
name = "admin";
password = "$2a$10$7FLDb/cr3SCtKiojXbFGnOjk6rWC0z9GMafV.YWMvewUcgua1eF/m";
}
];
dns = {
ratelimit = 0;
};
filtering = {
rewrites = [
{
domain = "dryb.org";
answer = "192.168.2.40";
}
{
domain = "speedport.dryb.org";
answer = "192.168.2.1";
}
{
domain = "tplink.dryb.org";
answer = "192.168.2.30";
}
{
domain = "adguard.dryb.org";
answer = "192.168.2.40";
}
{
domain = config.services.gitea.domain;
answer = "192.168.2.40";
}
];
};
dhcp = {
enabled = true;
interface_name = "enp0s25";
local_domain_name = "dryb.org";
dhcpv4 = {
gateway_ip = "192.168.2.1";
subnet_mask = "255.255.255.0";
range_start = "192.168.2.100";
range_end = "192.168.2.255";
lease_duration = 86400;
icmp_timeout_msec = 1000;
};
dhcpv6 = {
range_start = "fdd2::1";
lease_duration = 86400;
ra_slaac_only = true;
ra_allow_slaac = true;
};
};
};
};
networking.firewall = {
allowedTCPPorts = [ 53 ];
allowedUDPPorts = [
53
67
547
];
};
}

View file

@ -0,0 +1,9 @@
{
imports = [
./adguard-home.nix
./gitea.nix
./homepage-dashboard.nix
./nginx.nix
./postgresql.nix
];
}

View file

@ -0,0 +1,26 @@
{ config, ... }:
{
age.secrets.passwords-gitea-db = {
file = ../../../secrets/passwords/gitea/db.age;
mode = "640";
owner = config.services.gitea.user;
group = config.services.gitea.group;
};
services.gitea = rec {
enable = true;
appName = "dryb.org: Gitea Service";
database = {
type = "postgres";
passwordFile = config.age.secrets.passwords-gitea-db.path;
};
domain = "git.dryb.org";
rootUrl = "http://${domain}/";
httpPort = 8003;
settings = {
service = {
DISABLE_REGISTRATION = true;
};
};
};
}

View file

@ -0,0 +1,74 @@
{
services.homepage-dashboard = {
enable = true;
listenPort = 8002;
settings = {
title = "dryb.org";
layout = {
"Network" = {
style = "row";
columns = 3;
};
"IOT" = {
style = "row";
columns = 3;
};
};
};
services = [
{
"Network" = [
{
"Adguard Home" = {
description = "http://adguard.dryb.org";
href = "http://adguard.dryb.org";
icon = "adguard-home";
};
}
{
"Speedport Smart 4" = {
description = "https://speedport.dryb.org (192.168.2.1)";
href = "https://speedport.dryb.org";
icon = "mdi-router-network-wireless";
};
}
{
"TP-Link TL-SG1016DE" = {
description = "http://tplink.dryb.org (192.168.2.30)";
href = "http://tplink.dryb.org";
icon = "mdi-switch";
};
}
];
}
{
"IOT" = [
{
"Shelly Infra" = {
description = "http://shelly-infra.dryb.org (192.168.2.50)";
href = "http://shelly-infra.dryb.org";
icon = "shelly";
ping = "shelly-infra.dryb.org";
};
}
{
"Shelly Workstation" = {
description = "http://shelly-workstation.dryb.org (192.168.2.51)";
href = "http://shelly-workstation.dryb.org";
icon = "shelly";
ping = "shelly-workstation.dryb.org";
};
}
{
"Shelly Test" = {
description = "http://shelly-test.dryb.org (192.168.2.52)";
href = "http://shelly-test.dryb.org";
icon = "shelly";
ping = "shelly-test.dryb.org";
};
}
];
}
];
};
}

View file

@ -0,0 +1,25 @@
{ config, ... }:
{
services.nginx = {
enable = true;
virtualHosts."dryb.org" = {
locations."/" = {
proxyPass = "http://127.0.0.1:8002";
};
};
virtualHosts."adguard.dryb.org" = {
locations."/" = {
proxyPass = "http://127.0.0.1:8001";
};
};
virtualHosts."${config.services.gitea.domain}" = {
locations."/" = {
proxyPass = "http://127.0.0.1:8003";
};
};
};
networking.firewall = {
allowedTCPPorts = [ 80 ];
};
}

View file

@ -0,0 +1,19 @@
{ config, ... }:
{
services.postgresql = {
enable = true;
ensureDatabases = [ config.services.gitea.user ];
# type database DBuser auth-method mapping
authentication = ''
local gitea all ident map=gitea-users
'';
# name sysuser dbuser
identMap = ''
gitea-users gitea gitea
'';
};
}

View file

@ -1,16 +1,5 @@
{ ... }@inputs: {
imports = [
./hardware.nix
inputs.nixos-hardware.nixosModules.common-pc-laptop
inputs.nixos-hardware.nixosModules.common-pc-laptop-acpi_call
inputs.nixos-hardware.nixosModules.common-pc-laptop-ssd
];
networking.hostName = "W530";
{
bchmnn = {
power = {
tlp = {
settings = {
@ -30,32 +19,7 @@
};
};
};
gui = {
enable = true;
greeter.enable = false;
flavour = [ "sway" ];
};
nvidia.enable = false;
audio = {
enable = true;
pipewire-wine-fix.enable = false;
};
bluetooth.enable = true;
printing.enable = true;
vpn.enable = true;
sync.enable = false;
devenv.enable = true;
virtualisation.enable = true;
games.enable = false;
ratbag.enable = true;
ai.enable = false;
};
services.logind.lidSwitch = "ignore";
}

28
hosts/IROH/default.nix Executable file → Normal file
View file

@ -1,17 +1,18 @@
{ ... }@inputs: {
{ ... }@inputs:
{
imports = [
./hardware.nix
inputs.nixos-hardware.nixosModules.common-cpu-intel
inputs.nixos-hardware.nixosModules.common-pc
inputs.nixos-hardware.nixosModules.common-pc-ssd
inputs.nixos-hardware.nixosModules.common-gpu-nvidia-nonprime
./hardware.nix
../../modules
];
networking.hostName = "IROH";
bchmnn = {
gui = {
enable = true;
greeter.enable = false;
@ -24,16 +25,21 @@
};
bluetooth.enable = false;
printing.enable = true;
vpn.enable = true;
sync.enable = true;
devenv.enable = true;
virtualisation.enable = true;
games.enable = true;
ratbag.enable = true;
ai.enable = false;
collections = {
cli-utils.enable = true;
profiling.enable = true;
development.enable = true;
vpn.enable = true;
virtualisation.enable = true;
games.enable = true;
};
services = {
flare-solvarr.enable = true;
jackett.enable = true;
syncthing.enable = true;
};
};
}

View file

@ -1,10 +1,27 @@
{ config, lib, modulesPath, ... }:
{
config,
lib,
modulesPath,
...
}:
{
imports = [ (modulesPath + "/installer/scan/not-detected.nix") ];
boot.initrd.availableKernelModules = [ "xhci_pci" "ahci" "nvme" "usbhid" "usb_storage" "sd_mod" ];
boot.kernelModules = [ "kvm-intel" "nvidia" "nvidia_modeset" "nvidia_uvm" "nvidia_drm" ];
boot.initrd.availableKernelModules = [
"xhci_pci"
"ahci"
"nvme"
"usbhid"
"usb_storage"
"sd_mod"
];
boot.kernelModules = [
"kvm-intel"
"nvidia"
"nvidia_modeset"
"nvidia_uvm"
"nvidia_drm"
];
boot.loader.systemd-boot.enable = true;
boot.loader.efi.canTouchEfiVariables = true;
@ -16,92 +33,42 @@
"resume_offset=533760"
"nvidia_drm.modeset=1"
"nvidia.NVreg_PreserveVideoMemoryAllocations=1"
# "intel_pstate=disable"
];
/*
hardware.nvidia.package =
config.boot.kernelPackages.nvidiaPackages.mkDriver {
version = "555.52.04";
sha256_64bit = "sha256-nVOubb7zKulXhux9AruUTVBQwccFFuYGWrU1ZiakRAI=";
sha256_aarch64 = "sha256-Kt60kTTO3mli66De2d1CAoE3wr0yUbBe7eqCIrYHcWk=";
openSha256 = "sha256-wDimW8/rJlmwr1zQz8+b1uvxxxbOf3Bpk060lfLKuy0=";
settingsSha256 = "sha256-PMh5efbSEq7iqEMBr2+VGQYkBG73TGUh6FuDHZhmwHk=";
persistencedSha256 = "sha256-KAYIvPjUVilQQcD04h163MHmKcQrn2a8oaXujL2Bxro=";
};
*/
/*
hardware.nvidia.package =
config.boot.kernelPackages.nvidiaPackages.mkDriver {
version = "560.28.03";
sha256_64bit = "sha256-martv18vngYBJw1IFUCAaYr+uc65KtlHAMdLMdtQJ+Y=";
sha256_aarch64 = "sha256-+u0ZolZcZoej4nqPGmZn5qpyynLvu2QSm9Rd3wLdDmM=";
openSha256 = "sha256-asGpqOpU0tIO9QqceA8XRn5L27OiBFuI9RZ1NjSVwaM=";
settingsSha256 = "sha256-b4nhUMCzZc3VANnNb0rmcEH6H7SK2D5eZIplgPV59c8=";
persistencedSha256 = "sha256-MhITuC8tH/IPhCOUm60SrPOldOpitk78mH0rg+egkTE=";
};
*/
/*
hardware.nvidia.package =
let
rcu_patch = pkgs.fetchpatch {
url = "https://github.com/gentoo/gentoo/raw/c64caf53/x11-drivers/nvidia-drivers/files/nvidia-drivers-470.223.02-gpl-pfn_valid.patch";
hash = "sha256-eZiQQp2S/asE7MfGvfe6dA/kdCvek9SYa/FFGp24dVg=";
};
in
config.boot.kernelPackages.nvidiaPackages.mkDriver {
version = "535.154.05";
sha256_64bit = "sha256-fpUGXKprgt6SYRDxSCemGXLrEsIA6GOinp+0eGbqqJg=";
sha256_aarch64 = "sha256-G0/GiObf/BZMkzzET8HQjdIcvCSqB1uhsinro2HLK9k=";
openSha256 = "sha256-wvRdHguGLxS0mR06P5Qi++pDJBCF8pJ8hr4T8O6TJIo=";
settingsSha256 = "sha256-9wqoDEWY4I7weWW05F4igj1Gj9wjHsREFMztfEmqm10=";
persistencedSha256 = "sha256-d0Q3Lk80JqkS1B54Mahu2yY/WocOqFFbZVBh+ToGhaE=";
patches = [ rcu_patch ];
};
*/
boot.resumeDevice = "/dev/disk/by-label/ROOT";
fileSystems."/" =
{
device = "/dev/disk/by-label/ROOT";
fsType = "btrfs";
options = [ "subvol=@" ];
};
fileSystems."/" = {
device = "/dev/disk/by-label/ROOT";
fsType = "btrfs";
options = [ "subvol=@" ];
};
fileSystems."/nix" =
{
device = "/dev/disk/by-label/ROOT";
fsType = "btrfs";
options = [ "subvol=@nix" ];
};
fileSystems."/nix" = {
device = "/dev/disk/by-label/ROOT";
fsType = "btrfs";
options = [ "subvol=@nix" ];
};
fileSystems."/swap" =
{
device = "/dev/disk/by-label/ROOT";
fsType = "btrfs";
options = [ "subvol=@swap" ];
};
fileSystems."/swap" = {
device = "/dev/disk/by-label/ROOT";
fsType = "btrfs";
options = [ "subvol=@swap" ];
};
fileSystems."/boot" =
{
device = "/dev/disk/by-label/EFI";
fsType = "vfat";
};
fileSystems."/boot" = {
device = "/dev/disk/by-label/EFI";
fsType = "vfat";
};
fileSystems."/home" =
{
device = "/dev/disk/by-label/HOME";
fsType = "btrfs";
options = [ "subvol=@" ];
};
fileSystems."/home" = {
device = "/dev/disk/by-label/HOME";
fsType = "btrfs";
options = [ "subvol=@" ];
};
swapDevices = [{ device = "/swap/swapfile"; }];
swapDevices = [ { device = "/swap/swapfile"; } ];
networking.useDHCP = lib.mkDefault true;
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
}

28
hosts/T430/default.nix Executable file → Normal file
View file

@ -1,17 +1,18 @@
{ ... }@inputs: {
{ ... }@inputs:
{
imports = [
./hardware.nix
inputs.nixos-hardware.nixosModules.lenovo-thinkpad-t430
inputs.nixos-hardware.nixosModules.common-pc-laptop
inputs.nixos-hardware.nixosModules.common-pc-laptop-acpi_call
inputs.nixos-hardware.nixosModules.common-pc-laptop-ssd
./hardware.nix
../../modules
];
networking.hostName = "T430";
bchmnn = {
gui = {
enable = true;
greeter.enable = false;
@ -24,16 +25,21 @@
};
bluetooth.enable = true;
printing.enable = true;
vpn.enable = true;
sync.enable = true;
devenv.enable = true;
virtualisation.enable = true;
games.enable = true;
ratbag.enable = true;
ai.enable = false;
collections = {
cli-utils.enable = true;
profiling.enable = true;
development.enable = true;
vpn.enable = true;
virtualisation.enable = true;
games.enable = true;
};
services = {
flare-solvarr.enable = true;
jackett.enable = true;
syncthing.enable = true;
};
};
}

View file

@ -1,9 +1,21 @@
{ config, lib, modulesPath, ... }:
{
config,
lib,
modulesPath,
...
}:
{
imports = [ (modulesPath + "/installer/scan/not-detected.nix") ];
boot.initrd.availableKernelModules = [ "xhci_pci" "ehci_pci" "ahci" "usb_storage" "sd_mod" "sr_mod" "sdhci_pci" ];
boot.initrd.availableKernelModules = [
"xhci_pci"
"ehci_pci"
"ahci"
"usb_storage"
"sd_mod"
"sr_mod"
"sdhci_pci"
];
boot.loader.systemd-boot.enable = true;
boot.loader.efi.canTouchEfiVariables = true;
@ -11,47 +23,53 @@
boot.resumeDevice = "/dev/disk/by-label/ROOT";
boot.initrd.luks.devices."cryptlvm".device = "/dev/disk/by-uuid/b7a904b2-cceb-47fc-832a-701e386a95db";
fileSystems."/" =
{
device = "/dev/disk/by-label/ROOT";
fsType = "btrfs";
options = [ "subvol=@" "compress=zstd" "noatime" ];
};
fileSystems."/" = {
device = "/dev/disk/by-label/ROOT";
fsType = "btrfs";
options = [
"subvol=@"
"compress=zstd"
"noatime"
];
};
fileSystems."/home" =
{
device = "/dev/disk/by-label/ROOT";
fsType = "btrfs";
options = [ "subvol=@home" "compress=zstd" "noatime" ];
};
fileSystems."/home" = {
device = "/dev/disk/by-label/ROOT";
fsType = "btrfs";
options = [
"subvol=@home"
"compress=zstd"
"noatime"
];
};
fileSystems."/nix" =
{
device = "/dev/disk/by-label/ROOT";
fsType = "btrfs";
options = [ "subvol=@nix" "compress=zstd" "noatime" ];
};
fileSystems."/nix" = {
device = "/dev/disk/by-label/ROOT";
fsType = "btrfs";
options = [
"subvol=@nix"
"compress=zstd"
"noatime"
];
};
fileSystems."/swap" =
{
device = "/dev/disk/by-label/ROOT";
fsType = "btrfs";
options = [ "subvol=@swap" "noatime" ];
};
fileSystems."/swap" = {
device = "/dev/disk/by-label/ROOT";
fsType = "btrfs";
options = [
"subvol=@swap"
"noatime"
];
};
fileSystems."/boot" =
{
device = "/dev/disk/by-label/EFI";
fsType = "vfat";
};
fileSystems."/boot" = {
device = "/dev/disk/by-label/EFI";
fsType = "vfat";
};
swapDevices = [{
device = "/swap/swapfile";
}];
swapDevices = [ { device = "/swap/swapfile"; } ];
networking.useDHCP = lib.mkDefault true;
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
}

View file

@ -1,83 +0,0 @@
{ config, lib, modulesPath, ... }:
{
imports = [ (modulesPath + "/installer/scan/not-detected.nix") ];
boot.initrd.availableKernelModules = [ "xhci_pci" "ehci_pci" "ahci" "firewire_ohci" "usb_storage" "sd_mod" "sr_mod" "sdhci_pci" ];
boot.loader.systemd-boot.enable = true;
boot.loader.efi.canTouchEfiVariables = true;
boot.kernelParams = [ "resume_offset=9364344" ];
boot.resumeDevice = "/dev/disk/by-uuid/2e6bd7f5-74f0-4047-a0ab-5679b877a9fe";
boot.initrd.luks.devices."cryptlvm".device = "/dev/disk/by-uuid/d04a2c58-4116-45d6-aa6e-2002556e6d22";
fileSystems."/" =
{
device = "/dev/disk/by-uuid/2e6bd7f5-74f0-4047-a0ab-5679b877a9fe";
fsType = "btrfs";
options = [ "subvol=@" "compress=zstd" "noatime" ];
};
fileSystems."/home" =
{
device = "/dev/disk/by-uuid/2e6bd7f5-74f0-4047-a0ab-5679b877a9fe";
fsType = "btrfs";
options = [ "subvol=@home" "compress=zstd" "noatime" ];
};
fileSystems."/root" =
{
device = "/dev/disk/by-uuid/2e6bd7f5-74f0-4047-a0ab-5679b877a9fe";
fsType = "btrfs";
options = [ "subvol=@root" "compress=zstd" "noatime" ];
};
fileSystems."/srv" =
{
device = "/dev/disk/by-uuid/2e6bd7f5-74f0-4047-a0ab-5679b877a9fe";
fsType = "btrfs";
options = [ "subvol=@srv" "compress=zstd" "noatime" ];
};
fileSystems."/var/log" =
{
device = "/dev/disk/by-uuid/2e6bd7f5-74f0-4047-a0ab-5679b877a9fe";
fsType = "btrfs";
options = [ "subvol=@log" "compress=zstd" "noatime" ];
};
fileSystems."/var/cache" =
{
device = "/dev/disk/by-uuid/2e6bd7f5-74f0-4047-a0ab-5679b877a9fe";
fsType = "btrfs";
options = [ "subvol=@cache" "compress=zstd" "noatime" ];
};
fileSystems."/tmp" =
{
device = "/dev/disk/by-uuid/2e6bd7f5-74f0-4047-a0ab-5679b877a9fe";
fsType = "btrfs";
options = [ "subvol=@tmp" "compress=zstd" "noatime" ];
};
fileSystems."/swap" =
{
device = "/dev/disk/by-uuid/2e6bd7f5-74f0-4047-a0ab-5679b877a9fe";
fsType = "btrfs";
options = [ "subvol=@swap" "noatime" ];
};
fileSystems."/boot" =
{
device = "/dev/disk/by-uuid/A410-7E4F";
fsType = "vfat";
};
swapDevices = [{
device = "/swap/swapfile";
}];
networking.useDHCP = lib.mkDefault true;
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
}

View file

@ -1,36 +0,0 @@
{
ls = "eza --group-directories-first --hyperlink --icons";
la = "eza --group-directories-first --hyperlink --icons -la";
lt = "eza --group-directories-first --hyperlink --icons -la --tree";
llt = "unbuffer eza --group-directories-first --hyperlink --icons -la --tree | less -r";
# ls = "lsd --color=auto --hyperlink=auto";
# la = "lsd -lAh --group-directories-first --hyperlink=auto";
# lt = "lsd -lAh --group-directories-first --tree --hyperlink=auto";
# llt = "unbuffer lsd -lAh --group-directories-first --tree --hyperlink=auto | less -r";
gg = "cd ~/code";
# gs = "git status";
gl = "git log --oneline";
glg = "git log --oneline --graph --decorate --all";
gaa = "git add --all";
gc = "git commit -m";
gp = "git push";
ta = "tmux attach";
nec = "nvim --cmd \"cd $(readlink -f /etc/nixos)\"";
ncc = "sudo nixos-rebuild switch --upgrade-all --flake \"$(readlink -f /etc/nixos)\"";
nup = "sudo nix-channel --update";
ngc = "sudo nix-collect-garbage -d";
dcup = "docker-compose up --detach --remove-orphans";
dka = "docker kill $(docker ps -q)";
drmc = "docker container rm $(docker container ls -aq)";
drmi = "docker image rm $(docker image ls -aq)";
drmv = "docker volume rm $(docker volume ls -q)";
lsip = "curl -s 'https://nordvpn.com/wp-admin/admin-ajax.php?action=get_user_info_data' | jq";
xo = "xdg-open";
y = "yazi";
}

View file

@ -1,24 +0,0 @@
{
services.jackett = {
enable = true;
};
virtualisation = {
oci-containers = {
containers = {
flare-solvarr = {
image = "ghcr.io/flaresolverr/flaresolverr:latest";
autoStart = true;
ports = [ "127.0.0.1:8191:8191" ];
environment = {
LOG_LEVEL = "info";
LOG_HTML = "false";
CAPTCHA_SOLVER = "hcaptcha-solver";
TZ = "Europe/Berlin";
};
};
};
};
};
}

View file

@ -1,35 +0,0 @@
{ pkgs, config, lib, ... }: lib.mkIf config.bchmnn.audio.enable {
services.pipewire = lib.mkIf (!builtins.elem "gnome" config.bchmnn.gui.flavour) {
enable = true;
audio.enable = true;
pulse.enable = true;
alsa.enable = true;
alsa.support32Bit = true;
jack.enable = true;
wireplumber.enable = true;
extraConfig.pipewire = lib.mkIf config.bchmnn.audio.pipewire-wine-fix.enable {
"90-wine-config" = {
"context.properties" = {
# "default.clock.rate" = 48000;
"default.clock.allowed-rates" = [ 44100 48000 ];
# "default.clock.quantum" = 2048;
# "default.clock.min-quantum" = 1024;
};
};
};
extraConfig.pipewire-pulse = lib.mkIf config.bchmnn.audio.pipewire-wine-fix.enable {
"90-wine-config" = {
"pulse.properties" = {
"pulse.min.req" = "1024/48000";
# "pulse.min.frag" = "1024/48000";
# "pulse.min.quantum" = "1024/48000";
};
};
};
};
environment.systemPackages = with pkgs; [
alsa-utils
pulseaudio
];
}

View file

@ -1,6 +0,0 @@
{ config, lib, ... }: lib.mkIf config.bchmnn.gui.enable {
programs.ausweisapp = {
enable = true;
openFirewall = true;
};
}

View file

@ -1,8 +0,0 @@
{ config, lib, ... }: lib.mkIf config.bchmnn.bluetooth.enable {
hardware.bluetooth = {
enable = true;
powerOnBoot = true;
};
services.blueman.enable = true;
}

View file

@ -1,5 +0,0 @@
{
programs.ccache = {
enable = true;
};
}

View file

@ -0,0 +1,65 @@
{
pkgs,
config,
lib,
...
}:
{
environment.systemPackages =
lib.optionals config.bchmnn.collections.cli-utils.enable [
pkgs.pciutils # a collection of programs for inspecting and manipulating configuration of pci devices
pkgs.usbutils # tools for working with usb devices, such as lsusb
pkgs.lshw # provide detailed information on the hardware configuration of the machine
pkgs.git # distributed version control system
pkgs.gnumake # a tool to control the generation of non-source files from sources
pkgs.parallel # shell tool for executing jobs in parallel
pkgs.mercurial # a fast, lightweight scm system for very large distributed projects
pkgs.wget # tool for retrieving files using http, https, and ftp
pkgs.unstable.neovim-unwrapped # vim text editor fork focused on extensibility and agility
pkgs.neofetch # a fast, highly customizable system info script
pkgs.eza # a modern, maintained replacement for ls
pkgs.ripgrep # a utility that combines the usability of the silver searcher with the raw speed of grep
pkgs.ripgrep-all # ripgrep, but also search in pdfs, e-books, office documents, zip, tar.gz, and more
pkgs.expect # a tool for automating interactive applications
pkgs.jq # a lightweight and flexible command-line json processor
pkgs.unzip # an extraction utility for archives compressed in .zip format
pkgs.unrar # utility for rar archives
pkgs.libsecret # a library for storing and retrieving passwords and other secrets
pkgs.xidel # command line tool to download and extract data from html/xml pages as well as json apis
pkgs.nvd # nix/nixos package version diff tool
pkgs.inotify-tools # a c library and a set of command-line programs providing a simple interface to inotify
pkgs.mkcert # a simple tool for making locally-trusted development certificates
pkgs.hexedit
]
++ lib.optionals (config.bchmnn.collections.cli-utils.enable && config.bchmnn.nvidia.enable) [
pkgs.nvtopPackages.full
]
++ lib.optionals config.bchmnn.collections.development.enable [
pkgs.gcc13
pkgs.clang
pkgs.universal-ctags # a maintained ctags implementation
pkgs.rustc
pkgs.cargo # downloads your rust project's dependencies and builds your project
pkgs.go # go programming language
(pkgs.python312.withPackages (
p: with p; [
ptpython # an advanced python repl
ipython # ipython: productive interactive computing
pycryptodome # self-contained cryptographic library
gmpy2 # interface to gmp, mpfr, and mpc for python 3.7+
]
))
pkgs.lua
pkgs.nixpkgs-fmt
pkgs.openjdk17
pkgs.javaPackages.openjfx17
pkgs.gradle_7
pkgs.maven
pkgs.ant
pkgs.nodejs_20
pkgs.nodenv
pkgs.nodePackages.yarn
pkgs.nodePackages.pnpm
];
}

57
modules/core/audio.nix Normal file
View file

@ -0,0 +1,57 @@
{
pkgs,
config,
lib,
...
}:
{
options.bchmnn = {
audio = {
enable = lib.mkEnableOption "audio";
pipewire-wine-fix = {
enable = lib.mkEnableOption "pipewire-wine-fix";
};
};
};
config = {
services.pipewire =
lib.mkIf (config.bchmnn.audio.enable && (!builtins.elem "gnome" config.bchmnn.gui.flavour))
{
enable = true;
audio.enable = true;
pulse.enable = true;
alsa.enable = true;
alsa.support32Bit = true;
jack.enable = true;
wireplumber.enable = true;
extraConfig.pipewire = lib.mkIf config.bchmnn.audio.pipewire-wine-fix.enable {
"90-wine-config" = {
"context.properties" = {
# "default.clock.rate" = 48000;
"default.clock.allowed-rates" = [
44100
48000
];
# "default.clock.quantum" = 2048;
# "default.clock.min-quantum" = 1024;
};
};
};
extraConfig.pipewire-pulse = lib.mkIf config.bchmnn.audio.pipewire-wine-fix.enable {
"90-wine-config" = {
"pulse.properties" = {
"pulse.min.req" = "1024/48000";
# "pulse.min.frag" = "1024/48000";
# "pulse.min.quantum" = "1024/48000";
};
};
};
};
environment.systemPackages = lib.optionals config.bchmnn.audio.enable [
pkgs.alsa-utils
pkgs.pulseaudio
];
};
}

View file

@ -0,0 +1,17 @@
{ config, lib, ... }:
{
options.bchmnn = {
bluetooth = {
enable = lib.mkEnableOption "bluetooth";
};
};
config = lib.mkIf config.bchmnn.bluetooth.enable {
hardware.bluetooth = {
enable = true;
powerOnBoot = true;
};
services.blueman.enable = true;
};
}

33
modules/core/common.nix Normal file
View file

@ -0,0 +1,33 @@
{
aliases = {
ls = "eza --group-directories-first --hyperlink --icons";
la = "eza --group-directories-first --hyperlink --icons -la";
lt = "eza --group-directories-first --hyperlink --icons -la --tree";
llt = "unbuffer eza --group-directories-first --hyperlink --icons -la --tree | less -r";
gg = "cd ~/code";
# gs = "git status";
gl = "git log --oneline";
glg = "git log --oneline --graph --decorate --all";
gaa = "git add --all";
gc = "git commit -m";
gp = "git push";
ta = "tmux attach";
nec = "nvim --cmd \"cd $(readlink -f /etc/nixos)\"";
ncc = "sudo nixos-rebuild switch --upgrade-all --flake \"$(readlink -f /etc/nixos)\"";
nup = "sudo nix-channel --update";
ngc = "sudo nix-collect-garbage -d";
dcup = "docker-compose up --detach --remove-orphans";
dka = "docker kill $(docker ps -q)";
drmc = "docker container rm $(docker container ls -aq)";
drmi = "docker image rm $(docker image ls -aq)";
drmv = "docker volume rm $(docker volume ls -q)";
lsip = "curl -s 'https://nordvpn.com/wp-admin/admin-ajax.php?action=get_user_info_data' | jq";
xo = "xdg-open";
y = "yazi";
};
}

89
modules/core/default.nix Normal file
View file

@ -0,0 +1,89 @@
{ pkgs, ... }@inputs:
{
imports = [
./applications.nix
./audio.nix
./bluetooth.nix
./keyd.nix
./network.nix
./nvidia.nix
./power.nix
./printing.nix
./profiling.nix
./security.nix
./shell.nix
./virtualisation.nix
];
nix = {
settings = {
experimental-features = [
"nix-command"
"flakes"
];
auto-optimise-store = true;
};
};
nixpkgs = {
overlays = [
(self: super: {
unstable = import inputs.nixpkgs-unstable { system = super.system; };
mfcl3750cdwlpr = (super.callPackage ../../overlays/mfcl3750cdw.nix { }).driver;
mfcl3750cdwcupswrapper = (super.callPackage ../../overlays/mfcl3750cdw.nix { }).cupswrapper;
pppdf = (super.python3Packages.callPackage ../../overlays/pppdf { });
iglesia-light = (super.callPackage ../../overlays/fonts/iglesia-light.nix { });
})
];
config = {
allowUnfree = true;
allowUnfreePredicate = (_: true);
};
};
# provide libraries for non-nix binaries
# programs.nix-ld = {
# enable = true;
# libraries = [
# # glibc
# # libcxx
# # libllvm
# # ncurses
# ];
# };
system.stateVersion = "23.05";
time.timeZone = "Europe/Berlin";
i18n = {
defaultLocale = "en_US.UTF-8";
supportedLocales = [
"en_US.UTF-8/UTF-8"
"de_DE.UTF-8/UTF-8"
];
};
console = {
font = "Lat2-Terminus16";
keyMap = "us";
};
programs.dconf.enable = true;
services.dbus = {
enable = true;
packages = with pkgs; [
gcr # gnome crypto services (daemon and tools)
dconf
];
};
programs.ccache = {
enable = true;
};
services.openssh = {
enable = true;
openFirewall = true;
};
}

View file

@ -27,9 +27,7 @@ let
};
in
{
environment.systemPackages = with pkgs; [
keyd
];
environment.systemPackages = with pkgs; [ keyd ];
# Enable keyd and remap keys
services.keyd = {
enable = true;

19
modules/core/network.nix Normal file
View file

@ -0,0 +1,19 @@
{
config,
lib,
pkgs,
...
}:
{
networking.networkmanager.enable = true;
systemd.services = {
NetworkManager-wait-online.enable = false;
};
environment.systemPackages = lib.optionals (config.bchmnn.collections.vpn.enable) [
pkgs.openvpn3
pkgs.mullvad-vpn
pkgs.wireguard-tools # tools for the wireguard secure network tunnel
];
services.mullvad-vpn.enable = config.bchmnn.collections.vpn.enable;
services.tailscale.enable = config.bchmnn.collections.vpn.enable;
}

17
modules/core/nvidia.nix Normal file
View file

@ -0,0 +1,17 @@
{ config, lib, ... }:
{
options.bchmnn = {
nvidia = {
enable = lib.mkEnableOption "nvidia";
};
};
config = lib.mkIf config.bchmnn.nvidia.enable {
services.xserver.videoDrivers = [ "nvidia" ];
hardware.nvidia = {
modesetting.enable = true;
powerManagement.enable = true;
nvidiaSettings = true;
};
};
}

55
modules/core/power.nix Normal file
View file

@ -0,0 +1,55 @@
{
pkgs,
lib,
config,
...
}:
{
options.bchmnn = {
power = {
tlp = {
settings = lib.mkOption {
type =
with lib.types;
attrsOf (oneOf [
bool
int
float
str
(listOf str)
]);
default = {
# performance | powersave
CPU_SCALING_GOVERNOR_ON_AC = "performance";
CPU_SCALING_GOVERNOR_ON_BAT = "powersave";
# performance | balance_performance | default | balance_power | power
CPU_ENERGY_PERF_POLICY_ON_AC = "performance";
CPU_ENERGY_PERF_POLICY_ON_BAT = "power";
# performance | balanced | low-power
PLATFORM_PROFILE_ON_AC = "performance";
PLATFORM_PROFILE_ON_BAT = "low-power";
CPU_MIN_PERF_ON_AC = 0;
CPU_MAX_PERF_ON_AC = 100;
CPU_MIN_PERF_ON_BAT = 0;
CPU_MAX_PERF_ON_BAT = 100;
};
};
};
};
};
config = {
powerManagement = {
enable = true;
};
services.tlp = {
enable = !builtins.elem "gnome" config.bchmnn.gui.flavour;
settings = config.bchmnn.power.tlp.settings;
};
environment.systemPackages = with pkgs; [ powertop ];
};
}

38
modules/core/printing.nix Normal file
View file

@ -0,0 +1,38 @@
{
pkgs,
lib,
config,
...
}:
{
options.bchmnn = {
printing = {
enable = lib.mkEnableOption "printing";
};
};
config = lib.mkIf config.bchmnn.printing.enable {
services.printing = {
enable = true;
drivers = [ pkgs.mfcl3750cdwcupswrapper ];
};
services.avahi = {
enable = true;
nssmdns4 = true;
openFirewall = true;
};
hardware.printers = {
ensurePrinters = [
{
name = "Brother-MFC-L3750CDW-series";
location = "Home";
deviceUri = "dnssd://Brother%20MFC-L3750CDW%20series._ipp._tcp.local/?uuid=e3248000-80ce-11db-8000-b4220094c09b";
model = "brother_mfcl3750cdw_printer_en.ppd";
}
];
ensureDefaultPrinter = "Brother-MFC-L3750CDW-series";
};
};
}

View file

@ -1,4 +1,5 @@
{ config, ... }: {
{ config, lib, ... }:
lib.mkIf config.bchmnn.collections.profiling.enable {
boot.loader.systemd-boot.memtest86.enable = config.boot.loader.systemd-boot.enable;
boot.loader.grub.memtest86.enable = config.boot.loader.grub.enable;
}

13
modules/core/security.nix Normal file
View file

@ -0,0 +1,13 @@
{ config, lib, ... }:
{
security.polkit.enable = true;
security.rtkit.enable = true;
networking.firewall = {
enable = true;
allowedTCPPorts = lib.optionals (config.bchmnn.collections.development.enable) [
3000
6969
8080
];
};
}

44
modules/core/shell.nix Normal file
View file

@ -0,0 +1,44 @@
{ pkgs, ... }:
let
common = import ./common.nix;
in
{
programs.zsh = {
enable = true;
};
users.users.gandalf = {
shell = pkgs.zsh;
};
environment = {
shellAliases = common.aliases;
};
programs = {
htop.enable = true;
iftop.enable = true;
};
documentation = {
enable = true;
doc.enable = true;
dev.enable = true;
man = {
enable = true;
generateCaches = true;
man-db.enable = true;
};
};
environment.systemPackages = with pkgs; [
man-pages
man-pages-posix
ncurses
];
programs.nh = {
enable = true;
};
}

View file

@ -0,0 +1,32 @@
{
config,
lib,
pkgs,
...
}:
lib.mkIf config.bchmnn.collections.virtualisation.enable {
virtualisation = {
libvirtd.enable = true;
/*
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;
};
oci-containers = {
backend = "docker";
# backend = "podman";
};
containers = {
enable = true;
};
};
hardware.nvidia-container-toolkit.enable = config.bchmnn.nvidia.enable;
environment.systemPackages = with pkgs; [ virtiofsd ];
}

View file

@ -1,6 +0,0 @@
{ pkgs, ... }: {
services.dbus = {
enable = true;
packages = with pkgs; [ gcr dconf ];
};
}

View file

@ -1,133 +1,54 @@
{ lib, ... }: {
# options affecting multiple modules
{ lib, ... }:
{
options.bchmnn = with lib; {
user = {
extraGroups = mkOption {
type = types.listOf types.str;
default = [
"wheel"
"networkmanager"
"libvirtd"
"docker"
"wireshark"
];
};
};
power = {
tlp = {
settings = mkOption {
type = with types; attrsOf (oneOf [ bool int float str (listOf str) ]);
default = {
# performance | powersave
CPU_SCALING_GOVERNOR_ON_AC = "performance";
CPU_SCALING_GOVERNOR_ON_BAT = "powersave";
# performance | balance_performance | default | balance_power | power
CPU_ENERGY_PERF_POLICY_ON_AC = "performance";
CPU_ENERGY_PERF_POLICY_ON_BAT = "power";
# performance | balanced | low-power
PLATFORM_PROFILE_ON_AC = "performance";
PLATFORM_PROFILE_ON_BAT = "low-power";
CPU_MIN_PERF_ON_AC = 0;
CPU_MAX_PERF_ON_AC = 100;
CPU_MIN_PERF_ON_BAT = 0;
CPU_MAX_PERF_ON_BAT = 100;
};
git = {
signing = {
key = mkOption {
type = types.str;
default = "732A612DAD28067D";
};
};
};
gui = {
enable = mkEnableOption "gui";
greeter = {
enable = mkEnableOption "greeter";
collections = {
cli-utils = {
enable = mkEnableOption "cli-utils";
};
flavour = mkOption {
type = types.listOf types.str;
default = [ "sway" ];
example = [ "sway" "i3" ];
description = ''
The flavour (WM) for your system to use
'';
profiling = {
enable = mkEnableOption "profiling";
};
development = {
enable = mkEnableOption "development";
};
vpn = {
enable = mkEnableOption "vpn";
};
virtualisation = {
enable = mkEnableOption "virtualisation";
};
games = {
enable = mkEnableOption "games";
};
};
nvidia = {
enable = mkEnableOption "nvidia";
};
audio = {
enable = mkEnableOption "audio";
pipewire-wine-fix = {
enable = mkEnableOption "pipewire-wine-fix";
};
};
bluetooth = {
enable = mkEnableOption "bluetooth";
};
printing = {
enable = mkEnableOption "printing";
};
vpn = {
enable = mkEnableOption "vpn";
};
sync = {
enable = mkEnableOption "sync";
};
devenv = {
enable = mkEnableOption "devenv";
};
virtualisation = {
enable = mkEnableOption "virtualisation";
};
games = {
enable = mkEnableOption "games";
};
ai = {
enable = mkEnableOption "ai";
};
ratbag = {
enable = mkEnableOption "ratbag";
};
};
imports = [
./arr.nix
./audio.nix
./ausweisapp.nix
./bluetooth.nix
./ccache.nix
./desktop.nix
./dbus.nix
./fonts.nix
./gstreamer.nix
./i18n.nix
./kdeconnect.nix
./keyd.nix
./man.nix
./memtest86.nix
./nautilus.nix
./network.nix
./nh.nix
./nix-ld.nix
./nix.nix
./nvidia.nix
./ollama.nix
./opengl.nix
./openssh.nix
./power.nix
./packages.nix
./printing.nix
./ratbag.nix
./security.nix
./shell.nix
./steam.nix
./syncthing.nix
./tts.nix
./udisks2.nix
./virtualisation.nix
./vpn.nix
./wine.nix
./xdg-portal.nix
./core
./desktop
./home-manager
./services
];
}

View file

@ -1,69 +0,0 @@
{ lib, pkgs, config, ... }: with config.bchmnn; lib.mkIf (gui.enable && gui.flavour != [ ]) {
environment.pathsToLink = [ "/libexec" ]; # links /libexec from derivations to /run/current-system/sw
programs.sway.enable = builtins.elem "sway" gui.flavour;
services.xserver.windowManager.i3.enable = builtins.elem "i3" gui.flavour;
services.libinput.enable = true;
services.xserver = {
enable = (builtins.elem "i3" gui.flavour || builtins.elem "gnome" gui.flavour);
desktopManager.gnome.enable = builtins.elem "gnome" gui.flavour;
displayManager = {
gdm.enable = builtins.elem "gnome" gui.flavour;
startx.enable = builtins.elem "i3" gui.flavour;
};
};
environment.systemPackages = with pkgs; [
(writeShellScriptBin "sway-run" ''
export WLR_NO_HARDWARE_CURSORS=1
exec ${sway}/bin/sway "$@"
'')
];
environment = {
etc = {
"greetd/environments".text = (lib.strings.concatLines gui.flavour);
"greetd/kanshi-config".text = ''
profile nomad {
output "LVDS-1" enable
}
profile iroh {
output "DP-3" enable mode 2560x1440 position 0,0
output "DP-2" enable mode 2560x1440 position 2560,0
output "DP-1" enable mode 2560x1440 position 5120,0
}
profile station {
output "LVDS-1" disable
output "Dell Inc. DELL U2515H 9X2VY5490XUL" enable mode 1920x1080 position 0,0
output "Dell Inc. DELL U2515H 9X2VY5C7138L" enable mode 1920x1080 position 1920,0
output "HJW VGA TO HDMI 0x00000100" enable mode 1920x1080 position 3840,0
}
'';
"greetd/sway-config".text = ''
exec "${pkgs.kanshi}/bin/kanshi --config /etc/greetd/kanshi-config"
exec "${pkgs.greetd.gtkgreet}/bin/gtkgreet -l; swaymsg exit"
bindsym Mod4+shift+e exec swaynag \
-t warning \
-m 'What do you want to do?' \
-b 'Poweroff' 'systemctl poweroff' \
-b 'Reboot' 'systemctl reboot'
include /etc/sway/config.d/*
'';
};
};
services.greetd = {
enable = gui.greeter.enable;
settings = {
default_session = {
command = "sway-run --config /etc/greetd/sway-config" + lib.optionalString nvidia.enable " --unsupported-gpu";
};
};
};
}

View file

@ -0,0 +1,39 @@
{
config,
lib,
pkgs,
...
}:
lib.mkIf config.bchmnn.gui.enable {
environment.systemPackages =
lib.optionals (config.bchmnn.collections.cli-utils.enable) [
pkgs.libnotify # a library that sends desktop notifications to a notification daemon
pkgs.xdg-utils # a set of command line tools that assist applications with a variety of desktop integration tasks
]
++ lib.optionals (config.bchmnn.collections.development.enable) [
pkgs.ghidra-bin
pkgs.mongodb-compass
]
++ lib.optionals (lib.elem "sway" config.bchmnn.gui.flavour) [
pkgs.qt5.qtwayland
pkgs.qt6.qtwayland
pkgs.wineWowPackages.waylandFull
];
programs = {
kdeconnect.enable = true;
ausweisapp = {
enable = true;
openFirewall = true;
};
wireshark.enable = config.bchmnn.collections.development.enable;
virt-manager.enable = config.bchmnn.collections.virtualisation.enable;
};
services.ratbagd.enable = true;
# needed for udiskie
services.udisks2.enable = true;
# enable gvfs to mount android devices
services.gvfs.enable = true;
}

132
modules/desktop/default.nix Normal file
View file

@ -0,0 +1,132 @@
{
config,
lib,
pkgs,
...
}:
{
imports = [
./applications.nix
./fonts.nix
./games.nix
./nautilus.nix
];
options.bchmnn = {
gui = {
enable = lib.mkEnableOption "gui";
greeter = {
enable = lib.mkEnableOption "greeter";
};
flavour = lib.mkOption {
type = lib.types.listOf lib.types.str;
default = [ "sway" ];
example = [
"sway"
"i3"
];
description = ''
The flavour (WM) for your system to use
'';
};
};
};
config = lib.mkIf (config.bchmnn.gui.enable && config.bchmnn.gui.flavour != [ ]) {
environment.pathsToLink = [ "/libexec" ]; # links /libexec from derivations to /run/current-system/sw
programs.sway.enable = builtins.elem "sway" config.bchmnn.gui.flavour;
services.xserver.windowManager.i3.enable = builtins.elem "i3" config.bchmnn.gui.flavour;
services.libinput.enable = true;
services.xserver = {
enable = (
builtins.elem "i3" config.bchmnn.gui.flavour || builtins.elem "gnome" config.bchmnn.gui.flavour
);
desktopManager.gnome.enable = builtins.elem "gnome" config.bchmnn.gui.flavour;
displayManager = {
gdm.enable = builtins.elem "gnome" config.bchmnn.gui.flavour;
startx.enable = builtins.elem "i3" config.bchmnn.gui.flavour;
};
};
environment.systemPackages = [
(pkgs.writeShellScriptBin "sway-run" ''
export WLR_NO_HARDWARE_CURSORS=1
exec ${pkgs.sway}/bin/sway "$@"
'')
];
environment = {
etc = {
"greetd/environments".text = (lib.strings.concatLines config.bchmnn.gui.flavour);
"greetd/kanshi-config".text = ''
profile nomad {
output "LVDS-1" enable
}
profile iroh {
output "DP-3" enable mode 2560x1440 position 0,0
output "DP-2" enable mode 2560x1440 position 2560,0
output "DP-1" enable mode 2560x1440 position 5120,0
}
profile station {
output "LVDS-1" disable
output "Dell Inc. DELL U2515H 9X2VY5490XUL" enable mode 1920x1080 position 0,0
output "Dell Inc. DELL U2515H 9X2VY5C7138L" enable mode 1920x1080 position 1920,0
output "HJW VGA TO HDMI 0x00000100" enable mode 1920x1080 position 3840,0
}
'';
"greetd/sway-config".text = ''
exec "${pkgs.kanshi}/bin/kanshi --config /etc/greetd/kanshi-config"
exec "${pkgs.greetd.gtkgreet}/bin/gtkgreet -l; swaymsg exit"
bindsym Mod4+shift+e exec swaynag \
-t warning \
-m 'What do you want to do?' \
-b 'Poweroff' 'systemctl poweroff' \
-b 'Reboot' 'systemctl reboot'
include /etc/sway/config.d/*
'';
};
};
services.greetd = {
enable = config.bchmnn.gui.greeter.enable;
settings = {
default_session = {
command =
"sway-run --config /etc/greetd/sway-config"
+ lib.optionalString config.bchmnn.nvidia.enable " --unsupported-gpu";
};
};
};
# TODO workaround to get swaylock accepting pw
# https://github.com/NixOS/nixpkgs/issues/158025
security.pam.services = lib.mkIf (lib.elem "sway" config.bchmnn.gui.flavour) { swaylock = { }; };
xdg.portal = {
enable = true;
wlr.enable = true;
config.common.default = "*";
extraPortals = lib.optionals (lib.elem "sway" config.bchmnn.gui.flavour) [
pkgs.xdg-desktop-portal-wlr
];
};
environment.sessionVariables.GST_PLUGIN_SYSTEM_PATH_1_0 =
lib.makeSearchPathOutput "lib" "lib/gstreamer-1.0"
(
with pkgs.gst_all_1;
[
gst-plugins-base
gst-plugins-good
gst-plugins-bad
gst-plugins-ugly
]
);
hardware.opengl = {
enable = true;
driSupport = true;
driSupport32Bit = true;
};
environment.variables =
lib.mkIf (builtins.elem pkgs.intel-media-driver config.hardware.opengl.extraPackages)
{ LIBVA_DRIVER_NAME = "iHD"; };
};
}

View file

@ -1,4 +1,10 @@
{ pkgs, ... }: {
{
pkgs,
lib,
config,
...
}:
lib.mkIf (config.bchmnn.gui.enable) {
# Add fonts
fonts = {
enableDefaultPackages = true;

16
modules/desktop/games.nix Normal file
View file

@ -0,0 +1,16 @@
{
pkgs,
config,
lib,
...
}:
lib.mkIf config.bchmnn.collections.games.enable {
programs.steam = {
enable = true;
};
environment.systemPackages = [
pkgs.mangohud
pkgs.gamemode
];
}

View file

@ -1,4 +1,10 @@
{ pkgs, lib, config, ... }: with config.bchmnn; lib.mkIf (gui.enable && gui.flavour != [ ]) {
{
pkgs,
lib,
config,
...
}:
lib.mkIf (config.bchmnn.gui.enable && config.bchmnn.gui.flavour != [ ]) {
programs.nautilus-open-any-terminal = {
enable = true;
terminal = "kitty";
@ -6,9 +12,7 @@
environment = {
sessionVariables.NAUTILUS_4_EXTENSION_DIR = "${pkgs.gnome.nautilus-python}/lib/nautilus/extensions-4";
pathsToLink = [
"/share/nautilus-python/extensions"
];
pathsToLink = [ "/share/nautilus-python/extensions" ];
systemPackages = with pkgs; [
gnome.nautilus

View file

@ -1,8 +0,0 @@
{ lib, pkgs, ... }: {
environment.sessionVariables.GST_PLUGIN_SYSTEM_PATH_1_0 = lib.makeSearchPathOutput "lib" "lib/gstreamer-1.0" (with pkgs.gst_all_1; [
gst-plugins-base
gst-plugins-good
gst-plugins-bad
gst-plugins-ugly
]);
}

View file

@ -0,0 +1,22 @@
{ pkgs, ... }:
{
home.packages = [
pkgs.gopass # slightly more awesome standard unix password manager for teams. written in go
pkgs.gopass-jsonapi # enables communication with gopass via json messages
pkgs.yt-dlp # command-line tool to download videos from youtube.com and other sites (youtube-dl fork)
pkgs.gdu # fast disk usage analyzer with console interface written in go
pkgs.duf # disk usage/free utility - a better 'df' alternative
pkgs.stress # simple workload generator for posix systems. it imposes a configurable amount of cpu, memory, i/o, and disk stress on the system
pkgs.s-tui # stress-terminal ui monitoring tool
pkgs.fio # flexible io tester - an io benchmark tool
pkgs.ffmpeg # complete, cross-platform solution to record, convert and stream audio and video
pkgs.texliveFull # tex live environment
pkgs.imagemagick # software suite to create, edit, compose, or convert bitmap images
pkgs.ghostscript # postscript interpreter (mainline version)
pkgs.pdftk # command-line tool for working with pdfs
pkgs.ventoy-full # bootable usb solution
pkgs.unstable.isisdl # downloader for isis of tu-berlin
pkgs.sage # open source mathematics software, free alternative to magma, maple, mathematica, and matlab
pkgs.filebrowser # filebrowser is a web application for managing files and directories
];
}

View file

@ -1,4 +1,5 @@
{
{ lib, nixosConfig, ... }:
lib.mkIf nixosConfig.bchmnn.audio.enable {
xdg.configFile."wireplumber/wireplumber.conf.d/51-scarlett-samplerate.conf" = {
text = ''
monitor.alsa.rules = [
@ -21,19 +22,6 @@
}
}
}
# {
# matches = [
# {
# node.nick = "Scarlett 2i2 USB"
# }
# ]
# actions = {
# update-props = {
# audio.rate = 48000
# api.acp.probe-rate = 48000
# }
# }
# }
]
'';
};

View file

@ -0,0 +1,16 @@
{ lib, nixosConfig, ... }:
{
dconf.settings = {
"org/virt-manager/virt-manager/connections" =
lib.mkIf nixosConfig.bchmnn.collections.virtualisation.enable
{
autoconnect = [ "qemu:///system" ];
uris = [ "qemu:///system" ];
};
"org/gnome/desktop/interface" = {
"color-scheme" = "prefer-light";
};
};
}

View file

@ -0,0 +1,57 @@
{ config, ... }@inputs:
let
common = import ../core/common.nix;
in
{
imports = [ inputs.home-manager.nixosModules.home-manager ];
users.users.gandalf = {
isNormalUser = true;
extraGroups = config.bchmnn.user.extraGroups;
};
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
home-manager.extraSpecialArgs = {
inherit inputs;
};
home-manager.users.gandalf = rec {
imports = [
./gui
./scripts
./applications.nix
./audio.nix
./dconf.nix
./git.nix
./gnupg.nix
./keyd.nix
./neovim.nix
./shell.nix
./zsh.nix
];
config = {
home = {
username = "gandalf";
homeDirectory = "/home/gandalf";
shellAliases = common.aliases;
stateVersion = "23.05";
};
xdg.userDirs = {
enable = true;
createDirectories = true;
desktop = "${config.home.homeDirectory}/tmp";
documents = "${config.home.homeDirectory}/docs";
download = "${config.home.homeDirectory}/dl";
music = "${config.home.homeDirectory}/music";
pictures = "${config.home.homeDirectory}/pics";
publicShare = "${config.home.homeDirectory}/public";
templates = "${config.home.homeDirectory}/templates";
videos = "${config.home.homeDirectory}/vids";
};
};
};
}

View file

@ -1,15 +1,18 @@
{ ... }: {
{ nixosConfig, ... }:
{
programs.git = {
enable = true;
lfs.enable = true;
signing = {
signByDefault = true;
key = "732A612DAD28067D";
key = nixosConfig.bchmnn.git.signing.key;
};
userEmail = "jacob.bachmann@posteo.de";
userName = "Jacob Bachmann";
extraConfig = {
init = { defaultBranch = "main"; };
init = {
defaultBranch = "main";
};
core.editor = "nvim";
pull.rebase = false;
push.autoSetupRemote = true;

View file

@ -1,4 +1,5 @@
{ pkgs, ... }: {
{ pkgs, ... }:
{
programs.gpg = {
enable = true;
};

View file

@ -1,4 +1,5 @@
{ pkgs, lib, ... }: {
{ pkgs, lib, ... }:
{
colorschemes = rec {
custom = {
black = "#000000";

View file

@ -1,4 +1,5 @@
{ pkgs, ... }: {
{ pkgs, ... }:
{
home.pointerCursor = {
name = "macOS-Monterey";
package = pkgs.apple-cursor;

View file

@ -0,0 +1,13 @@
{ lib, nixosConfig, ... }:
{
imports =
with lib;
with nixosConfig.bchmnn;
optionals gui.enable [
./cursor.nix
./gtk.nix
./programs
]
++ optionals (gui.enable && elem "sway" gui.flavour) [ ./sway ]
++ optionals (gui.enable && elem "i3" gui.flavour) [ ./i3 ];
}

View file

@ -1,5 +1,5 @@
{ ... }: {
{ ... }:
{
gtk = {
enable = true;
gtk3.extraConfig = {
@ -9,5 +9,4 @@
gtk-application-prefer-dark-theme = 0;
};
};
}

View file

@ -1,5 +1,5 @@
{ ... }: {
{ ... }:
{
programs.autorandr = {
enable = true;
@ -52,5 +52,4 @@
};
};
};
}

View file

@ -1,16 +1,22 @@
{ pkgs, lib, config, ... }:
{
pkgs,
lib,
config,
...
}:
let
cfg = config.xsession.windowManager.i3.config;
# common = (import ../common.nix) { pkgs = pkgs; lib = lib; };
common = (import ../common.nix) { inherit pkgs; inherit lib; };
common = (import ../common.nix) {
inherit pkgs;
inherit lib;
};
start-polybar = pkgs.writeShellScript "start-polybar" ''
${pkgs.polybarFull}/bin/polybar-msg cmd quit
echo "---" | tee -a /tmp/polybar.log
${pkgs.polybarFull}/bin/polybar 2>&1 | tee -a /tmp/polybar.log & disown
'';
in
{
@ -49,7 +55,9 @@ in
menu = "${config.programs.rofi.package}/bin/rofi -show drun";
startup = with pkgs; [
{ command = "${start-polybar}"; }
{ command = "${gnome.gnome-keyring}/bin/gnome-keyring-daemon --start --components=ssh,secrets,pkcs11"; }
{
command = "${gnome.gnome-keyring}/bin/gnome-keyring-daemon --start --components=ssh,secrets,pkcs11";
}
{ command = "${autorandr}/bin/autorandr -c"; }
{ command = "${feh}/bin/feh --bg-fill ${common.wallpaper.default}"; }
{ command = "${networkmanagerapplet}/bin/nm-applet"; }
@ -58,7 +66,10 @@ in
{ command = "${nextcloud-client}/bin/nextcloud"; }
{ command = "${plasma5Packages.kdeconnect-kde}/bin/kdeconnect-indicator"; }
{ command = "${system-config-printer}/bin/system-config-printer-applet"; }
{ command = "${config.programs.kitty.package}/bin/kitty --class dropdown --title dropdown"; always = true; }
{
command = "${config.programs.kitty.package}/bin/kitty --class dropdown --title dropdown";
always = true;
}
];
fonts = {
names = [ common.font ];

View file

@ -1,6 +1,9 @@
{ pkgs, lib, ... }:
let
common = (import ../common.nix) { pkgs = pkgs; lib = lib; };
common = (import ../common.nix) {
pkgs = pkgs;
lib = lib;
};
alabaster-theme-patch = builtins.toFile "alabaster.patch" ''
diff --git a/alabaster.toml b/alabaster.toml
index df312d3..f5e5499 100644
@ -21,11 +24,9 @@ let
[colors.normal]
'';
alacritty-theme-patched = pkgs.alacritty-theme.overrideAttrs (final: previous: {
patches = [
alabaster-theme-patch
];
});
alacritty-theme-patched = pkgs.alacritty-theme.overrideAttrs (
final: previous: { patches = [ alabaster-theme-patch ]; }
);
in
{
programs.alacritty = {

View file

@ -1,6 +1,5 @@
{ config, pkgs, ... }:
let
icons = {
chromium = ./icons/chromium.png;
spotify = ./icons/spotify.png;
@ -8,7 +7,6 @@ let
outlook = ./icons/outlook.png;
whatsapp = ./icons/whatsapp.png;
};
in
{
@ -63,6 +61,4 @@ in
Icon=${icons.whatsapp}
'';
};
}

View file

Before

Width:  |  Height:  |  Size: 11 KiB

After

Width:  |  Height:  |  Size: 11 KiB

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 10 KiB

After

Width:  |  Height:  |  Size: 10 KiB

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 10 KiB

After

Width:  |  Height:  |  Size: 10 KiB

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 8.5 KiB

After

Width:  |  Height:  |  Size: 8.5 KiB

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 26 KiB

After

Width:  |  Height:  |  Size: 26 KiB

Before After
Before After

View file

@ -0,0 +1,62 @@
{
pkgs,
lib,
nixosConfig,
...
}:
{
imports = [
./alacritty.nix
./chromium
./discord.nix
./games.nix
./keyring.nix
./kitty.nix
./obs.nix
./vscode.nix
./zathura.nix
];
home.packages =
with pkgs;
[
firefox # a web browser built from firefox source tree
thunderbird # a full-featured e-mail client
speechd # common interface to speech synthesis - https://support.mozilla.org/en-us/kb/speechd-setup
tor-browser # privacy-focused browser routing traffic through the tor network
qbittorrent # featureful free software bittorrent client
element-desktop # a feature-rich client for matrix.org
telegram-desktop # telegram desktop messaging app
signal-desktop # private, simple, and secure messenger
zoom-us # zoom.us video conferencing application
gnome.simple-scan # simple scanning utility
gnome.gnome-font-viewer # program that can preview fonts and create thumbnails for fonts
pppdf
feh # a light-weight image viewer
mpv
vlc # cross-platform media player and streaming server
zathura # a highly customizable and functional pdf viewer
neovide # a simple graphical user interface for neovim
gimp # the gnu image manipulation program
(calibre.override { unrarSupport = true; })
libreoffice # comprehensive, professional-quality productivity suite, a variant of openoffice.org
xournalpp # a handwriting notetaking software with pdf annotation support
libsForQt5.okular # kde document viewer
carla # audio plugin host
picard # musicbrainz picard audio file tagger
anki # spaced repetition flashcard program
]
++ lib.optionals nixosConfig.bchmnn.printing.enable [
system-config-printer # graphical user interface for cups administration
]
++ lib.optionals nixosConfig.services.ratbagd.enable [
piper # gtk frontend for ratbagd mouse config daemon
];
}

View file

@ -1,4 +1,5 @@
{ pkgs, ... }: {
{ pkgs, ... }:
{
home.packages = with pkgs; [
vesktop # alternate client for discord with vencord built-in
];

View file

@ -0,0 +1,15 @@
{
nixosConfig,
lib,
pkgs,
...
}:
lib.mkIf nixosConfig.bchmnn.collections.games.enable {
home.packages = with pkgs; [
openjdk17 # the open-source java development kit
prismlauncher # a free, open source launcher for minecraft
# retroarchFull # multi-platform emulator frontend for libretro cores
celestia # real-time 3d simulation of space
extremetuxracer # high speed arctic racing game based on tux racer
];
}

View file

@ -1,5 +1,5 @@
{ pkgs, ... }: {
{ pkgs, ... }:
{
services.gnome-keyring = {
enable = true;
components = [
@ -9,8 +9,5 @@
];
};
home.packages = with pkgs; [
gnome.seahorse
];
home.packages = with pkgs; [ gnome.seahorse ];
}

View file

@ -1,6 +1,9 @@
{ pkgs, lib, ... }:
let
common = (import ../common.nix) { pkgs = pkgs; lib = lib; };
common = (import ../common.nix) {
pkgs = pkgs;
lib = lib;
};
kitty-alabaster-theme-patch = builtins.toFile "kitty-theme-alabaster.patch" ''
diff --git a/themes/Alabaster.conf b/themes/Alabaster.conf
index 7989049..b0c180e 100644
@ -41,11 +44,9 @@ let
#: kitty window border colors and terminal bell colors
'';
kitty-theme-patched = pkgs.kitty-themes.overrideAttrs (final: previous: {
patches = [
kitty-alabaster-theme-patch
];
});
kitty-theme-patched = pkgs.kitty-themes.overrideAttrs (
final: previous: { patches = [ kitty-alabaster-theme-patch ]; }
);
in
{
programs.kitty = {

View file

@ -1,8 +1,7 @@
{ pkgs, ... }: {
{ pkgs, ... }:
{
programs.obs-studio = {
enable = true;
plugins = [ pkgs.obs-studio-plugins.wlrobs ];
};
}

View file

@ -1,6 +1,9 @@
{ pkgs, lib, ... }:
let
common = (import ../common.nix) { pkgs = pkgs; lib = lib; };
common = (import ../common.nix) {
pkgs = pkgs;
lib = lib;
};
in
{
programs.vscode = {
@ -129,7 +132,6 @@ in
"editor.defaultFormatter" = "jnoortheen.nix-ide";
};
"git.autofetch" = true;
"json.schemaDownload.enable" = true;
"javascript.updateImportsOnFileMove.enabled" = "always";
@ -170,4 +172,3 @@ in
];
};
}

View file

@ -1,4 +1,5 @@
{ ... }: {
{ ... }:
{
# a highly customizable and functional pdf viewer
programs.zathura = {
enable = true;

View file

@ -1,12 +1,18 @@
{ pkgs, lib, config, nixosConfig, ... }:
{
pkgs,
lib,
config,
nixosConfig,
...
}:
let
cfg = config.wayland.windowManager.sway.config;
common = (import ../common.nix) { pkgs = pkgs; lib = lib; };
common = (import ../common.nix) {
pkgs = pkgs;
lib = lib;
};
in
{
imports = [
./kanshi.nix
./swaync
@ -45,40 +51,44 @@ in
gtk = true;
};
xwayland = true;
extraSessionCommands = with lib; with nixosConfig.bchmnn; ''
export CLUTTER_BACKEND=wayland;
export GDK_BACKEND=wayland;
export GDK_DPI_SCALE=1;
export NIXOS_OZONE_WL=1;
export MOZ_ENABLE_WAYLAND=1;
export MOZ_USE_XINPUT2=1;
export XDG_SESSION_TYPE=wayland;
export XDG_CURRENT_DESKTOP=sway;
extraSessionCommands =
with lib;
with nixosConfig.bchmnn;
''
export CLUTTER_BACKEND=wayland;
export GDK_BACKEND=wayland;
export GDK_DPI_SCALE=1;
export NIXOS_OZONE_WL=1;
export MOZ_ENABLE_WAYLAND=1;
export MOZ_USE_XINPUT2=1;
export XDG_SESSION_TYPE=wayland;
export XDG_CURRENT_DESKTOP=sway;
# sdl
export SDL_VIDEODRIVER=wayland
# sdl
export SDL_VIDEODRIVER=wayland
# qt
export QT_QPA_PLATFORM=wayland-egl
export QT_WAYLAND_DISABLE_WINDOWDECORATION=1
# qt
export QT_QPA_PLATFORM=wayland-egl
export QT_WAYLAND_DISABLE_WINDOWDECORATION=1
# java
export _JAVA_AWT_WM_NONREPARENTING=1
export _JAVA_OPTIONS="-Dawt.useSystemAAFontSettings=on";
# java
export _JAVA_AWT_WM_NONREPARENTING=1
export _JAVA_OPTIONS="-Dawt.useSystemAAFontSettings=on";
'' + optionalString nvidia.enable ''
# nvidia
export WLR_RENDERER=vulkan;
# export LIBVA_DRIVER_NAME,nvidia;
# export GBM_BACKEND=nvidia-drm;
export __GL_GSYNC_ALLOWED=0;
export __GL_VRR_ALLOWED=0;
export __GLX_VENDOR_LIBRARY_NAME=nvidia;
export WLR_NO_HARDWARE_CURSORS=1;
''
+ optionalString nvidia.enable ''
# nvidia
export WLR_RENDERER=vulkan;
# export LIBVA_DRIVER_NAME,nvidia;
# export GBM_BACKEND=nvidia-drm;
export __GL_GSYNC_ALLOWED=0;
export __GL_VRR_ALLOWED=0;
export __GLX_VENDOR_LIBRARY_NAME=nvidia;
export WLR_NO_HARDWARE_CURSORS=1;
# xwayland compat
export XWAYLAND_NO_GLAMOR=1;
'';
# xwayland compat
export XWAYLAND_NO_GLAMOR=1;
'';
config = {
modifier = "Mod4";
terminal = "${config.programs.kitty.package}/bin/kitty";
@ -92,7 +102,9 @@ in
# { command = "${nixosConfig.systemd.package}/bin/systemctl --user stop xdg-desktop-portal xdg-desktop-portal-wlr"; }
# { command = "${nixosConfig.systemd.package}/bin/systemctl --user start xdg-desktop-portal xdg-desktop-portal-wlr"; }
# { command = "${dbus}/bin/dbus-update-activation-environment --systemd DISPLAY WAYLAND_DISPLAY SWAYSOCK"; }
{ command = "${config.programs.waybar.package}/bin/waybar -c ${config.xdg.configHome}/waybar/swaybar.json -s ${config.xdg.configHome}/waybar/swaybar.css"; }
{
command = "${config.programs.waybar.package}/bin/waybar -c ${config.xdg.configHome}/waybar/swaybar.json -s ${config.xdg.configHome}/waybar/swaybar.css";
}
{ command = "${dbus}/bin/dbus-update-activation-environment --all"; }
{ command = "${kanshi}/bin/kanshi"; }
{ command = "${networkmanagerapplet}/bin/nm-applet"; }
@ -340,6 +352,4 @@ in
workspace 1
'';
};
}

View file

@ -1,5 +1,5 @@
{ ... }: {
{ ... }:
{
services.kanshi = {
enable = true;

View file

@ -1,6 +1,9 @@
{ pkgs, lib, ... }:
let
common = (import ../common.nix) { pkgs = pkgs; lib = lib; };
common = (import ../common.nix) {
pkgs = pkgs;
lib = lib;
};
in
{
programs.wofi = {

View file

@ -1,3 +1,4 @@
{ pkgs, ... }: {
{ pkgs, ... }:
{
home.file.".XCompose".source = "${pkgs.keyd}/share/keyd/keyd.compose";
}

View file

@ -1,13 +1,8 @@
{ pkgs, ... }: {
/*
xdg.configFile."nvim" = {
source = ./config;
recursive = true;
};
*/
{ pkgs, ... }:
{
home.packages = with pkgs; [
gcc
nodejs_20
tree-sitter # parser generator tool and an incremental parsing library
lua-language-server # language server that offers lua language support
clang-tools # standalone command line tools for c++ development
@ -15,6 +10,8 @@
rustfmt # tool for formatting rust code according to style guidelines
gopls # official language server for the go language
nixd # nix language server
nil # yet another language server for nix
nixfmt-rfc-style # official formatter for nix code
nodePackages.pyright # type checker for the python language
ruff # an extremely fast python linter
black # uncompromising python code formatter
@ -38,5 +35,4 @@
defaultEditor = true;
vimAlias = true;
};
}

View file

@ -1,7 +1,6 @@
{ pkgs, nixosConfig, ... }: {
imports = [
./pomodoro.nix
];
{ pkgs, nixosConfig, ... }:
{
imports = [ ./pomodoro.nix ];
home.packages = [
(import ./git-clone-list.nix { inherit pkgs; })
(import ./nix-update.nix { inherit pkgs nixosConfig; })

View file

@ -1,5 +1,4 @@
{ pkgs }:
pkgs.writeShellScriptBin "git-clone-list" ''
reset="\e[0m"
bold="\e[1m"

View file

@ -1,5 +1,4 @@
{ pkgs, nixosConfig }:
pkgs.writeShellScriptBin "nuf" ''
reset="\e[0m"
red="\e[31m"

View file

@ -0,0 +1,19 @@
{ pkgs, ... }:
let
pootis = ./pootis.m4a;
in
{
home.packages = [
pkgs.openpomodoro-cli
(pkgs.writeShellScriptBin "pomostart" ''
clear
${pkgs.openpomodoro-cli}/bin/openpomodoro-cli start --wait $@
while ${pkgs.mpv}/bin/mpv ${pootis} > /dev/null 2>&1; do :; done
'')
(pkgs.writeShellScriptBin "pomobreak" ''
clear
${pkgs.openpomodoro-cli}/bin/openpomodoro-cli break --wait $@
while ${pkgs.mpv}/bin/mpv ${pootis} > /dev/null 2>&1; do :; done
'')
];
}

View file

@ -0,0 +1,56 @@
{
nixosConfig,
lib,
pkgs,
...
}:
{
home.file.".XCompose".source = "${pkgs.keyd}/share/keyd/keyd.compose";
programs.ssh = {
enable = true;
addKeysToAgent = "yes";
includes = [ "config.d/*" ];
};
home.file.".ssh/config.d/.keep".source = builtins.toFile "keep" "";
services.ssh-agent = {
enable = true;
};
programs.tmux = {
enable = true;
newSession = true;
terminal = "screen-256color";
clock24 = true;
escapeTime = 0;
historyLimit = 10000;
mouse = true;
keyMode = "vi";
};
programs.eza = {
enable = true;
enableBashIntegration = true;
enableZshIntegration = true;
};
programs.fzf = {
enable = true;
enableBashIntegration = true;
enableZshIntegration = true;
};
programs.yazi = {
enable = true;
};
home.packages = [
pkgs.exiftool
pkgs.mediainfo
] ++ lib.optionals nixosConfig.bchmnn.gui.enable [ pkgs.ueberzugpp ];
}

View file

@ -1,4 +1,5 @@
{ config, ... }: {
{ config, ... }:
{
programs.zsh = {
enable = true;
enableCompletion = true;

View file

@ -1,14 +0,0 @@
{ ... }: {
# Set your time zone.
time.timeZone = "Europe/Berlin";
# Select internationalisation properties.
i18n = {
defaultLocale = "en_US.UTF-8";
supportedLocales = [ "en_US.UTF-8/UTF-8" "de_DE.UTF-8/UTF-8" ];
};
console = {
font = "Lat2-Terminus16";
keyMap = "us";
};
}

View file

@ -1,3 +0,0 @@
{ config, ... }: {
programs.kdeconnect.enable = config.bchmnn.gui.enable;
}

View file

@ -1,21 +0,0 @@
{ pkgs, ... }: {
documentation = {
enable = true;
doc.enable = true;
dev.enable = true;
man = {
enable = true;
generateCaches = true;
man-db.enable = true;
};
};
environment.systemPackages = with pkgs; [
man-pages
man-pages-posix
ncurses
];
}

View file

@ -1,12 +0,0 @@
{ pkgs, ... }: {
networking.networkmanager.enable = true;
systemd.services = {
NetworkManager-wait-online.enable = false;
};
programs.wireshark = {
enable = true;
package = pkgs.wireshark;
};
}

View file

@ -1,8 +0,0 @@
{
programs.nh = {
enable = true;
# clean.enable = true;
# clean.extraArgs = "--keep-since 4d --keep 3";
# flake = "/etc/nixos";
};
}

View file

@ -1,12 +0,0 @@
{ pkgs, ... }: {
# provide libraries for non-nix binaries
programs.nix-ld = {
enable = true;
libraries = with pkgs; [
glibc
libcxx
libllvm
ncurses
];
};
}

View file

@ -1,28 +0,0 @@
{ ... }@inputs: {
nix = {
settings = {
experimental-features = [ "nix-command" "flakes" ];
auto-optimise-store = true;
};
};
nixpkgs = {
overlays = [
(self: super: {
unstable = import inputs.nixpkgs-unstable {
system = super.system;
};
mfcl3750cdwlpr = (super.callPackage ../overlays/mfcl3750cdw.nix { }).driver;
mfcl3750cdwcupswrapper = (super.callPackage ../overlays/mfcl3750cdw.nix { }).cupswrapper;
pppdf = (super.python3Packages.callPackage ../overlays/pppdf { });
iglesia-light = (super.callPackage ../overlays/fonts/iglesia-light.nix { });
})
];
config = {
allowUnfree = true;
allowUnfreePredicate = (_: true);
};
};
system.stateVersion = "23.05";
}

Some files were not shown because too many files have changed in this diff Show more