diff --git a/common.nix b/common.nix deleted file mode 100644 index f954f14..0000000 --- a/common.nix +++ /dev/null @@ -1,143 +0,0 @@ -{ - config, - pkgs, - modulesPath, - ... -}: { - imports = [ - # enable home manager - - (modulesPath + "/installer/scan/not-detected.nix") - ]; - - nixpkgs.config = { - allowUnfree = true; - permittedInsecurePackages = [ - "electron-12.2.3" - ]; - }; - - boot.loader = { - systemd-boot.enable = true; - efi.canTouchEfiVariables = true; - }; - - networking = { - # wireless.enable = true; # Enables wireless support via wpa_supplicant. - # wireless.userControlled.enable = true; - - # Enable networking - networkmanager.enable = true; - - firewall = { - enable = true; - allowedTCPPortRanges = [ - { - # KDE Connect - from = 1714; - to = 1764; - } - ]; - allowedUDPPortRanges = [ - { - # KDE Connect - from = 1714; - to = 1764; - } - ]; - }; - }; - - time.timeZone = "Europe/Berlin"; - i18n = { - defaultLocale = "en_US.UTF-8"; - extraLocaleSettings = { - LC_ADDRESS = "de_DE.UTF-8"; - LC_IDENTIFICATION = "de_DE.UTF-8"; - LC_MEASUREMENT = "de_DE.UTF-8"; - LC_MONETARY = "de_DE.UTF-8"; - LC_NAME = "de_DE.UTF-8"; - LC_NUMERIC = "de_DE.UTF-8"; - LC_PAPER = "de_DE.UTF-8"; - LC_TELEPHONE = "de_DE.UTF-8"; - LC_TIME = "de_DE.UTF-8"; - }; - }; - - services = { - xserver = { - # Enable the X11 windowing system / wayland depending on DE - enable = true; - - # Configure keymap in X11 - layout = "de"; - xkbVariant = ""; - }; - - # Enable CUPS to print documents. - printing.enable = true; - - # Enable the OpenSSH daemon. - openssh = { - enable = true; - settings = { - PermitRootLogin = "no"; - PasswordAuthentication = false; - KbdInteractiveAuthentication = false; - }; - }; - }; - - systemd.extraConfig = '' - DefaultTimeoutStopSec=7s - ''; - - # Configure console keymap - console.keyMap = "de"; - - # Enable sound with pipewire. - sound.enable = true; - hardware.pulseaudio.enable = false; - security.rtkit.enable = true; - services.pipewire = { - enable = true; - alsa.enable = true; - alsa.support32Bit = true; - pulse.enable = true; - }; - - system = { - stateVersion = "22.11"; - autoUpgrade.enable = true; # enable auto updates - }; - - nix.gc = { - automatic = true; - dates = "00:30"; - }; - - programs = { - git = { - enable = true; - package = pkgs.gitFull; - }; - - steam = { - enable = true; - remotePlay.openFirewall = true; # Open ports in the firewall for Steam Remote Play - dedicatedServer.openFirewall = true; # Open ports in the firewall for Source Dedicated Server - }; - - zsh.enable = true; - }; - - environment = { - pathsToLink = ["/share/zsh"]; - - systemPackages = with pkgs; [ - lm_sensors - tldr - ncdu - ]; - }; -} diff --git a/gnome.nix b/gnome.nix deleted file mode 100644 index bc6aa4d..0000000 --- a/gnome.nix +++ /dev/null @@ -1,49 +0,0 @@ -{ - config, - pkgs, - ... -}: { - services = { - xserver = { - # Enable the GNOME Desktop Environment. - displayManager.gdm.enable = true; - desktopManager.gnome.enable = true; - }; - - gnome = { - tracker-miners.enable = false; - tracker.enable = false; - }; - }; - - environment.systemPackages = [pkgs.gnomeExtensions.gsconnect]; - - # remove some gnome default apps - environment.gnome.excludePackages = with pkgs.gnome; [ - cheese # photo booth - epiphany # web browser - evince # document viewer - geary # email client - seahorse # password manager - gnome-clocks - gnome-maps - gnome-weather - gnome-music - pkgs.gnome-connections - ]; - - home-manager.users = { - vinzenz = {pkgs, ...}: { - home.packages = with pkgs; [ - gnome.gpaste - amberol - ]; - - dconf.settings = { - "org/gnome/desktop/peripherals/keyboard" = { - numlock-state = true; - }; - }; - }; - }; -} diff --git a/hardware/default.nix b/hardware/default.nix new file mode 100644 index 0000000..3a06ecb --- /dev/null +++ b/hardware/default.nix @@ -0,0 +1,31 @@ +hostName: { + modulesPath, + lib, + ... +}: { + imports = [ + (modulesPath + "/installer/scan/not-detected.nix") + (builtins.toString ./. + "/${hostName}.nix") + ]; + + config = { + networking.hostName = hostName; + + boot.loader = { + systemd-boot.enable = true; + efi.canTouchEfiVariables = true; + }; + + # Enables DHCP on each ethernet and wireless interface. In case of scripted networking + # (the default) this is the recommended approach. When using systemd-networkd it's + # still possible to use this option, but it's recommended to use it in conjunction + # with explicit per-interface declarations with `networking.interfaces..useDHCP`. + networking.useDHCP = lib.mkDefault true; + # networking.interfaces.eno1.useDHCP = lib.mkDefault true; + # networking.interfaces.wlp5s0.useDHCP = lib.mkDefault true; + + hardware.enableRedistributableFirmware = true; + + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; + }; +} diff --git a/hardware/vinzenz-lpt.nix b/hardware/vinzenz-lpt.nix new file mode 100644 index 0000000..cf01a43 --- /dev/null +++ b/hardware/vinzenz-lpt.nix @@ -0,0 +1,30 @@ +{...}: { + config = { + boot = { + initrd.availableKernelModules = ["xhci_pci" "ehci_pci" "ahci" "usbhid" "usb_storage" "sd_mod" "sdhci_pci"]; + initrd.kernelModules = []; + kernelModules = ["kvm-intel"]; + extraModulePackages = []; + loader.efi.efiSysMountPoint = "/boot/efi"; + }; + + fileSystems = { + "/" = { + device = "/dev/disk/by-uuid/34cb86c4-8823-4785-9672-92ef0bcd5eaf"; + fsType = "btrfs"; + options = ["subvol=@"]; + }; + + "/boot/efi" = { + device = "/dev/disk/by-uuid/2381-1CD2"; + fsType = "vfat"; + }; + }; + + swapDevices = [ + {device = "/dev/disk/by-uuid/f5932f70-60e4-4abe-b23d-2cab3c095c7d";} + ]; + + hardware.cpu.intel.updateMicrocode = true; + }; +} diff --git a/hardware/vinzenz-pc2.nix b/hardware/vinzenz-pc2.nix new file mode 100644 index 0000000..8e27145 --- /dev/null +++ b/hardware/vinzenz-pc2.nix @@ -0,0 +1,53 @@ +{...}: { + config = { + boot = { + initrd.availableKernelModules = ["nvme" "xhci_pci" "ahci" "usbhid" "sd_mod"]; # "usb_storage" + initrd.kernelModules = []; + kernelModules = ["kvm-amd"]; + extraModulePackages = []; + loader.efi.efiSysMountPoint = "/boot"; + }; + + fileSystems = { + "/" = { + device = "/dev/disk/by-uuid/0e9c983a-e733-447e-8181-f41d6670c4b8"; + fsType = "btrfs"; + options = ["subvol=@"]; + }; + + "/home" = { + device = "/dev/disk/by-uuid/0e9c983a-e733-447e-8181-f41d6670c4b8"; + fsType = "btrfs"; + options = ["subvol=@home"]; + }; + + "/games" = { + device = "/dev/disk/by-uuid/0e9c983a-e733-447e-8181-f41d6670c4b8"; + fsType = "btrfs"; + options = ["subvol=@games"]; + }; + + "/boot" = { + device = "/dev/disk/by-uuid/AF67-8F16"; + fsType = "vfat"; + }; + + "/mnt/nixos_btrfs_root" = { + # subvolume with id 5 is always the root volume + # this is convenient for managing the flat subvolume hierarchy + device = "/dev/disk/by-uuid/0e9c983a-e733-447e-8181-f41d6670c4b8"; + fsType = "btrfs"; + options = ["subvolid=5"]; + }; + + "/mnt/ssd2" = { + device = "/dev/disk/by-uuid/6b2a647d-c68e-4c07-85bf-c9bfc5db7e8a"; + fsType = "ext4"; + }; + }; + + swapDevices = []; + + hardware.cpu.amd.updateMicrocode = true; + }; +} diff --git a/home-ronja.nix b/home-ronja.nix deleted file mode 100644 index 7bb3e87..0000000 --- a/home-ronja.nix +++ /dev/null @@ -1,119 +0,0 @@ -{ - config, - pkgs, - ... -}: { - # Define user account - users.users.ronja = { - isNormalUser = true; - description = "Ronja Spiegelberg"; - extraGroups = ["networkmanager" "wheel"]; - shell = pkgs.zsh; - }; - - # home manager - home-manager.useUserPackages = true; - home-manager.useGlobalPkgs = true; - home-manager.users.ronja = { - config, - pkgs, - ... - }: { - home = { - username = "ronja"; - homeDirectory = "/home/ronja"; - stateVersion = "22.11"; - - sessionVariables = { - EDITOR = "nano"; - }; - - packages = with pkgs; [ - ## Apps - steam - telegram-desktop - powerline - powerline-fonts - lutris - kdiff3 - wineWowPackages.stagingFull - wineWowPackages.fonts - winetricks - - (lutris.override { - extraPkgs = pkgs: [ - # List package dependencies here - ]; - extraLibraries = pkgs: [ - # List library dependencies here - ]; - }) - ]; - - file.".nanorc".text = '' - set linenumbers - set mouse - ''; - }; - - programs = { - home-manager.enable = true; - - firefox.enable = true; - command-not-found.enable = true; - dircolors.enable = true; - htop.enable = true; - - zsh = { - enable = true; - - enableSyntaxHighlighting = true; - enableAutosuggestions = true; - enableVteIntegration = true; - - history = { - size = 10000; - path = "${config.xdg.dataHome}/zsh/history"; - expireDuplicatesFirst = true; - }; - - oh-my-zsh = { - enable = true; - theme = "agnoster"; - plugins = ["git" "sudo" "systemadmin"]; - }; - }; - - git = { - enable = true; - userName = "Ronja Spiegelberg"; - userEmail = "ronja.spiegelberg@gmail.com"; - - extraConfig = { - pull.ff = "only"; - init.defaultBranch = "main"; - merge.tool = "kdiff3"; - }; - }; - - gh = { - enable = true; - enableGitCredentialHelper = true; - }; - - chromium = { - enable = true; - extensions = [ - { - # ublock origin - id = "cjpalhdlnbpafiamejdnhcphjbkeiagm"; - } - { - id = "dcpihecpambacapedldabdbpakmachpb"; - updateUrl = "https://raw.githubusercontent.com/iamadamdev/bypass-paywalls-chrome/master/updates.xml"; - } - ]; - }; - }; - }; -} diff --git a/home-vinzenz.nix b/home-vinzenz.nix deleted file mode 100644 index 41640a1..0000000 --- a/home-vinzenz.nix +++ /dev/null @@ -1,233 +0,0 @@ -{ - config, - pkgs, - ... -}: { - # Define user account - users.users.vinzenz = { - isNormalUser = true; - description = "Vinzenz Schroeter"; - extraGroups = ["networkmanager" "wheel"]; - shell = pkgs.zsh; - }; - - # home manager - home-manager.useUserPackages = true; - home-manager.useGlobalPkgs = true; - home-manager.users.vinzenz = { - config, - pkgs, - ... - }: { - home = { - username = "vinzenz"; - homeDirectory = "/home/vinzenz"; - stateVersion = "22.11"; - - sessionVariables = { - EDITOR = "nano"; - }; - - packages = with pkgs; [ - keepassxc - steam - insync - telegram-desktop - simple-scan - wireguard-tools - element-desktop - etcher - iotop - radeontop - lsof - wirelesstools - powerline - powerline-fonts - thefuck - dotnet-sdk_7 - jetbrains.rider - alejandra - arduino - uucp - screen - jetbrains.pycharm-professional - kdiff3 - docker - wineWowPackages.stagingFull - wineWowPackages.fonts - winetricks - - (lutris.override { - extraPkgs = pkgs: [ - # List package dependencies here - ]; - extraLibraries = pkgs: [ - # List library dependencies here - ]; - }) - ]; - - file.".nanorc".text = '' - set linenumbers - set mouse - ''; - }; - - services = { - kdeconnect = { - enable = true; - indicator = true; - }; - }; - - programs = { - home-manager.enable = true; - - firefox.enable = true; - command-not-found.enable = true; - dircolors.enable = true; - fzf.enable = true; - htop.enable = true; - - zsh = { - enable = true; - - enableSyntaxHighlighting = true; - enableAutosuggestions = true; - enableVteIntegration = true; - - initExtra = '' - eval "$(direnv hook zsh)"; - eval $(thefuck --alias); - ''; - - shellAliases = { - my-apply = "sudo nixos-rebuild boot"; - my-switch = "sudo nixos-rebuild switch"; - my-update = "sudo nixos-rebuild boot --upgrade"; - my-fmt = "alejandra ."; - }; - - history = { - size = 10000; - path = "${config.xdg.dataHome}/zsh/history"; - expireDuplicatesFirst = true; - }; - - oh-my-zsh = { - enable = true; - theme = "agnoster"; - plugins = ["git" "sudo" "docker" "systemadmin" "thefuck"]; - }; - }; - - git = { - enable = true; - userName = "Vinzenz Schroeter"; - userEmail = "vinzenz.f.s@gmail.com"; - - #package = pkgs.gitFull; - #config.credential.helper = "libsecret"; - - aliases = { - prettylog = "log --pretty=oneline --graph"; - }; - extraConfig = { - pull.ff = "only"; - init.defaultBranch = "main"; - merge.tool = "kdiff3"; - }; - }; - - gh = { - enable = true; - enableGitCredentialHelper = true; - }; - - vscode = { - enable = true; - package = pkgs.vscodium; - enableUpdateCheck = false; - extensions = with pkgs; [ - vscode-extensions.bbenoist.nix - vscode-extensions.ms-python.python - vscode-extensions.kamadorueda.alejandra - ]; - userSettings = { - "git.autofetch" = true; - "update.mode" = "none"; - "editor.fontFamily" = "'Fira Code', 'Droid Sans Mono', 'monospace', monospace"; - "editor.fontLigatures" = true; - "editor.formatOnSave" = true; - "editor.formatOnSaveMode" = "modificationsIfAvailable"; - "editor.minimap.autohide" = true; - "diffEditor.diffAlgorithm" = "advanced"; - "explorer.excludeGitIgnore" = true; - "workbench.startupEditor" = "readme"; - "markdown.extension.tableFormatter.normalizeIndentation" = true; - "markdown.extension.toc.orderedList" = false; - "telemetry.telemetryLevel" = "off"; - "redhat.telemetry.enabled" = false; - "workbench.enableExperiments" = false; - }; - }; - - direnv = { - enable = true; - nix-direnv.enable = true; - }; - - chromium = { - enable = true; - extensions = [ - { - # ublock origin - id = "cjpalhdlnbpafiamejdnhcphjbkeiagm"; - } - { - id = "dcpihecpambacapedldabdbpakmachpb"; - updateUrl = "https://raw.githubusercontent.com/iamadamdev/bypass-paywalls-chrome/master/updates.xml"; - } - ]; - }; - - bottom = { - enable = true; - settings = { - # https://github.com/ClementTsang/bottom/blob/master/sample_configs/default_config.toml - }; - }; - - exa = { - enable = true; - git = true; - icons = true; - enableAliases = true; - extraOptions = [ - "--group-directories-first" - "--header" - ]; - }; - - # checked https://rycee.gitlab.io/home-manager/options.html until "programs.jq" - }; - - editorconfig = { - enable = true; - settings = { - "*" = { - charset = "utf-8"; - end_of_line = "lf"; - trim_trailing_whitespace = true; - insert_final_newline = true; - max_line_width = 120; - indent_style = "space"; - indent_size = 4; - }; - "*.nix" = { - indent_size = 2; - }; - }; - }; - }; -} diff --git a/kde.nix b/kde.nix deleted file mode 100644 index bebf59e..0000000 --- a/kde.nix +++ /dev/null @@ -1,50 +0,0 @@ -{ - config, - pkgs, - ... -}: { - services = { - # Enable the KDE Plasma Desktop Environment. - xserver = { - desktopManager.plasma5.enable = true; - - displayManager = { - sddm.enable = true; - defaultSession = "plasmawayland"; - }; - }; - }; - - environment.systemPackages = with pkgs; [ - libsForQt5.kate - libsForQt5.kalk - ]; - - environment.plasma5.excludePackages = with pkgs.libsForQt5; [ - elisa - gwenview - okular - khelpcenter - ]; - - programs = { - dconf.enable = true; - partition-manager.enable = true; - }; - - home-manager.users.vinzenz = { - config, - pkgs, - ... - }: { - home = { - packages = with pkgs; [ - ]; - }; - - services.kdeconnect = { - enable = true; - indicator = true; - }; - }; -} diff --git a/modules/default.nix b/modules/default.nix new file mode 100644 index 0000000..71d87d1 --- /dev/null +++ b/modules/default.nix @@ -0,0 +1,54 @@ +{ + config, + pkgs, + ... +}: let + cfg = config.my; +in { + imports = [ + ./home + ./desktop + ./i18n.nix + ./nixpkgs.nix + ]; + + config = { + networking = { + networkmanager.enable = true; + firewall.enable = true; + }; + + # Enable the OpenSSH daemon. + services.openssh = { + enable = true; + settings = { + PermitRootLogin = "no"; + PasswordAuthentication = false; + KbdInteractiveAuthentication = false; + }; + }; + + systemd.extraConfig = '' + DefaultTimeoutStopSec=12s + ''; + + programs = { + zsh.enable = true; + + git = { + enable = true; + package = pkgs.gitFull; + }; + }; + + environment = { + pathsToLink = ["/share/zsh"]; + + systemPackages = with pkgs; [ + lm_sensors + tldr + ncdu + ]; + }; + }; +} diff --git a/modules/desktop/default.nix b/modules/desktop/default.nix new file mode 100644 index 0000000..771dff8 --- /dev/null +++ b/modules/desktop/default.nix @@ -0,0 +1,64 @@ +{ + config, + pkgs, + lib, + ... +}: let + cfg = config.my.desktop; +in { + imports = [ + ./gnome.nix + ./kde.nix + ]; + + options.my.desktop = { + enable = lib.mkEnableOption "desktop"; + }; + + config = lib.mkIf cfg.enable { + services = { + # Enable the X11 windowing system / wayland depending on DE + xserver.enable = true; + + # Enable CUPS to print documents. + printing.enable = true; + }; + + # Enable sound with pipewire. + sound.enable = true; + hardware.pulseaudio.enable = false; + security.rtkit.enable = true; + services.pipewire = { + enable = true; + alsa.enable = true; + alsa.support32Bit = true; + pulse.enable = true; + }; + + programs = { + steam = { + enable = true; + remotePlay.openFirewall = true; # Open ports in the firewall for Steam Remote Play + dedicatedServer.openFirewall = true; # Open ports in the firewall for Source Dedicated Server + }; + }; + + # unblock kde connect / gsconnect + networking.firewall = { + allowedTCPPortRanges = [ + { + # KDE Connect + from = 1714; + to = 1764; + } + ]; + allowedUDPPortRanges = [ + { + # KDE Connect + from = 1714; + to = 1764; + } + ]; + }; + }; +} diff --git a/modules/desktop/gnome.nix b/modules/desktop/gnome.nix new file mode 100644 index 0000000..f440fa2 --- /dev/null +++ b/modules/desktop/gnome.nix @@ -0,0 +1,63 @@ +{ + config, + pkgs, + lib, + ... +}: let + cfg = config.my.gnome; + + #applyGnomeUserSettings = { + # home.packages = with pkgs; [ + # gnome.gpaste + # amberol + # ]; + +# dconf.settings = { + # "org/gnome/desktop/peripherals/keyboard" = { + # numlock-state = true; + # }; + # }; + #}; +in { + options.my.gnome = { + enable = lib.mkEnableOption "gnome desktop"; + }; + + config = lib.mkIf cfg.enable { + my.desktop.enable = true; + + services = { + xserver = { + # Enable the GNOME Desktop Environment. + displayManager.gdm.enable = true; + desktopManager.gnome.enable = true; + }; + + gnome = { + tracker-miners.enable = false; + tracker.enable = false; + }; + }; + + environment.systemPackages = [pkgs.gnomeExtensions.gsconnect]; + + # remove some gnome default apps + environment.gnome.excludePackages = with pkgs.gnome; [ + cheese # photo booth + epiphany # web browser + evince # document viewer + geary # email client + seahorse # password manager + gnome-clocks + gnome-maps + gnome-weather + gnome-music + pkgs.gnome-connections + ]; + + home-manager.users = { + # vinzenz = lib.mkIf config.my.home.vinzenz.enable applyGnomeUserSettings; + # ronja = lib.mkIf config.my.home.ronja.enable applyGnomeUserSettings; + }; + }; +} diff --git a/modules/desktop/kde.nix b/modules/desktop/kde.nix new file mode 100644 index 0000000..24af742 --- /dev/null +++ b/modules/desktop/kde.nix @@ -0,0 +1,62 @@ +{ + config, + pkgs, + lib, + ... +}: let + cfg = config.my.kde; + + # applyKdeUserSettings = { + # #home = { + # # packages = with pkgs; [ + # # ]; + # #}; + + # services.kdeconnect = { + # enable = true; + # indicator = true; + # }; + # }; +in { + options.my.kde = { + enable = lib.mkEnableOption "KDE desktop"; + }; + + config = lib.mkIf cfg.enable { + my.desktop.enable = true; + + services = { + # Enable the KDE Plasma Desktop Environment. + xserver = { + desktopManager.plasma5.enable = true; + + displayManager = { + sddm.enable = true; + defaultSession = "plasmawayland"; + }; + }; + }; + + environment.systemPackages = with pkgs; [ + libsForQt5.kate + libsForQt5.kalk + ]; + + environment.plasma5.excludePackages = with pkgs.libsForQt5; [ + elisa + gwenview + okular + khelpcenter + ]; + + programs = { + dconf.enable = true; + partition-manager.enable = true; + }; + + home-manager.users = { + #vinzenz = lib.mkIf config.my.home.vinzenz.enable applyKdeUserSettings; + #ronja = lib.mkIf config.my.home.ronja.enable applyKdeUserSettings; + }; + }; +} diff --git a/modules/home/default.nix b/modules/home/default.nix new file mode 100644 index 0000000..6d85a0d --- /dev/null +++ b/modules/home/default.nix @@ -0,0 +1,24 @@ +{ + config, + pkgs, + lib, + ... +}: let + cfg = config.my.home; +in { + imports = [ + ./vinzenz.nix + ./ronja.nix + # enable home manager + + ]; + + options.my.home = { + enable = lib.mkEnableOption "my home management"; + }; + + config = lib.mkIf cfg.enable { + home-manager.useUserPackages = true; + home-manager.useGlobalPkgs = true; + }; +} diff --git a/modules/home/ronja.nix b/modules/home/ronja.nix new file mode 100644 index 0000000..0b11bea --- /dev/null +++ b/modules/home/ronja.nix @@ -0,0 +1,128 @@ +{ + config, + pkgs, + lib, + ... +}: +with lib; let + cfg = config.my.home.ronja; +in { + options.my.home.ronja = { + enable = lib.mkEnableOption "user ronja"; + }; + + config = lib.mkIf cfg.enable { + # Define user account + users.users.ronja = { + isNormalUser = true; + description = "Ronja Spiegelberg"; + extraGroups = ["networkmanager" "wheel"]; + shell = pkgs.zsh; + }; + + # home manager + my.home.enable = true; + home-manager.users.ronja = { + config, + pkgs, + ... + }: { + home = { + username = "ronja"; + homeDirectory = "/home/ronja"; + stateVersion = "22.11"; + + sessionVariables = { + EDITOR = "nano"; + }; + + packages = with pkgs; [ + ## Apps + steam + telegram-desktop + powerline + powerline-fonts + lutris + kdiff3 + wineWowPackages.stagingFull + wineWowPackages.fonts + winetricks + + (lutris.override { + extraPkgs = pkgs: [ + # List package dependencies here + ]; + extraLibraries = pkgs: [ + # List library dependencies here + ]; + }) + ]; + + file.".nanorc".text = '' + set linenumbers + set mouse + ''; + }; + + programs = { + home-manager.enable = true; + + firefox.enable = true; + command-not-found.enable = true; + dircolors.enable = true; + htop.enable = true; + + zsh = { + enable = true; + + enableSyntaxHighlighting = true; + enableAutosuggestions = true; + enableVteIntegration = true; + + history = { + size = 10000; + path = "${config.xdg.dataHome}/zsh/history"; + expireDuplicatesFirst = true; + }; + + oh-my-zsh = { + enable = true; + theme = "agnoster"; + plugins = ["git" "sudo" "systemadmin"]; + }; + }; + + git = { + enable = true; + userName = "Ronja Spiegelberg"; + userEmail = "ronja.spiegelberg@gmail.com"; + + extraConfig = { + pull.ff = "only"; + init.defaultBranch = "main"; + merge.tool = "kdiff3"; + }; + }; + + gh = { + enable = true; + enableGitCredentialHelper = true; + }; + + chromium = { + enable = true; + extensions = [ + { + # ublock origin + id = "cjpalhdlnbpafiamejdnhcphjbkeiagm"; + } + { + id = "dcpihecpambacapedldabdbpakmachpb"; + updateUrl = "https://raw.githubusercontent.com/iamadamdev/bypass-paywalls-chrome/master/updates.xml"; + } + ]; + }; + }; + }; + }; +} diff --git a/modules/home/vinzenz.nix b/modules/home/vinzenz.nix new file mode 100644 index 0000000..2538077 --- /dev/null +++ b/modules/home/vinzenz.nix @@ -0,0 +1,240 @@ +{ + config, + pkgs, + lib, + ... +}: let + cfg = config.my.home.vinzenz; +in { + options.my.home.vinzenz = { + enable = lib.mkEnableOption "user vinzenz"; + }; + + config = lib.mkIf cfg.enable { + # Define user account + users.users.vinzenz = { + isNormalUser = true; + description = "Vinzenz Schroeter"; + extraGroups = ["networkmanager" "wheel"]; + shell = pkgs.zsh; + }; + + # home manager + my.home.enable = true; + home-manager.users.vinzenz = { + config, + pkgs, + ... + }: { + home = { + username = "vinzenz"; + homeDirectory = "/home/vinzenz"; + stateVersion = "22.11"; + + sessionVariables = { + EDITOR = "nano"; + }; + + packages = with pkgs; [ + keepassxc + steam + insync + telegram-desktop + simple-scan + wireguard-tools + element-desktop + etcher + iotop + radeontop + lsof + wirelesstools + powerline + powerline-fonts + thefuck + dotnet-sdk_7 + jetbrains.rider + alejandra + arduino + uucp + screen + jetbrains.pycharm-professional + kdiff3 + docker + wineWowPackages.stagingFull + wineWowPackages.fonts + winetricks + + (lutris.override { + extraPkgs = pkgs: [ + # List package dependencies here + ]; + extraLibraries = pkgs: [ + # List library dependencies here + ]; + }) + ]; + + file.".nanorc".text = '' + set linenumbers + set mouse + ''; + }; + + services = { + kdeconnect = { + enable = true; + indicator = true; + }; + }; + + programs = { + home-manager.enable = true; + + firefox.enable = true; + command-not-found.enable = true; + dircolors.enable = true; + fzf.enable = true; + htop.enable = true; + + zsh = { + enable = true; + + enableSyntaxHighlighting = true; + enableAutosuggestions = true; + enableVteIntegration = true; + + initExtra = '' + eval "$(direnv hook zsh)"; + eval $(thefuck --alias); + ''; + + shellAliases = { + my-apply = "sudo nixos-rebuild boot"; + my-switch = "sudo nixos-rebuild switch"; + my-update = "sudo nixos-rebuild boot --upgrade"; + my-fmt = "alejandra ."; + }; + + history = { + size = 10000; + path = "${config.xdg.dataHome}/zsh/history"; + expireDuplicatesFirst = true; + }; + + oh-my-zsh = { + enable = true; + theme = "agnoster"; + plugins = ["git" "sudo" "docker" "systemadmin" "thefuck"]; + }; + }; + + git = { + enable = true; + userName = "Vinzenz Schroeter"; + userEmail = "vinzenz.f.s@gmail.com"; + + aliases = { + prettylog = "log --pretty=oneline --graph"; + }; + + extraConfig = { + pull.ff = "only"; + init.defaultBranch = "main"; + merge.tool = "kdiff3"; + push.autoSetupRemote = "true"; + }; + }; + + gh = { + enable = true; + enableGitCredentialHelper = true; + }; + + vscode = { + enable = true; + package = pkgs.vscodium; + enableUpdateCheck = false; + extensions = with pkgs; [ + vscode-extensions.bbenoist.nix + vscode-extensions.ms-python.python + vscode-extensions.kamadorueda.alejandra + ]; + userSettings = { + "git.autofetch" = true; + "update.mode" = "none"; + "editor.fontFamily" = "'Fira Code', 'Droid Sans Mono', 'monospace', monospace"; + "editor.fontLigatures" = true; + "editor.formatOnSave" = true; + "editor.formatOnSaveMode" = "modificationsIfAvailable"; + "editor.minimap.autohide" = true; + "diffEditor.diffAlgorithm" = "advanced"; + "explorer.excludeGitIgnore" = true; + "workbench.startupEditor" = "readme"; + "markdown.extension.tableFormatter.normalizeIndentation" = true; + "markdown.extension.toc.orderedList" = false; + "telemetry.telemetryLevel" = "off"; + "redhat.telemetry.enabled" = false; + "workbench.enableExperiments" = false; + }; + }; + + direnv = { + enable = true; + nix-direnv.enable = true; + }; + + chromium = { + enable = true; + extensions = [ + { + # ublock origin + id = "cjpalhdlnbpafiamejdnhcphjbkeiagm"; + } + { + id = "dcpihecpambacapedldabdbpakmachpb"; + updateUrl = "https://raw.githubusercontent.com/iamadamdev/bypass-paywalls-chrome/master/updates.xml"; + } + ]; + }; + + bottom = { + enable = true; + settings = { + # https://github.com/ClementTsang/bottom/blob/master/sample_configs/default_config.toml + }; + }; + + exa = { + enable = true; + git = true; + icons = true; + enableAliases = true; + extraOptions = [ + "--group-directories-first" + "--header" + ]; + }; + + # checked https://rycee.gitlab.io/home-manager/options.html until "programs.jq" + }; + + editorconfig = { + enable = true; + settings = { + "*" = { + charset = "utf-8"; + end_of_line = "lf"; + trim_trailing_whitespace = true; + insert_final_newline = true; + max_line_width = 120; + indent_style = "space"; + indent_size = 4; + }; + "*.nix" = { + indent_size = 2; + }; + }; + }; + }; + }; +} diff --git a/modules/i18n.nix b/modules/i18n.nix new file mode 100644 index 0000000..3d38ec1 --- /dev/null +++ b/modules/i18n.nix @@ -0,0 +1,28 @@ +{...}: { + config = { + time.timeZone = "Europe/Berlin"; + i18n = { + defaultLocale = "en_US.UTF-8"; + extraLocaleSettings = { + LC_ADDRESS = "de_DE.UTF-8"; + LC_IDENTIFICATION = "de_DE.UTF-8"; + LC_MEASUREMENT = "de_DE.UTF-8"; + LC_MONETARY = "de_DE.UTF-8"; + LC_NAME = "de_DE.UTF-8"; + LC_NUMERIC = "de_DE.UTF-8"; + LC_PAPER = "de_DE.UTF-8"; + LC_TELEPHONE = "de_DE.UTF-8"; + LC_TIME = "de_DE.UTF-8"; + }; + }; + + services.xserver = { + # Configure keymap in X11 + layout = "de"; + xkbVariant = ""; + }; + + # Configure console keymap + console.keyMap = "de"; + }; +} diff --git a/modules/nixpkgs.nix b/modules/nixpkgs.nix new file mode 100644 index 0000000..dc7c9e9 --- /dev/null +++ b/modules/nixpkgs.nix @@ -0,0 +1,21 @@ +{...}: { + config = { + nixpkgs.config = { + allowUnfree = true; + permittedInsecurePackages = [ + "electron-12.2.3" + ]; + }; + + system = { + stateVersion = "22.11"; + # enable auto updates + autoUpgrade.enable = true; + }; + + nix.gc = { + automatic = true; + dates = "00:30"; + }; + }; +} diff --git a/vinzenz-lpt.nix b/vinzenz-lpt.nix index 7b07dab..5474c3d 100644 --- a/vinzenz-lpt.nix +++ b/vinzenz-lpt.nix @@ -1,53 +1,13 @@ -{ - config, - lib, - pkgs, - ... -}: { - networking.hostName = "vinzenz-lpt"; - +{...}: { imports = [ - ./common.nix - ./gnome.nix - ./home-vinzenz.nix + ./modules + (import ./hardware "vinzenz-lpt") ]; - services.flatpak.enable = true; + config = { + my.gnome.enable = true; + my.home.vinzenz.enable = true; - boot = { - initrd.availableKernelModules = ["xhci_pci" "ehci_pci" "ahci" "usbhid" "usb_storage" "sd_mod" "sdhci_pci"]; - initrd.kernelModules = []; - kernelModules = ["kvm-intel"]; - extraModulePackages = []; - loader.efi.efiSysMountPoint = "/boot/efi"; + services.flatpak.enable = true; }; - - fileSystems = { - "/" = { - device = "/dev/disk/by-uuid/34cb86c4-8823-4785-9672-92ef0bcd5eaf"; - fsType = "btrfs"; - options = ["subvol=@"]; - }; - - "/boot/efi" = { - device = "/dev/disk/by-uuid/2381-1CD2"; - fsType = "vfat"; - }; - }; - - swapDevices = [ - {device = "/dev/disk/by-uuid/f5932f70-60e4-4abe-b23d-2cab3c095c7d";} - ]; - - # Enables DHCP on each ethernet and wireless interface. In case of scripted networking - # (the default) this is the recommended approach. When using systemd-networkd it's - # still possible to use this option, but it's recommended to use it in conjunction - # with explicit per-interface declarations with `networking.interfaces..useDHCP`. - networking.useDHCP = lib.mkDefault true; - # networking.interfaces.eno1.useDHCP = lib.mkDefault true; - # networking.interfaces.wlp3s0.useDHCP = lib.mkDefault true; - - nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; - hardware.enableRedistributableFirmware = true; - hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; } diff --git a/vinzenz-pc2.nix b/vinzenz-pc2.nix new file mode 100644 index 0000000..83ea523 --- /dev/null +++ b/vinzenz-pc2.nix @@ -0,0 +1,22 @@ +{...}: { + imports = [ + ./modules + (import ./hardware "vinzenz-pc2") + ]; + + config = { + my.kde.enable = true; + my.home = { + vinzenz.enable = true; + ronja.enable = true; + }; + + users.groups."games" = { + members = ["vinzenz" "ronja"]; + }; + + users.users.vinzenz.openssh.authorizedKeys.keys = [ + "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAINrY6tcgnoC/xbgL7vxSjddEY9MBxRXe9n2cAHt88/TT home roaming" + ]; + }; +} diff --git a/vinzenz-pc3.nix b/vinzenz-pc3.nix deleted file mode 100644 index 3c32a63..0000000 --- a/vinzenz-pc3.nix +++ /dev/null @@ -1,82 +0,0 @@ -{ - config, - lib, - pkgs, - ... -}: { - networking.hostName = "vinzenz-pc3"; - - imports = [ - ./common.nix - ./kde.nix - ./home-vinzenz.nix - ./home-ronja.nix - ]; - - users.groups."games" = { - members = ["vinzenz" "ronja"]; - }; - - users.users.vinzenz.openssh.authorizedKeys.keys = [ - "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAINrY6tcgnoC/xbgL7vxSjddEY9MBxRXe9n2cAHt88/TT home roaming" - ]; - - boot = { - initrd.availableKernelModules = ["nvme" "xhci_pci" "ahci" "usbhid" "sd_mod"]; # "usb_storage" - initrd.kernelModules = []; - kernelModules = ["kvm-amd"]; - extraModulePackages = []; - loader.efi.efiSysMountPoint = "/boot"; - }; - - fileSystems = { - "/" = { - device = "/dev/disk/by-uuid/0e9c983a-e733-447e-8181-f41d6670c4b8"; - fsType = "btrfs"; - options = ["subvol=@"]; - }; - - "/home" = { - device = "/dev/disk/by-uuid/0e9c983a-e733-447e-8181-f41d6670c4b8"; - fsType = "btrfs"; - options = ["subvol=@home"]; - }; - - "/games" = { - device = "/dev/disk/by-uuid/0e9c983a-e733-447e-8181-f41d6670c4b8"; - fsType = "btrfs"; - options = ["subvol=@games"]; - }; - - "/boot" = { - device = "/dev/disk/by-uuid/AF67-8F16"; - fsType = "vfat"; - }; - - "/mnt/nixos_btrfs_root" = { - # subvolume with id 5 is always the root volume - # this is convenient for managing the flat subvolume hierarchy - device = "/dev/disk/by-uuid/0e9c983a-e733-447e-8181-f41d6670c4b8"; - fsType = "btrfs"; - options = ["subvolid=5"]; - }; - - "/mnt/ssd2" = { - device = "/dev/disk/by-uuid/6b2a647d-c68e-4c07-85bf-c9bfc5db7e8a"; - fsType = "ext4"; - }; - }; - - swapDevices = []; - - # Enables DHCP on each ethernet and wireless interface. In case of scripted networking - # (the default) this is the recommended approach. When using systemd-networkd it's - # still possible to use this option, but it's recommended to use it in conjunction - # with explicit per-interface declarations with `networking.interfaces..useDHCP`. - networking.useDHCP = lib.mkDefault true; - # networking.interfaces.eno1.useDHCP = lib.mkDefault true; - # networking.interfaces.wlp5s0.useDHCP = lib.mkDefault true; - - nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; - hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; -}