Switch to 4 space indentation

This commit is contained in:
SebastianStork 2024-03-17 13:15:01 +01:00
parent a4cc33577c
commit d7aed49725
32 changed files with 796 additions and 783 deletions

View file

@ -1,40 +1,40 @@
{ {
inputs = { inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
home-manager = { home-manager = {
url = "github:nix-community/home-manager/"; url = "github:nix-community/home-manager/";
inputs.nixpkgs.follows = "nixpkgs"; inputs.nixpkgs.follows = "nixpkgs";
};
nix-index-database = {
url = "github:Mic92/nix-index-database";
inputs.nixpkgs.follows = "nixpkgs";
};
sops-nix = {
url = "github:Mic92/sops-nix";
inputs.nixpkgs.follows = "nixpkgs";
};
}; };
nix-index-database = { outputs = {nixpkgs, ...} @ inputs: let
url = "github:Mic92/nix-index-database"; system = "x86_64-linux";
inputs.nixpkgs.follows = "nixpkgs"; pkgs = nixpkgs.legacyPackages.${system};
}; in {
nixosConfigurations = {
dell-laptop = nixpkgs.lib.nixosSystem {
inherit system;
specialArgs = {inherit inputs;};
modules = [
./hosts/dell-laptop
./users/seb
];
};
};
sops-nix = { devShells.${system}.default = pkgs.mkShell {
url = "github:Mic92/sops-nix"; packages = [pkgs.sops];
inputs.nixpkgs.follows = "nixpkgs"; };
}; };
};
outputs = {nixpkgs, ...} @ inputs: let
system = "x86_64-linux";
pkgs = nixpkgs.legacyPackages.${system};
in {
nixosConfigurations = {
dell-laptop = nixpkgs.lib.nixosSystem {
inherit system;
specialArgs = {inherit inputs;};
modules = [
./hosts/dell-laptop
./users/seb
];
};
};
devShells.${system}.default = pkgs.mkShell {
packages = [pkgs.sops];
};
};
} }

View file

@ -1,34 +1,34 @@
{pkgs, ...}: { {pkgs, ...}: {
imports = [../modules/system]; imports = [../modules/system];
system.stateVersion = "23.11"; system.stateVersion = "23.11";
nix.settings = { nix.settings = {
experimental-features = ["nix-command" "flakes"]; experimental-features = ["nix-command" "flakes"];
auto-optimise-store = true; auto-optimise-store = true;
warn-dirty = false; warn-dirty = false;
trusted-users = ["root" "@wheel"]; trusted-users = ["root" "@wheel"];
}; };
nixpkgs.config.allowUnfree = true; nixpkgs.config.allowUnfree = true;
console.keyMap = "de-latin1-nodeadkeys"; console.keyMap = "de-latin1-nodeadkeys";
time.timeZone = "Europe/Berlin"; time.timeZone = "Europe/Berlin";
i18n.defaultLocale = "en_US.UTF-8"; i18n.defaultLocale = "en_US.UTF-8";
i18n.extraLocaleSettings = { i18n.extraLocaleSettings = {
LC_ADDRESS = "de_DE.UTF-8"; LC_ADDRESS = "de_DE.UTF-8";
LC_IDENTIFICATION = "de_DE.UTF-8"; LC_IDENTIFICATION = "de_DE.UTF-8";
LC_MEASUREMENT = "de_DE.UTF-8"; LC_MEASUREMENT = "de_DE.UTF-8";
LC_MONETARY = "de_DE.UTF-8"; LC_MONETARY = "de_DE.UTF-8";
LC_NAME = "de_DE.UTF-8"; LC_NAME = "de_DE.UTF-8";
LC_NUMERIC = "de_DE.UTF-8"; LC_NUMERIC = "de_DE.UTF-8";
LC_PAPER = "de_DE.UTF-8"; LC_PAPER = "de_DE.UTF-8";
LC_TELEPHONE = "de_DE.UTF-8"; LC_TELEPHONE = "de_DE.UTF-8";
LC_TIME = "de_DE.UTF-8"; LC_TIME = "de_DE.UTF-8";
}; };
environment.systemPackages = [ environment.systemPackages = [
pkgs.git pkgs.git
pkgs.neovim pkgs.neovim
]; ];
} }

View file

@ -1,52 +1,52 @@
{pkgs, ...}: { {pkgs, ...}: {
imports = [ imports = [
../default.nix ../default.nix
./hardware.nix ./hardware.nix
]; ];
networking.hostName = "dell-laptop"; networking.hostName = "dell-laptop";
myConfig = { myConfig = {
boot-loader.systemd-boot.enable = true; boot-loader.systemd-boot.enable = true;
dm.lightdm.enable = true; dm.lightdm.enable = true;
de.qtile.enable = true; de.qtile.enable = true;
wlan.enable = true; wlan.enable = true;
bluetooth.enable = true; bluetooth.enable = true;
sound.pipewire.enable = true; sound.pipewire.enable = true;
auto-gc.enable = true; auto-gc.enable = true;
vm.qemu.enable = true; vm.qemu.enable = true;
flatpak.enable = true; flatpak.enable = true;
vpn.lgs.enable = true; vpn.lgs.enable = true;
comma.enable = true; comma.enable = true;
sops.enable = true; sops.enable = true;
auto-cpufreq.enable = true; auto-cpufreq.enable = true;
doas.enable = false; doas.enable = false;
};
boot.kernelPackages = pkgs.linuxPackages_latest;
services.gvfs.enable = true;
services.autorandr = {
enable = true;
profiles = {
"laptop" = {
fingerprint = {
"eDP-1" = "00ffffffffffff000dae221500000000161e0104a52213780328659759548e271e5054000000010101010101010101010101010101015c6f80a070383e403020a50058c11000001a000000fd00307889891d010a202020202020000000fe00594d485748803135364852410a000000000001410f99001000000b010a2020016970137900000301145c6f00047f079f002f001f003704b4040900040000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001a90";
};
config = {
"eDP-1" = {
enable = true;
primary = true;
position = "0x0";
mode = "1920x1080";
rate = "60";
};
};
};
}; };
};
services.xserver.displayManager.sessionCommands = "autorandr -c"; boot.kernelPackages = pkgs.linuxPackages_latest;
services.gvfs.enable = true;
services.autorandr = {
enable = true;
profiles = {
"laptop" = {
fingerprint = {
"eDP-1" = "00ffffffffffff000dae221500000000161e0104a52213780328659759548e271e5054000000010101010101010101010101010101015c6f80a070383e403020a50058c11000001a000000fd00307889891d010a202020202020000000fe00594d485748803135364852410a000000000001410f99001000000b010a2020016970137900000301145c6f00047f079f002f001f003704b4040900040000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001a90";
};
config = {
"eDP-1" = {
enable = true;
primary = true;
position = "0x0";
mode = "1920x1080";
rate = "60";
};
};
};
};
};
services.xserver.displayManager.sessionCommands = "autorandr -c";
} }

View file

@ -1,34 +1,34 @@
{ {
config, config,
lib, lib,
modulesPath, modulesPath,
... ...
}: { }: {
imports = [ imports = [
(modulesPath + "/installer/scan/not-detected.nix") (modulesPath + "/installer/scan/not-detected.nix")
]; ];
boot.initrd.availableKernelModules = ["nvme" "xhci_pci" "ahci" "usb_storage" "sd_mod"]; boot.initrd.availableKernelModules = ["nvme" "xhci_pci" "ahci" "usb_storage" "sd_mod"];
boot.initrd.kernelModules = []; boot.initrd.kernelModules = [];
boot.kernelModules = ["kvm-amd"]; boot.kernelModules = ["kvm-amd"];
boot.extraModulePackages = []; boot.extraModulePackages = [];
fileSystems."/" = { fileSystems."/" = {
device = "/dev/disk/by-uuid/92437114-de06-4a78-9ee3-c7d0ffcabf95"; device = "/dev/disk/by-uuid/92437114-de06-4a78-9ee3-c7d0ffcabf95";
fsType = "ext4"; fsType = "ext4";
}; };
fileSystems."/boot" = { fileSystems."/boot" = {
device = "/dev/disk/by-uuid/D8B4-1218"; device = "/dev/disk/by-uuid/D8B4-1218";
fsType = "vfat"; fsType = "vfat";
}; };
swapDevices = [ swapDevices = [
{device = "/dev/disk/by-uuid/1eba93d1-4853-4534-8cfd-5c14e29c6ff6";} {device = "/dev/disk/by-uuid/1eba93d1-4853-4534-8cfd-5c14e29c6ff6";}
]; ];
networking.useDHCP = lib.mkDefault true; networking.useDHCP = lib.mkDefault true;
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
} }

View file

@ -1,12 +1,12 @@
{ {
imports = [ imports = [
./qtile ./qtile
./vscode.nix ./vscode.nix
./shell.nix ./shell.nix
./theming.nix ./theming.nix
./ssh-client.nix ./ssh-client.nix
./git.nix ./git.nix
./neovim.nix ./neovim.nix
./kitty.nix ./kitty.nix
]; ];
} }

View file

@ -1,22 +1,22 @@
{ {
config, config,
lib, lib,
... ...
}: { }: {
options.myConfig.git.enable = lib.mkEnableOption ""; options.myConfig.git.enable = lib.mkEnableOption "";
config = lib.mkIf config.myConfig.git.enable { config = lib.mkIf config.myConfig.git.enable {
programs.git = { programs.git = {
enable = true; enable = true;
userName = "SebastianStork"; userName = "SebastianStork";
userEmail = "sebastian.stork@pm.me"; userEmail = "sebastian.stork@pm.me";
extraConfig = { extraConfig = {
init.defaultBranch = "main"; init.defaultBranch = "main";
}; };
};
programs.lazygit.enable = true;
}; };
programs.lazygit.enable = true;
};
} }

View file

@ -1,22 +1,22 @@
{ {
config, config,
lib, lib,
... ...
}: { }: {
options.myConfig.kitty.enable = lib.mkEnableOption ""; options.myConfig.kitty.enable = lib.mkEnableOption "";
config = lib.mkIf config.myConfig.kitty.enable { config = lib.mkIf config.myConfig.kitty.enable {
programs.kitty = { programs.kitty = {
enable = true; enable = true;
settings = { settings = {
font_family = "JetBrainsMono Nerd Font"; font_family = "JetBrainsMono Nerd Font";
confirm_os_window_close = 0; confirm_os_window_close = 0;
background_opacity = "0.7"; background_opacity = "0.7";
scrollback_lines = 10000; scrollback_lines = 10000;
enable_audio_bell = false; enable_audio_bell = false;
update_check_interval = 0; update_check_interval = 0;
}; };
};
}; };
};
} }

View file

@ -1,17 +1,17 @@
{ {
config, config,
lib, lib,
... ...
}: { }: {
options.myConfig.neovim.enable = lib.mkEnableOption ""; options.myConfig.neovim.enable = lib.mkEnableOption "";
config = lib.mkIf config.myConfig.neovim.enable { config = lib.mkIf config.myConfig.neovim.enable {
programs.neovim = { programs.neovim = {
enable = true; enable = true;
defaultEditor = true; defaultEditor = true;
viAlias = true; viAlias = true;
vimAlias = true; vimAlias = true;
vimdiffAlias = true; vimdiffAlias = true;
};
}; };
};
} }

View file

@ -1,44 +1,44 @@
{ {
config, config,
pkgs, pkgs,
lib, lib,
osConfig, osConfig,
... ...
}: { }: {
options.myConfig.qtile.enable = lib.mkEnableOption ""; options.myConfig.qtile.enable = lib.mkEnableOption "";
config = lib.mkIf config.myConfig.qtile.enable { config = lib.mkIf config.myConfig.qtile.enable {
assertions = [ assertions = [
{ {
assertion = osConfig.services.xserver.windowManager.qtile.enable; assertion = osConfig.services.xserver.windowManager.qtile.enable;
message = "Qtile has to be enabled on the system level"; message = "Qtile has to be enabled on the system level";
} }
]; ];
home.file.".config/qtile/config.py".source = ./files/qtile.py; home.file.".config/qtile/config.py".source = ./files/qtile.py;
home.file.".background-image".source = ./files/background-image; home.file.".background-image".source = ./files/background-image;
home.packages = [ home.packages = [
# Widget dependencies # Widget dependencies
pkgs.python311Packages.iwlib pkgs.python311Packages.iwlib
pkgs.python311Packages.psutil pkgs.python311Packages.psutil
pkgs.lm_sensors pkgs.lm_sensors
# Hotkey dependencies # Hotkey dependencies
pkgs.playerctl pkgs.playerctl
pkgs.brightnessctl pkgs.brightnessctl
]; ];
programs.rofi = { programs.rofi = {
enable = true; enable = true;
theme = ./files/rofi-theme.rasi; theme = ./files/rofi-theme.rasi;
};
services.picom = {
enable = true;
vSync = true;
};
services.dunst.enable = true;
}; };
services.picom = {
enable = true;
vSync = true;
};
services.dunst.enable = true;
};
} }

View file

@ -1,70 +1,70 @@
{ {
config, config,
lib, lib,
... ...
}: let }: let
cfg = config.myConfig.shell; cfg = config.myConfig.shell;
in { in {
options.myConfig.shell = { options.myConfig.shell = {
bash.enable = lib.mkEnableOption ""; bash.enable = lib.mkEnableOption "";
zsh.enable = lib.mkEnableOption ""; zsh.enable = lib.mkEnableOption "";
starship.enable = lib.mkEnableOption ""; starship.enable = lib.mkEnableOption "";
nixAliases.enable = lib.mkEnableOption ""; nixAliases.enable = lib.mkEnableOption "";
improvedCommands.enable = lib.mkEnableOption ""; improvedCommands.enable = lib.mkEnableOption "";
direnv.enable = lib.mkEnableOption ""; direnv.enable = lib.mkEnableOption "";
}; };
config = { config = {
programs.bash.enable = cfg.bash.enable; programs.bash.enable = cfg.bash.enable;
programs.zsh.enable = cfg.zsh.enable; programs.zsh.enable = cfg.zsh.enable;
programs.starship = lib.mkIf cfg.starship.enable { programs.starship = lib.mkIf cfg.starship.enable {
enable = true; enable = true;
enableBashIntegration = cfg.bash.enable; enableBashIntegration = cfg.bash.enable;
enableZshIntegration = cfg.zsh.enable; enableZshIntegration = cfg.zsh.enable;
settings = { settings = {
cmd_duration.disabled = true; cmd_duration.disabled = true;
directory = { directory = {
truncation_length = 0; truncation_length = 0;
truncation_symbol = "/"; truncation_symbol = "/";
truncate_to_repo = false; truncate_to_repo = false;
};
};
};
home.shellAliases = let
nixAliases = lib.mkIf cfg.nixAliases.enable {
nrs = "sudo nixos-rebuild switch";
nrb = "sudo nixos-rebuild boot";
nrrb = "nrb && reboot";
nrt = "sudo nixos-rebuild test";
nu = "sudo nix flake update";
};
commandAliases = lib.mkIf cfg.improvedCommands.enable {
cat = "bat -p";
};
in
lib.mkMerge [nixAliases commandAliases];
programs.lsd = lib.mkIf cfg.improvedCommands.enable {
enable = true;
enableAliases = true;
};
programs.bat.enable = cfg.improvedCommands.enable;
programs.fzf.enable = cfg.improvedCommands.enable;
programs.zoxide = lib.mkIf cfg.improvedCommands.enable {
enable = true;
options = ["--cmd cd"];
};
programs.direnv = lib.mkIf cfg.direnv.enable {
enable = true;
nix-direnv.enable = true;
config.global.hide_env_diff = true;
}; };
};
}; };
home.shellAliases = let
nixAliases = lib.mkIf cfg.nixAliases.enable {
nrs = "sudo nixos-rebuild switch";
nrb = "sudo nixos-rebuild boot";
nrrb = "nrb && reboot";
nrt = "sudo nixos-rebuild test";
nu = "sudo nix flake update";
};
commandAliases = lib.mkIf cfg.improvedCommands.enable {
cat = "bat -p";
};
in
lib.mkMerge [nixAliases commandAliases];
programs.lsd = lib.mkIf cfg.improvedCommands.enable {
enable = true;
enableAliases = true;
};
programs.bat.enable = cfg.improvedCommands.enable;
programs.fzf.enable = cfg.improvedCommands.enable;
programs.zoxide = lib.mkIf cfg.improvedCommands.enable {
enable = true;
options = ["--cmd cd"];
};
programs.direnv = lib.mkIf cfg.direnv.enable {
enable = true;
nix-direnv.enable = true;
config.global.hide_env_diff = true;
};
};
} }

View file

@ -1,21 +1,21 @@
{ {
config, config,
lib, lib,
... ...
}: { }: {
options.myConfig.ssh-client.enable = lib.mkEnableOption ""; options.myConfig.ssh-client.enable = lib.mkEnableOption "";
config = lib.mkIf config.myConfig.ssh-client.enable { config = lib.mkIf config.myConfig.ssh-client.enable {
programs.ssh = { programs.ssh = {
enable = true; enable = true;
matchBlocks.kluebero-vm1 = { matchBlocks.kluebero-vm1 = {
hostname = "10.5.251.175"; hostname = "10.5.251.175";
user = "seb"; user = "seb";
identitiesOnly = true; identitiesOnly = true;
identityFile = ["~/.ssh/kluebero/id_ed25519"]; identityFile = ["~/.ssh/kluebero/id_ed25519"];
}; };
};
services.ssh-agent.enable = true;
}; };
services.ssh-agent.enable = true;
};
} }

View file

@ -1,45 +1,45 @@
{ {
config, config,
pkgs, pkgs,
lib, lib,
... ...
}: { }: {
options.myConfig.theming.enable = lib.mkEnableOption ""; options.myConfig.theming.enable = lib.mkEnableOption "";
config = lib.mkIf config.myConfig.theming.enable { config = lib.mkIf config.myConfig.theming.enable {
dconf.settings."org/gnome/desktop/interface".color-scheme = "prefer-dark"; dconf.settings."org/gnome/desktop/interface".color-scheme = "prefer-dark";
gtk = { gtk = {
enable = true; enable = true;
gtk2.configLocation = "${config.xdg.configHome}/gtk-2.0/gtkrc"; gtk2.configLocation = "${config.xdg.configHome}/gtk-2.0/gtkrc";
theme.name = "Adwaita-dark"; theme.name = "Adwaita-dark";
theme.package = pkgs.gnome.gnome-themes-extra; theme.package = pkgs.gnome.gnome-themes-extra;
iconTheme.name = "Adwaita"; iconTheme.name = "Adwaita";
iconTheme.package = pkgs.gnome.adwaita-icon-theme; iconTheme.package = pkgs.gnome.adwaita-icon-theme;
font.name = "Open Sans"; font.name = "Open Sans";
font.package = pkgs.open-sans; font.package = pkgs.open-sans;
};
qt = {
enable = true;
platformTheme = "gnome";
style.name = "adwaita-dark";
style.package = pkgs.adwaita-qt;
};
home.pointerCursor = {
name = "Bibata-Original-Classic";
package = pkgs.bibata-cursors;
size = 24;
x11.enable = true;
x11.defaultCursor = "X_cursor";
gtk.enable = true;
};
fonts.fontconfig.enable = true;
}; };
qt = {
enable = true;
platformTheme = "gnome";
style.name = "adwaita-dark";
style.package = pkgs.adwaita-qt;
};
home.pointerCursor = {
name = "Bibata-Original-Classic";
package = pkgs.bibata-cursors;
size = 24;
x11.enable = true;
x11.defaultCursor = "X_cursor";
gtk.enable = true;
};
fonts.fontconfig.enable = true;
};
} }

View file

@ -1,50 +1,63 @@
{ {
config, config,
pkgs, pkgs,
lib, lib,
... ...
}: { }: {
options.myConfig.vscode.enable = lib.mkEnableOption ""; options.myConfig.vscode.enable = lib.mkEnableOption "";
config = lib.mkIf config.myConfig.vscode.enable { config = lib.mkIf config.myConfig.vscode.enable {
home.packages = [pkgs.nil]; home.packages = let
alejandra4 = pkgs.alejandra.overrideAttrs {
passthru.tests.version = lib.mkForce {};
postPatch = ''
substituteInPlace src/alejandra/src/builder.rs \
--replace '2 * build_ctx.indentation' '4 * build_ctx.indentation'
substituteInPlace src/alejandra/src/rules/string.rs \
--replace 'format!(" {}", line)' 'format!(" {}", line)'
rm -r src/alejandra/tests
'';
};
in [
pkgs.nil
alejandra4
];
programs.vscode = { programs.vscode = {
enable = true; enable = true;
package = pkgs.vscodium; package = pkgs.vscodium;
mutableExtensionsDir = false; mutableExtensionsDir = false;
extensions = [ extensions = [
pkgs.vscode-extensions.jnoortheen.nix-ide pkgs.vscode-extensions.jnoortheen.nix-ide
pkgs.vscode-extensions.kamadorueda.alejandra pkgs.vscode-extensions.pkief.material-icon-theme
pkgs.vscode-extensions.pkief.material-icon-theme pkgs.vscode-extensions.mkhl.direnv
pkgs.vscode-extensions.mkhl.direnv ];
]; };
systemd.user.tmpfiles.rules = let
settings = builtins.replaceStrings ["\n"] ["\\n"] ''
{
"editor.fontFamily": "JetBrainsMono Nerd Font",
"explorer.confirmDelete": false,
"explorer.confirmDragAndDrop": false,
"extensions.autoCheckUpdates": false,
"files.autoSave": "afterDelay",
"git.autofetch": true,
"git.confirmSync": false,
"nix.enableLanguageServer": true,
"nix.serverPath": "nil",
"update.mode": "none",
"git.suggestSmartCommit": false,
"workbench.sideBar.location": "right",
"editor.renderWhitespace": "none",
"workbench.iconTheme": "material-icon-theme",
"editor.minimap.enabled": false
}
'';
in [
"f+ %h/.config/VSCodium/User/settings.json - - - - ${settings}"
"f+ %h/.config/VSCodium/User/settings-default.json - - - - ${settings}"
];
}; };
systemd.user.tmpfiles.rules = let
settings = builtins.replaceStrings ["\n"] ["\\n"] ''
{
"editor.fontFamily": "JetBrainsMono Nerd Font",
"explorer.confirmDelete": false,
"explorer.confirmDragAndDrop": false,
"extensions.autoCheckUpdates": false,
"files.autoSave": "afterDelay",
"git.autofetch": true,
"git.confirmSync": false,
"nix.enableLanguageServer": true,
"nix.serverPath": "nil",
"update.mode": "none",
"git.suggestSmartCommit": false,
"workbench.sideBar.location": "right",
"editor.renderWhitespace": "none",
"workbench.iconTheme": "material-icon-theme",
"editor.minimap.enabled": false
}
'';
in [
"f+ %h/.config/VSCodium/User/settings.json - - - - ${settings}"
"f+ %h/.config/VSCodium/User/settings-default.json - - - - ${settings}"
];
};
} }

View file

@ -1,25 +1,25 @@
{ {
config, config,
lib, lib,
... ...
}: { }: {
options.myConfig.auto-cpufreq.enable = lib.mkEnableOption ""; options.myConfig.auto-cpufreq.enable = lib.mkEnableOption "";
config = lib.mkIf config.myConfig.auto-cpufreq.enable { config = lib.mkIf config.myConfig.auto-cpufreq.enable {
services.auto-cpufreq = { services.auto-cpufreq = {
enable = true; enable = true;
settings = { settings = {
charger = { charger = {
governor = "powersave"; governor = "powersave";
turbo = "never"; turbo = "never";
energy_performance_preference = "power"; energy_performance_preference = "power";
};
battery = {
governor = "powersave";
turbo = "never";
energy_performance_preference = "power";
};
};
}; };
battery = {
governor = "powersave";
turbo = "never";
energy_performance_preference = "power";
};
};
}; };
};
} }

View file

@ -1,15 +1,15 @@
{ {
config, config,
lib, lib,
... ...
}: { }: {
options.myConfig.auto-gc.enable = lib.mkEnableOption ""; options.myConfig.auto-gc.enable = lib.mkEnableOption "";
config = lib.mkIf config.myConfig.auto-gc.enable { config = lib.mkIf config.myConfig.auto-gc.enable {
nix.gc = { nix.gc = {
automatic = true; automatic = true;
dates = "weekly"; dates = "weekly";
options = "--delete-older-than 7d"; options = "--delete-older-than 7d";
};
}; };
};
} }

View file

@ -1,16 +1,16 @@
{ {
config, config,
lib, lib,
... ...
}: { }: {
options.myConfig.bluetooth.enable = lib.mkEnableOption ""; options.myConfig.bluetooth.enable = lib.mkEnableOption "";
config = lib.mkIf config.myConfig.bluetooth.enable { config = lib.mkIf config.myConfig.bluetooth.enable {
hardware.bluetooth = { hardware.bluetooth = {
enable = true; enable = true;
powerOnBoot = true; powerOnBoot = true;
};
services.blueman.enable = true;
hardware.logitech.wireless.enable = true;
}; };
services.blueman.enable = true;
hardware.logitech.wireless.enable = true;
};
} }

View file

@ -1,20 +1,20 @@
{ {
config, config,
lib, lib,
... ...
}: { }: {
options.myConfig.boot-loader.systemd-boot.enable = lib.mkEnableOption ""; options.myConfig.boot-loader.systemd-boot.enable = lib.mkEnableOption "";
config = lib.mkIf config.myConfig.boot-loader.systemd-boot.enable { config = lib.mkIf config.myConfig.boot-loader.systemd-boot.enable {
boot.tmp.cleanOnBoot = true; boot.tmp.cleanOnBoot = true;
boot.loader = { boot.loader = {
systemd-boot = { systemd-boot = {
enable = true; enable = true;
editor = false; editor = false;
configurationLimit = 50; configurationLimit = 50;
}; };
efi.canTouchEfiVariables = true; efi.canTouchEfiVariables = true;
timeout = 3; timeout = 3;
};
}; };
};
} }

View file

@ -1,16 +1,16 @@
{ {
inputs, inputs,
config, config,
lib, lib,
... ...
}: { }: {
imports = [inputs.nix-index-database.nixosModules.nix-index]; imports = [inputs.nix-index-database.nixosModules.nix-index];
options.myConfig.comma.enable = lib.mkEnableOption ""; options.myConfig.comma.enable = lib.mkEnableOption "";
config = lib.mkIf config.myConfig.comma.enable { config = lib.mkIf config.myConfig.comma.enable {
programs.command-not-found.enable = false; programs.command-not-found.enable = false;
programs.nix-index.enable = true; programs.nix-index.enable = true;
programs.nix-index-database.comma.enable = true; programs.nix-index-database.comma.enable = true;
}; };
} }

View file

@ -1,18 +1,18 @@
{ {
config, config,
lib, lib,
... ...
}: { }: {
options.myConfig.de.qtile.enable = lib.mkEnableOption ""; options.myConfig.de.qtile.enable = lib.mkEnableOption "";
config = lib.mkIf config.myConfig.de.qtile.enable { config = lib.mkIf config.myConfig.de.qtile.enable {
services.xserver = { services.xserver = {
enable = true; enable = true;
windowManager.qtile.enable = true; windowManager.qtile.enable = true;
desktopManager.wallpaper.mode = "fill"; desktopManager.wallpaper.mode = "fill";
};
myConfig.x-input.enable = true;
}; };
myConfig.x-input.enable = true;
};
} }

View file

@ -1,19 +1,19 @@
{ {
imports = [ imports = [
./flatpak.nix ./flatpak.nix
./vm.nix ./vm.nix
./wlan.nix ./wlan.nix
./doas.nix ./doas.nix
./vpn.nix ./vpn.nix
./comma.nix ./comma.nix
./auto-gc.nix ./auto-gc.nix
./sops.nix ./sops.nix
./bluetooth.nix ./bluetooth.nix
./auto-cpufreq.nix ./auto-cpufreq.nix
./x-input.nix ./x-input.nix
./de.nix ./de.nix
./dm.nix ./dm.nix
./sound.nix ./sound.nix
./boot-loader.nix ./boot-loader.nix
]; ];
} }

View file

@ -1,20 +1,20 @@
{ {
config, config,
lib, lib,
... ...
}: { }: {
options.myConfig.dm.lightdm.enable = lib.mkEnableOption ""; options.myConfig.dm.lightdm.enable = lib.mkEnableOption "";
config = lib.mkIf config.myConfig.dm.lightdm.enable { config = lib.mkIf config.myConfig.dm.lightdm.enable {
services.xserver = { services.xserver = {
enable = true; enable = true;
displayManager.lightdm = { displayManager.lightdm = {
enable = true; enable = true;
greeters.slick.enable = true; greeters.slick.enable = true;
}; };
};
myConfig.x-input.enable = true;
}; };
myConfig.x-input.enable = true;
};
} }

View file

@ -1,25 +1,25 @@
{ {
config, config,
lib, lib,
... ...
}: { }: {
options.myConfig.doas.enable = lib.mkEnableOption ""; options.myConfig.doas.enable = lib.mkEnableOption "";
config = lib.mkIf config.myConfig.doas.enable { config = lib.mkIf config.myConfig.doas.enable {
security.sudo.enable = false; security.sudo.enable = false;
security.doas = { security.doas = {
enable = true; enable = true;
extraRules = [ extraRules = [
{ {
groups = ["wheel"]; groups = ["wheel"];
keepEnv = true; keepEnv = true;
persist = true; persist = true;
} }
]; ];
};
environment.shellAliases.sudo = "doas";
programs.bash.interactiveShellInit = lib.mkIf config.myConfig.shell.bash.enable "complete -F _command doas";
}; };
environment.shellAliases.sudo = "doas";
programs.bash.interactiveShellInit = lib.mkIf config.myConfig.shell.bash.enable "complete -F _command doas";
};
} }

View file

@ -1,30 +1,30 @@
{ {
config, config,
pkgs, pkgs,
lib, lib,
... ...
}: { }: {
options.myConfig.flatpak.enable = lib.mkEnableOption ""; options.myConfig.flatpak.enable = lib.mkEnableOption "";
config = lib.mkIf config.myConfig.flatpak.enable { config = lib.mkIf config.myConfig.flatpak.enable {
services.flatpak.enable = true; services.flatpak.enable = true;
xdg.portal = { xdg.portal = {
enable = true; enable = true;
extraPortals = [pkgs.xdg-desktop-portal-gtk]; extraPortals = [pkgs.xdg-desktop-portal-gtk];
config.common.default = "*"; config.common.default = "*";
};
home-manager.sharedModules = [
{
xdg = {
enable = true;
systemDirs.data = [
"/var/lib/flatpak/exports/share"
"/home/seb/.local/share/flatpak/exports/share"
];
}; };
}
]; home-manager.sharedModules = [
}; {
xdg = {
enable = true;
systemDirs.data = [
"/var/lib/flatpak/exports/share"
"/home/seb/.local/share/flatpak/exports/share"
];
};
}
];
};
} }

View file

@ -1,17 +1,17 @@
{ {
inputs, inputs,
config, config,
lib, lib,
... ...
}: { }: {
imports = [inputs.sops-nix.nixosModules.sops]; imports = [inputs.sops-nix.nixosModules.sops];
options.myConfig.sops.enable = lib.mkEnableOption ""; options.myConfig.sops.enable = lib.mkEnableOption "";
config = lib.mkIf config.myConfig.sops.enable { config = lib.mkIf config.myConfig.sops.enable {
sops = { sops = {
age.sshKeyPaths = ["/etc/ssh/ssh_host_ed25519_key"]; age.sshKeyPaths = ["/etc/ssh/ssh_host_ed25519_key"];
defaultSopsFile = ../../hosts/dell-laptop/secrets.yaml; defaultSopsFile = ../../hosts/dell-laptop/secrets.yaml;
};
}; };
};
} }

View file

@ -1,19 +1,19 @@
{ {
config, config,
lib, lib,
... ...
}: { }: {
options.myConfig.sound.pipewire.enable = lib.mkEnableOption ""; options.myConfig.sound.pipewire.enable = lib.mkEnableOption "";
config = lib.mkIf config.myConfig.sound.pipewire.enable { config = lib.mkIf config.myConfig.sound.pipewire.enable {
security.rtkit.enable = true; security.rtkit.enable = true;
hardware.pulseaudio.enable = false; hardware.pulseaudio.enable = false;
services.pipewire = { services.pipewire = {
enable = true; enable = true;
wireplumber.enable = true; wireplumber.enable = true;
alsa.enable = true; alsa.enable = true;
alsa.support32Bit = true; alsa.support32Bit = true;
pulse.enable = true; pulse.enable = true;
};
}; };
};
} }

View file

@ -1,28 +1,28 @@
{ {
config, config,
pkgs, pkgs,
lib, lib,
... ...
}: { }: {
options.myConfig.vm.qemu.enable = lib.mkEnableOption ""; options.myConfig.vm.qemu.enable = lib.mkEnableOption "";
config = lib.mkIf config.myConfig.vm.qemu.enable { config = lib.mkIf config.myConfig.vm.qemu.enable {
virtualisation.libvirtd.enable = true; virtualisation.libvirtd.enable = true;
programs.virt-manager.enable = true; programs.virt-manager.enable = true;
environment.systemPackages = [ environment.systemPackages = [
pkgs.quickemu pkgs.quickemu
pkgs.quickgui pkgs.quickgui
]; ];
home-manager.sharedModules = [ home-manager.sharedModules = [
{ {
dconf.settings."org/virt-manager/virt-manager/connections" = { dconf.settings."org/virt-manager/virt-manager/connections" = {
autoconnect = ["qemu:///system"]; autoconnect = ["qemu:///system"];
uris = ["qemu:///system"]; uris = ["qemu:///system"];
}; };
} }
]; ];
}; };
} }

View file

@ -1,37 +1,37 @@
{ {
config, config,
lib, lib,
... ...
}: { }: {
options.myConfig.vpn.lgs.enable = lib.mkEnableOption ""; options.myConfig.vpn.lgs.enable = lib.mkEnableOption "";
config = lib.mkIf config.myConfig.vpn.lgs.enable { config = lib.mkIf config.myConfig.vpn.lgs.enable {
sops.secrets = { sops.secrets = {
"vpn/lgs/crt" = {}; "vpn/lgs/crt" = {};
"vpn/lgs/key" = {}; "vpn/lgs/key" = {};
};
services.openvpn.servers.lgs = {
autoStart = false;
config = ''
dev tap
persist-tun
persist-key
data-ciphers AES-128-GCM:AES-256-CBC
data-ciphers-fallback AES-256-CBC
auth SHA1
tls-client
client
resolv-retry infinite
remote 194.9.190.11 1194 udp4
nobind
auth-user-pass
ca ${config.sops.secrets."vpn/lgs/crt".path}
tls-auth ${config.sops.secrets."vpn/lgs/key".path} 1
remote-cert-tls server
explicit-exit-notify
'';
};
}; };
services.openvpn.servers.lgs = {
autoStart = false;
config = ''
dev tap
persist-tun
persist-key
data-ciphers AES-128-GCM:AES-256-CBC
data-ciphers-fallback AES-256-CBC
auth SHA1
tls-client
client
resolv-retry infinite
remote 194.9.190.11 1194 udp4
nobind
auth-user-pass
ca ${config.sops.secrets."vpn/lgs/crt".path}
tls-auth ${config.sops.secrets."vpn/lgs/key".path} 1
remote-cert-tls server
explicit-exit-notify
'';
};
};
} }

View file

@ -1,96 +1,96 @@
{ {
config, config,
lib, lib,
... ...
}: { }: {
options.myConfig.wlan.enable = lib.mkEnableOption ""; options.myConfig.wlan.enable = lib.mkEnableOption "";
config = lib.mkIf config.myConfig.wlan.enable { config = lib.mkIf config.myConfig.wlan.enable {
sops.secrets."wlan.env" = {}; sops.secrets."wlan.env" = {};
networking.networkmanager = { networking.networkmanager = {
enable = true; enable = true;
ensureProfiles = { ensureProfiles = {
environmentFiles = [config.sops.secrets."wlan.env".path]; environmentFiles = [config.sops.secrets."wlan.env".path];
profiles = { profiles = {
home = { home = {
connection = { connection = {
id = "home"; id = "home";
uuid = "24b856a6-27eb-4c4f-b85c-f59ab0824965"; uuid = "24b856a6-27eb-4c4f-b85c-f59ab0824965";
type = "wifi"; type = "wifi";
interface-name = "wlp2s0"; interface-name = "wlp2s0";
}; };
wifi = { wifi = {
mode = "infrastructure"; mode = "infrastructure";
ssid = "$HOME_SSID"; ssid = "$HOME_SSID";
}; };
wifi-security = { wifi-security = {
auth-alg = "open"; auth-alg = "open";
key-mgmt = "wpa-psk"; key-mgmt = "wpa-psk";
psk = "$HOME_PSK"; psk = "$HOME_PSK";
}; };
ipv4 = {method = "auto";}; ipv4 = {method = "auto";};
ipv6 = { ipv6 = {
addr-gen-mode = "default"; addr-gen-mode = "default";
method = "auto"; method = "auto";
}; };
}; };
mobile = { mobile = {
connection = { connection = {
id = "mobile"; id = "mobile";
uuid = "e3a749cf-a103-4e1e-a50c-4a4898bafcf6"; uuid = "e3a749cf-a103-4e1e-a50c-4a4898bafcf6";
type = "wifi"; type = "wifi";
interface-name = "wlp2s0"; interface-name = "wlp2s0";
}; };
wifi = { wifi = {
mode = "infrastructure"; mode = "infrastructure";
ssid = "$MOBILE_SSID"; ssid = "$MOBILE_SSID";
}; };
wifi-security = { wifi-security = {
auth-alg = "open"; auth-alg = "open";
key-mgmt = "wpa-psk"; key-mgmt = "wpa-psk";
psk = "$MOBILE_PSK"; psk = "$MOBILE_PSK";
}; };
ipv4 = {method = "auto";}; ipv4 = {method = "auto";};
ipv6 = { ipv6 = {
addr-gen-mode = "default"; addr-gen-mode = "default";
method = "auto"; method = "auto";
}; };
}; };
school = { school = {
connection = { connection = {
id = "school"; id = "school";
uuid = "bfdf4e7f-d2c4-4ab6-b833-37ecd5199b22"; uuid = "bfdf4e7f-d2c4-4ab6-b833-37ecd5199b22";
type = "wifi"; type = "wifi";
interface-name = "wlp2s0"; interface-name = "wlp2s0";
};
wifi = {
mode = "infrastructure";
ssid = "$SCHOOL_SSID";
};
wifi-security = {
auth-alg = "open";
key-mgmt = "wpa-eap";
};
"802-1x" = {
domain-suffix-match = "lgs-hu.eu";
eap = "ttls;";
identity = "$SCHOOL_ID";
password = "$SCHOOL_PSK";
phase2-auth = "pap";
};
ipv4 = {method = "auto";};
ipv6 = {
addr-gen-mode = "default";
method = "auto";
};
};
};
}; };
wifi = {
mode = "infrastructure";
ssid = "$SCHOOL_SSID";
};
wifi-security = {
auth-alg = "open";
key-mgmt = "wpa-eap";
};
"802-1x" = {
domain-suffix-match = "lgs-hu.eu";
eap = "ttls;";
identity = "$SCHOOL_ID";
password = "$SCHOOL_PSK";
phase2-auth = "pap";
};
ipv4 = {method = "auto";};
ipv6 = {
addr-gen-mode = "default";
method = "auto";
};
};
}; };
};
}; };
};
} }

View file

@ -1,29 +1,29 @@
{ {
config, config,
lib, lib,
... ...
}: { }: {
options.myConfig.x-input.enable = lib.mkEnableOption ""; options.myConfig.x-input.enable = lib.mkEnableOption "";
config = lib.mkIf config.myConfig.x-input.enable { config = lib.mkIf config.myConfig.x-input.enable {
services.xserver = { services.xserver = {
enable = true; enable = true;
xkb = { xkb = {
layout = "de"; layout = "de";
variant = "nodeadkeys"; variant = "nodeadkeys";
}; };
libinput = { libinput = {
enable = true; enable = true;
touchpad = { touchpad = {
accelProfile = "adaptive"; accelProfile = "adaptive";
naturalScrolling = true; naturalScrolling = true;
disableWhileTyping = true; disableWhileTyping = true;
};
mouse.accelProfile = "flat";
};
}; };
mouse.accelProfile = "flat";
};
}; };
};
} }

View file

@ -1,26 +1,26 @@
{inputs, ...}: { {inputs, ...}: {
imports = [inputs.home-manager.nixosModules.home-manager]; imports = [inputs.home-manager.nixosModules.home-manager];
users.mutableUsers = false; users.mutableUsers = false;
home-manager.useGlobalPkgs = true; home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true; home-manager.useUserPackages = true;
home-manager.sharedModules = [ home-manager.sharedModules = [
../modules/home ../modules/home
{ {
programs.home-manager.enable = true; programs.home-manager.enable = true;
home.stateVersion = "23.11"; home.stateVersion = "23.11";
systemd.user.startServices = "sd-switch"; systemd.user.startServices = "sd-switch";
xdg = { xdg = {
enable = true; enable = true;
userDirs = { userDirs = {
enable = true; enable = true;
createDirectories = true; createDirectories = true;
}; };
}; };
} }
]; ];
} }

View file

@ -1,14 +1,14 @@
{config, ...}: { {config, ...}: {
imports = [../default.nix]; imports = [../default.nix];
sops.secrets."password/seb".neededForUsers = true; sops.secrets."password/seb".neededForUsers = true;
users.users.seb = { users.users.seb = {
isNormalUser = true; isNormalUser = true;
description = "Sebastian Stork"; description = "Sebastian Stork";
hashedPasswordFile = config.sops.secrets."password/seb".path; hashedPasswordFile = config.sops.secrets."password/seb".path;
extraGroups = ["wheel" "networkmanager" "libvirtd"]; extraGroups = ["wheel" "networkmanager" "libvirtd"];
}; };
home-manager.users.seb = import ./home.nix; home-manager.users.seb = import ./home.nix;
} }

View file

@ -1,56 +1,56 @@
{pkgs, ...}: { {pkgs, ...}: {
myConfig = { myConfig = {
qtile.enable = true; qtile.enable = true;
vscode.enable = true; vscode.enable = true;
shell = { shell = {
bash.enable = true; bash.enable = true;
starship.enable = true; starship.enable = true;
nixAliases.enable = true; nixAliases.enable = true;
improvedCommands.enable = true; improvedCommands.enable = true;
direnv.enable = true; direnv.enable = true;
};
theming.enable = true;
ssh-client.enable = true;
git.enable = true;
neovim.enable = true;
kitty.enable = true;
}; };
theming.enable = true;
ssh-client.enable = true;
git.enable = true;
neovim.enable = true;
kitty.enable = true;
};
services.clipmenu = { services.clipmenu = {
enable = true; enable = true;
launcher = "rofi"; launcher = "rofi";
}; };
programs.btop.enable = true; programs.btop.enable = true;
home.packages = with pkgs; [ home.packages = with pkgs; [
# CLI # CLI
fastfetch fastfetch
# GUI # GUI
notepadqq notepadqq
brave brave
spotify spotify
cinnamon.nemo-with-extensions cinnamon.nemo-with-extensions
discord discord
flameshot flameshot
jetbrains.idea-community jetbrains.idea-community
vlc vlc
obs-studio obs-studio
libsForQt5.kdenlive libsForQt5.kdenlive
gimp gimp
libreoffice libreoffice
hunspell hunspell
hunspellDicts.de_DE hunspellDicts.de_DE
hunspellDicts.en_US hunspellDicts.en_US
steam steam
networkmanagerapplet networkmanagerapplet
# Fonts # Fonts
(nerdfonts.override {fonts = ["JetBrainsMono"];}) (nerdfonts.override {fonts = ["JetBrainsMono"];})
corefonts corefonts
roboto roboto
open-sans open-sans
ubuntu_font_family ubuntu_font_family
]; ];
} }