diff --git a/.gitignore b/.gitignore index 4bd922a..e69de29 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +0,0 @@ -secrets/ diff --git a/home/hyprland/horizontal_16x9.png b/assets/horizontal_16x9.png similarity index 100% rename from home/hyprland/horizontal_16x9.png rename to assets/horizontal_16x9.png diff --git a/configuration.nix b/configuration.nix deleted file mode 100644 index 181ad6f..0000000 --- a/configuration.nix +++ /dev/null @@ -1,219 +0,0 @@ -# Edit this configuration file to define what should be installed on -# your system. Help is available in the configuration.nix(5) man page -# and in the NixOS manual (accessible by running ‘nixos-help’). -{ config -, pkgs -, inputs -, hostname -, username -, ... -}: { - imports = [ - # Include the results of the hardware scan. - ./hardware-configuration.nix - inputs.catppuccin.nixosModules.catppuccin - ]; - - ## Boot - # Bootloader. - boot.loader.grub = { - enable = true; - device = "/dev/nvme0n1"; - configurationLimit = 10; - }; - - # Use latest kernel. - boot.kernelPackages = pkgs.linuxPackages_latest; - - ## Network - networking.hostName = hostname; - # Enable networking - networking.networkmanager.enable = true; - - ## Time/Language - # Set your time zone. - time.timeZone = "Europe/Berlin"; - - # Select internationalisation properties. - i18n.defaultLocale = "en_US.UTF-8"; - - i18n.extraLocaleSettings = { - LC_ADDRESS = "de_DE.UTF-8"; - LC_IDENTIFICATION = "de_DE.UTF-8"; - LC_MEASUREMENT = "de_DE.UTF-8"; - LC_MONETARY = "de_DE.UTF-8"; - LC_NAME = "de_DE.UTF-8"; - LC_NUMERIC = "de_DE.UTF-8"; - LC_PAPER = "de_DE.UTF-8"; - LC_TELEPHONE = "de_DE.UTF-8"; - LC_TIME = "de_DE.UTF-8"; - }; - - # Configure console keymap - console.keyMap = "de"; - - ## Nix - nix.settings.experimental-features = [ - "nix-command" - "flakes" - ]; - - nix.gc = { - automatic = true; - dates = "weekly"; - options = "--delete-older-than 7d"; - }; - - # Allow unfree packages - nixpkgs.config.allowUnfree = true; - - ## Global packages - environment.systemPackages = with pkgs; [ - vim - wget - git - cifs-utils # required for network mounting the NAS - age - rocmPackages.amdsmi - ]; - - fonts = { - enableDefaultPackages = true; - packages = with pkgs; [ - nerd-fonts.jetbrains-mono - ]; - fontDir.enable = true; - }; - - catppuccin.enable = true; - - programs.hyprland.enable = true; - # Force electron apps to use wayland - environment.sessionVariables.NIXOS_OZONE_WL = "1"; - - programs.zsh.enable = true; - - programs.steam = { - enable = true; - extraCompatPackages = [ - pkgs.proton-ge-bin - ]; - protontricks = { - enable = true; - }; - dedicatedServer.openFirewall = true; - localNetworkGameTransfers.openFirewall = true; - remotePlay.openFirewall = true; - }; - - # Some programs need SUID wrappers, can be configured further or are - # started in user sessions. - # programs.mtr.enable = true; - programs.gnupg.agent = { - enable = true; - enableSSHSupport = true; - }; - - ## User config - # enable auto-login - services.getty.autologinUser = username; - - users.users.${username} = { - isNormalUser = true; - extraGroups = [ "networkmanager" "wheel" ]; - shell = pkgs.zsh; - }; - - ## NAS Mount - - fileSystems."/mnt/nas" = { - device = "//duke.veltnet/smb-share"; - fsType = "cifs"; - options = [ - "x-systemd.automount" - "noauto" - "user,users" - "uid=1000" - "gid=100" - #TODO: we should use age for this - "credentials=/etc/nixos/secrets/nas-share.creds" - ]; - }; - - # required for zsh completion - environment.pathsToLink = [ "/share/zsh" ]; - - # List services that you want to enable: - - services.kanata = { - enable = true; - #TODO: move kanata config to module - keyboards.remap-specials = { - config = '' - (deflocalkeys-linux - ö 39 - ) - - (defsrc - a s d j k l ö - ) - - (defvar - tap-time 200 - hold-time 200 - ) - - (defalias - a (tap-hold $tap-time $hold-time a lmet) - s (tap-hold $tap-time $hold-time s lctl) - d (tap-hold $tap-time $hold-time d lsft) - k (tap-hold $tap-time $hold-time k rsft) - l (tap-hold $tap-time $hold-time l rctl) - ö (tap-hold $tap-time $hold-time ö ralt) - - activate (tap-dance $tap-time (j _ _ (layer-switch home-mods))) - deactivate (tap-dance $tap-time (j _ _ (layer-switch base))) - ) - - (deflayer base - a s d @activate k l ö - ) - - (deflayer home-mods - @a @s @d @deactivate @k @l @ö - ) - ''; - extraDefCfg = '' - process-unmapped-keys yes - ''; - }; - }; - - services.nixseparatedebuginfod2.enable = true; - - services.mullvad-vpn.enable = true; - services.pipewire = { - alsa.enable = true; - enable = true; - wireplumber.enable = true; - }; - - networking.firewall.enable = false; - - # Enable the OpenSSH daemon. - # services.openssh.enable = true; - - # Open ports in the firewall. - # networking.firewall.allowedTCPPorts = [ ... ]; - # networking.firewall.allowedUDPPorts = [ ... ]; - # Or disable the firewall altogether. - # networking.firewall.enable = false; - - # This value determines the NixOS release from which the default - # settings for stateful data, like file locations and database versions - # on your system were taken. It‘s perfectly fine and recommended to leave - # this value at the release version of the first install of this system. - # Before changing this value read the documentation for this option - # (e.g. man configuration.nix or on https://nixos.org/nixos/options.html). - system.stateVersion = "25.11"; # Did you read the comment? -} diff --git a/flake.lock b/flake.lock index d08adc1..3296c43 100644 --- a/flake.lock +++ b/flake.lock @@ -1,5 +1,42 @@ { "nodes": { + "agenix": { + "inputs": { + "darwin": "darwin", + "home-manager": [ + "home-manager" + ], + "nixpkgs": [ + "nixpkgs" + ], + "systems": "systems" + }, + "locked": { + "lastModified": 1770165109, + "narHash": "sha256-9VnK6Oqai65puVJ4WYtCTvlJeXxMzAp/69HhQuTdl/I=", + "owner": "ryantm", + "repo": "agenix", + "rev": "b027ee29d959fda4b60b57566d64c98a202e0feb", + "type": "github" + }, + "original": { + "owner": "ryantm", + "repo": "agenix", + "type": "github" + } + }, + "assets": { + "flake": false, + "locked": { + "path": "./assets", + "type": "path" + }, + "original": { + "path": "./assets", + "type": "path" + }, + "parent": [] + }, "catppuccin": { "inputs": { "nixpkgs": [ @@ -21,7 +58,62 @@ "type": "github" } }, + "darwin": { + "inputs": { + "nixpkgs": [ + "agenix", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1744478979, + "narHash": "sha256-dyN+teG9G82G+m+PX/aSAagkC+vUv0SgUw3XkPhQodQ=", + "owner": "lnl7", + "repo": "nix-darwin", + "rev": "43975d782b418ebf4969e9ccba82466728c2851b", + "type": "github" + }, + "original": { + "owner": "lnl7", + "ref": "master", + "repo": "nix-darwin", + "type": "github" + } + }, + "flake-file": { + "locked": { + "lastModified": 1773224147, + "narHash": "sha256-w9RQyKZSTfqoZPRzIf7H4qVHy2N6uFk1MUU+c1K4c40=", + "owner": "vic", + "repo": "flake-file", + "rev": "97bd69ff570dddccd704077830446ec1ca3a6988", + "type": "github" + }, + "original": { + "owner": "vic", + "repo": "flake-file", + "type": "github" + } + }, "flake-parts": { + "inputs": { + "nixpkgs-lib": "nixpkgs-lib" + }, + "locked": { + "lastModified": 1772408722, + "narHash": "sha256-rHuJtdcOjK7rAHpHphUb1iCvgkU3GpfvicLMwwnfMT0=", + "owner": "hercules-ci", + "repo": "flake-parts", + "rev": "f20dc5d9b8027381c474144ecabc9034d6a839a3", + "type": "github" + }, + "original": { + "owner": "hercules-ci", + "repo": "flake-parts", + "type": "github" + } + }, + "flake-parts_2": { "inputs": { "nixpkgs-lib": [ "nixvim", @@ -44,7 +136,7 @@ }, "flake-utils": { "inputs": { - "systems": "systems" + "systems": "systems_2" }, "locked": { "lastModified": 1731533236, @@ -67,11 +159,11 @@ ] }, "locked": { - "lastModified": 1772985280, - "narHash": "sha256-FdrNykOoY9VStevU4zjSUdvsL9SzJTcXt4omdEDZDLk=", + "lastModified": 1773264488, + "narHash": "sha256-rK0507bDuWBrZo+0zts9bCs/+RRUEHuvFE5DHWPxX/Q=", "owner": "nix-community", "repo": "home-manager", - "rev": "8f736f007139d7f70752657dff6a401a585d6cbc", + "rev": "5c0f63f8d55040a7eed69df7e3fcdd15dfb5a04c", "type": "github" }, "original": { @@ -81,6 +173,21 @@ "type": "github" } }, + "import-tree": { + "locked": { + "lastModified": 1772999353, + "narHash": "sha256-dPb0WxUhFaz6wuR3B6ysqFJpsu8txKDPZvS47AT2XLI=", + "owner": "vic", + "repo": "import-tree", + "rev": "545a4df146fce44d155573e47f5a777985acf912", + "type": "github" + }, + "original": { + "owner": "vic", + "repo": "import-tree", + "type": "github" + } + }, "ixx": { "inputs": { "flake-utils": [ @@ -111,11 +218,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1773068389, - "narHash": "sha256-vMrm7Pk2hjBRPnCSjhq1pH0bg350Z+pXhqZ9ICiqqCs=", + "lastModified": 1773375660, + "narHash": "sha256-SEzUWw2Rf5Ki3bcM26nSKgbeoqi2uYy8IHVBqOKjX3w=", "owner": "nixos", "repo": "nixpkgs", - "rev": "44bae273f9f82d480273bab26f5c50de3724f52f", + "rev": "3e20095fe3c6cbb1ddcef89b26969a69a1570776", "type": "github" }, "original": { @@ -125,14 +232,45 @@ "type": "github" } }, + "nixpkgs-lib": { + "locked": { + "lastModified": 1772328832, + "narHash": "sha256-e+/T/pmEkLP6BHhYjx6GmwP5ivonQQn0bJdH9YrRB+Q=", + "owner": "nix-community", + "repo": "nixpkgs.lib", + "rev": "c185c7a5e5dd8f9add5b2f8ebeff00888b070742", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "nixpkgs.lib", + "type": "github" + } + }, + "nixpkgs-unstable": { + "locked": { + "lastModified": 1773282481, + "narHash": "sha256-b/GV2ysM8mKHhinse2wz+uP37epUrSE+sAKXy/xvBY4=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "fe416aaedd397cacb33a610b33d60ff2b431b127", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, "nixvim": { "inputs": { - "flake-parts": "flake-parts", + "flake-parts": "flake-parts_2", "nixpkgs": [ "nixpkgs" ], "nuschtosSearch": "nuschtosSearch", - "systems": "systems_2" + "systems": "systems_3" }, "locked": { "lastModified": 1769049374, @@ -174,20 +312,60 @@ }, "root": { "inputs": { + "agenix": "agenix", + "assets": "assets", "catppuccin": "catppuccin", + "flake-file": "flake-file", + "flake-parts": "flake-parts", "home-manager": "home-manager", + "import-tree": "import-tree", "nixpkgs": "nixpkgs", + "nixpkgs-unstable": "nixpkgs-unstable", "nixvim": "nixvim", + "rust-overlay": "rust-overlay", + "secrets": "secrets", "spicetify-nix": "spicetify-nix", "zen-browser": "zen-browser" } }, + "rust-overlay": { + "inputs": { + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1773457417, + "narHash": "sha256-waABTSxPdbxml4BhcabHhyQF02Qnj27qRU4ard0mTQo=", + "owner": "oxalica", + "repo": "rust-overlay", + "rev": "055977c30249484010750e03074c744dcdaa0d23", + "type": "github" + }, + "original": { + "owner": "oxalica", + "repo": "rust-overlay", + "type": "github" + } + }, + "secrets": { + "flake": false, + "locked": { + "path": "./secrets", + "type": "path" + }, + "original": { + "path": "./secrets", + "type": "path" + }, + "parent": [] + }, "spicetify-nix": { "inputs": { "nixpkgs": [ "nixpkgs" ], - "systems": "systems_3" + "systems": "systems_4" }, "locked": { "lastModified": 1773161309, @@ -248,6 +426,21 @@ "type": "github" } }, + "systems_4": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + }, "zen-browser": { "inputs": { "nixpkgs": [ @@ -255,11 +448,11 @@ ] }, "locked": { - "lastModified": 1772685307, - "narHash": "sha256-5xthZHeqwBeXNhnRIlxnCuaZLky0SZ6vQsxtd+eqhTU=", + "lastModified": 1773290160, + "narHash": "sha256-u09eF4Oafi+OIbTtKe/EWil26q1glcTATiSA7dF1oCI=", "owner": "youwen5", "repo": "zen-browser-flake", - "rev": "dc92d88524ee83308795bc90f6a9f1d965265aaa", + "rev": "c7cb51b30960757ed9fb8eb28567b32585d0a688", "type": "github" }, "original": { diff --git a/flake.nix b/flake.nix index 4535582..546ea72 100644 --- a/flake.nix +++ b/flake.nix @@ -1,58 +1,52 @@ +# DO-NOT-EDIT. This file was auto-generated using github:vic/flake-file. +# Use `nix run .#write-flake` to regenerate it. { - description = "Weckyy702's (hopefully nice) NixOS config"; + outputs = inputs: inputs.flake-parts.lib.mkFlake { inherit inputs; } (inputs.import-tree ./modules); inputs = { + agenix = { + url = "github:ryantm/agenix"; + inputs = { + home-manager.follows = "home-manager"; + nixpkgs.follows = "nixpkgs"; + }; + }; + assets = { + url = "path:./assets"; + flake = false; + }; + catppuccin = { + url = "github:catppuccin/nix/release-25.11"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + flake-file.url = "github:vic/flake-file"; + flake-parts.url = "github:hercules-ci/flake-parts"; + home-manager = { + url = "github:nix-community/home-manager/release-25.11"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + import-tree.url = "github:vic/import-tree"; nixpkgs.url = "github:nixos/nixpkgs/nixos-25.11"; - - home-manager.url = "github:nix-community/home-manager/release-25.11"; - home-manager.inputs.nixpkgs.follows = "nixpkgs"; - - nixvim.url = "github:nix-community/nixvim/nixos-25.11"; - nixvim.inputs.nixpkgs.follows = "nixpkgs"; - + nixpkgs-unstable.url = "github:nixos/nixpkgs/nixos-unstable"; + nixvim = { + url = "github:nix-community/nixvim/nixos-25.11"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + rust-overlay = { + url = "github:oxalica/rust-overlay"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + secrets = { + url = "path:./secrets"; + flake = false; + }; + spicetify-nix = { + url = "github:Gerg-L/spicetify-nix"; + inputs.nixpkgs.follows = "nixpkgs"; + }; zen-browser = { url = "github:youwen5/zen-browser-flake"; inputs.nixpkgs.follows = "nixpkgs"; }; - - catppuccin.url = "github:catppuccin/nix/release-25.11"; - catppuccin.inputs.nixpkgs.follows = "nixpkgs"; - - spicetify-nix.url = "github:Gerg-L/spicetify-nix"; - spicetify-nix.inputs.nixpkgs.follows = "nixpkgs"; }; - - outputs = - { self - , nixpkgs - , home-manager - , catppuccin - , nixvim - , ... - } @ inputs: { - nixosConfigurations.keith = - let - hostname = "keith"; - username = "weckyy702"; - specialArgs = { - inherit inputs; - inherit hostname; - inherit username; - }; - in - nixpkgs.lib.nixosSystem { - inherit specialArgs; - modules = [ - ./configuration.nix - home-manager.nixosModules.home-manager - { - home-manager.useGlobalPkgs = true; - home-manager.useUserPackages = true; - - home-manager.extraSpecialArgs = specialArgs; - home-manager.users.${username} = import ./home/home.nix; - } - ]; - }; - }; } diff --git a/hardware-configuration.nix b/hardware-configuration.nix deleted file mode 100644 index 8a8bb1a..0000000 --- a/hardware-configuration.nix +++ /dev/null @@ -1,68 +0,0 @@ -# Do not modify this file! It was generated by ‘nixos-generate-config’ -# and may be overwritten by future invocations. Please make changes -# to /etc/nixos/configuration.nix instead. -{ config -, lib -, pkgs -, modulesPath -, username -, ... -}: { - imports = [ - (modulesPath + "/installer/scan/not-detected.nix") - ]; - - boot.initrd.availableKernelModules = [ "nvme" "xhci_pci" "ahci" "usbhid" "usb_storage" "sd_mod" ]; - boot.kernelModules = [ "kvm-amd" ]; - boot.extraModulePackages = [ ]; - - fileSystems."/" = { - device = "/dev/disk/by-uuid/0869e843-348d-47e3-b6a1-79ad814ff62b"; - fsType = "ext4"; - }; - - fileSystems."/home/${username}/Documents" = { - device = "/dev/disk/by-uuid/2d6f2255-eca4-489b-9f0f-6c455cd394fc"; - fsType = "ext4"; - }; - - #TODO: add external hdd, nas, and ssd - - swapDevices = [ - { device = "/dev/disk/by-uuid/40b22e5b-839d-4189-93e7-246407cc76c7"; } - ]; - - nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; - hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; - - hardware.graphics.enable = true; - hardware.graphics.extraPackages = [ pkgs.rocmPackages.clr.icd ]; - - hardware.amdgpu = { - initrd.enable = true; - opencl.enable = true; - }; - - networking.networkmanager = { - enable = true; - ensureProfiles.profiles = { - p2p-nas = { - connection = { - id = "p2p-nas"; - type = "ethernet"; - interface-name = "enp1s0"; - autoconnect = true; - }; - ipv6 = { - method = "manual"; - addresses = "fd00:fa57::1/64"; - }; - ipv4.method = "disabled"; - ethernet.mtu = 9000; - }; - }; - }; - networking.extraHosts = '' - fd00:fa57::2 duke.veltnet - ''; -} diff --git a/home/borgmatic.nix b/home/borgmatic.nix deleted file mode 100644 index 4ec565a..0000000 --- a/home/borgmatic.nix +++ /dev/null @@ -1,63 +0,0 @@ -{ hostname -, username -, pkgs -, ... -}: { - home.packages = with pkgs; [ - libnotify - ]; - - programs.borgmatic = { - enable = true; - package = pkgs.borgmatic; - - backups.default = { - location = { - repositories = [ - { - label = "duke"; - path = "ssh://borg@duke.veltnet:2222/home/borg/backups/${hostname}-${username}"; - } - ]; - excludeHomeManagerSymlinks = true; - patterns = [ - #TODO: home.homeDirectory might be usable here - "R /home/${username}/Documents" - "R /home/${username}/.ssh" - "- /home/${username}/Documents/SteamLibrary" - "- /home/${username}/Documents/PrismLauncher instances" - "- /home/${username}/Documents/.Trash-1000" - "- /home/${username}/Documents/VMs/Data" - "- **/node_modules" - "- **/.git" - "- **/.cache" - "- **/*build" - "- **/target" - "- **/.venv" - "- **/venv" - "- **/.gradle" - "- **/out" - "- **/dist" - "- **/.pio" - ]; - }; - retention.keepWeekly = 2; - storage.extraConfig.ssh_command = "ssh -i /home/${username}/.ssh/id_ed25519_borg"; - #FIXME: consistency checks!!! - }; - }; - - systemd.user.services.borgmatic = { - Unit.Description = "Create a backup using borgmatic"; - Service.ExecStart = "${pkgs.borgmatic}/bin/borgmatic create --stats"; - }; - - systemd.user.timers.borgmatic = { - Unit.Description = "Create weekly backups using borgmatic"; - Timer = { - OnCalendar = "Weekly"; - Persistent = true; - }; - Install.WantedBy = [ "timers.target" ]; - }; -} diff --git a/home/home.nix b/home/home.nix deleted file mode 100644 index 4851183..0000000 --- a/home/home.nix +++ /dev/null @@ -1,232 +0,0 @@ -top @ { config -, pkgs -, username -, inputs -, ... -}: { - imports = [ - inputs.nixvim.homeModules.nixvim - inputs.catppuccin.homeModules.catppuccin - inputs.spicetify-nix.homeManagerModules.default - ./borgmatic.nix - ./ssh.nix - # ./wlr-which-key.nix - ]; - - home.username = username; - home.homeDirectory = "/home/${username}"; - - home.packages = with pkgs; [ - mpv - feh - grim - slurp - xdg-user-dirs - hyprpicker - libqalculate - btop-rocm - xfce.thunar - prismlauncher - playerctl - signal-desktop - qbittorrent - unzip - file - gnucash - inputs.zen-browser.packages.${pkgs.stdenv.hostPlatform.system}.default - prusa-slicer - gdb - ]; - - home.sessionVariables = { - EDITOR = "nvim"; - }; - - home.pointerCursor = - let - size = 24; - in - { - enable = true; - package = pkgs.catppuccin-cursors.mochaMauve; - name = "catppuccin-mocha-mauve-cursors"; - inherit size; - - dotIcons.enable = true; - gtk.enable = true; - hyprcursor.enable = true; - hyprcursor.size = size; - }; - - catppuccin.enable = true; - - gtk = { - enable = true; - colorScheme = "dark"; - font.name = "JetBrainsMono"; - }; - - qt = { - enable = true; - style.name = "kvantum"; - }; - - wayland.windowManager.hyprland = { - enable = true; - settings = (import ./hyprland/settings.nix) top; - }; - - #TODO: GDB configuration - - programs.nixvim = { - enable = true; - imports = [ ./nixvim ]; - }; - - programs.thunderbird = { - enable = true; - profiles.default.isDefault = true; - }; - - programs.zathura.enable = true; - - programs.direnv = { - enable = true; - enableZshIntegration = true; - nix-direnv.enable = true; - }; - - programs.zoxide = { - enable = true; - enableZshIntegration = true; - options = [ - "--cmd cd" - ]; - }; - - programs.spicetify = - let - spkgs = inputs.spicetify-nix.legacyPackages.${pkgs.stdenv.hostPlatform.system}; - in - { - enable = true; - enabledExtensions = with spkgs.extensions; [ - fullAppDisplay - shuffle - aiBandBlocker - ]; - enabledCustomApps = with spkgs.apps; [ - newReleases - ]; - theme = spkgs.themes.catppuccin; - colorScheme = "mocha"; - }; - - programs.vesktop.enable = true; - - programs.rofi = { - enable = true; - modes = [ - "combi" - "drun" - "calc" - "ssh" - ]; - plugins = [ - pkgs.rofi-calc - ]; - }; - - programs.zsh = { - enable = true; - # For automatic login - profileExtra = '' - if [ -z "$WAYLAND_DISPLAY" ] && [ "$XDG_VTNR" = 1 ]; then - exec hyprland - fi - ''; - - autocd = true; - enableCompletion = true; - autosuggestion.enable = true; - syntaxHighlighting.enable = true; - initContent = pkgs.lib.mkBefore '' - date - # Enable Powerlevel10k instant prompt. Should stay close to the top of ~/.zshrc. - # Initialization code that may require console input (password prompts, [y/n] - # confirmations, etc.) must go above this block; everything else may go below. - if [[ -r "''${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-''${(%):-%n}.zsh" ]]; then - source "''${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-''${(%):-%n}.zsh" - fi - ''; - - plugins = [ - { - name = "powerlevel10k"; - src = "${pkgs.zsh-powerlevel10k}/share/zsh-powerlevel10k/"; - file = "powerlevel10k.zsh-theme"; - } - { - name = "p10k-config"; - src = ./p10k; - file = "p10k.zsh"; - } - ]; - - oh-my-zsh = { - enable = true; - plugins = [ - "git" - ]; - theme = "robbyrussell"; - }; - }; - - programs.fzf = { - enable = true; - enableZshIntegration = true; - }; - - programs.kitty = { - enable = true; - enableGitIntegration = true; - font = { - name = "JetBrains Mono"; - size = 10; - }; - shellIntegration.enableZshIntegration = true; - #TODO: kitty config - }; - - programs.git = { - enable = true; - settings.user = { - email = "weckyy702@gmail.com"; - name = "Weckyy702"; - }; - #TODO: signing - }; - - services.hyprpaper = { - enable = true; - settings = - let - # TODO: this should be done more cleanly - wallpaper_path = ./hyprland/horizontal_16x9.png; - in - { - preload = "${wallpaper_path}"; - wallpaper = [ - #TODO: this should be dynamic - "DP-1,${wallpaper_path}" - "HDMI-A-1,${wallpaper_path}" - ]; - }; - }; - - services.dunst.enable = true; - - services.hyprpolkitagent.enable = true; - - home.stateVersion = "25.11"; -} diff --git a/home/hyprland/hyprland.conf b/home/hyprland/hyprland.conf deleted file mode 100644 index 3cb3dfa..0000000 --- a/home/hyprland/hyprland.conf +++ /dev/null @@ -1,312 +0,0 @@ - -# ####################################################################################### -# AUTOGENERATED HYPRLAND CONFIG. -# EDIT THIS CONFIG ACCORDING TO THE WIKI INSTRUCTIONS. -# ####################################################################################### - -autogenerated = 1 # remove this line to remove the warning - -# This is an example Hyprland config file. -# Refer to the wiki for more information. -# https://wiki.hypr.land/Configuring/ - -# Please note not all available settings / options are set here. -# For a full list, see the wiki - -# You can split this configuration into multiple files -# Create your files separately and then link them to this file like this: -# source = ~/.config/hypr/myColors.conf - - -################ -### MONITORS ### -################ - -# See https://wiki.hypr.land/Configuring/Monitors/ -monitor=,preferred,auto,auto - - -################### -### MY PROGRAMS ### -################### - -# See https://wiki.hypr.land/Configuring/Keywords/ - -# Set programs that you use -$terminal = kitty -$fileManager = dolphin -$menu = wofi --show drun - - -################# -### AUTOSTART ### -################# - -# Autostart necessary processes (like notifications daemons, status bars, etc.) -# Or execute your favorite apps at launch like this: - -# exec-once = $terminal -# exec-once = nm-applet & -# exec-once = waybar & hyprpaper & firefox - - -############################# -### ENVIRONMENT VARIABLES ### -############################# - -# See https://wiki.hypr.land/Configuring/Environment-variables/ - -env = XCURSOR_SIZE,24 -env = HYPRCURSOR_SIZE,24 - - -################### -### PERMISSIONS ### -################### - -# See https://wiki.hypr.land/Configuring/Permissions/ -# Please note permission changes here require a Hyprland restart and are not applied on-the-fly -# for security reasons - -# ecosystem { -# enforce_permissions = 1 -# } - -# permission = /usr/(bin|local/bin)/grim, screencopy, allow -# permission = /usr/(lib|libexec|lib64)/xdg-desktop-portal-hyprland, screencopy, allow -# permission = /usr/(bin|local/bin)/hyprpm, plugin, allow - - -##################### -### LOOK AND FEEL ### -##################### - -# Refer to https://wiki.hypr.land/Configuring/Variables/ - -# https://wiki.hypr.land/Configuring/Variables/#general -general { - gaps_in = 5 - gaps_out = 20 - - border_size = 2 - - # https://wiki.hypr.land/Configuring/Variables/#variable-types for info about colors - col.active_border = rgba(33ccffee) rgba(00ff99ee) 45deg - col.inactive_border = rgba(595959aa) - - # Set to true enable resizing windows by clicking and dragging on borders and gaps - resize_on_border = false - - # Please see https://wiki.hypr.land/Configuring/Tearing/ before you turn this on - allow_tearing = false - - layout = dwindle -} - -# https://wiki.hypr.land/Configuring/Variables/#decoration -decoration { - rounding = 10 - rounding_power = 2 - - # Change transparency of focused and unfocused windows - active_opacity = 1.0 - inactive_opacity = 1.0 - - shadow { - enabled = true - range = 4 - render_power = 3 - color = rgba(1a1a1aee) - } - - # https://wiki.hypr.land/Configuring/Variables/#blur - blur { - enabled = true - size = 3 - passes = 1 - - vibrancy = 0.1696 - } -} - -# https://wiki.hypr.land/Configuring/Variables/#animations -animations { - enabled = yes, please :) - - # Default curves, see https://wiki.hypr.land/Configuring/Animations/#curves - # NAME, X0, Y0, X1, Y1 - bezier = easeOutQuint, 0.23, 1, 0.32, 1 - bezier = easeInOutCubic, 0.65, 0.05, 0.36, 1 - bezier = linear, 0, 0, 1, 1 - bezier = almostLinear, 0.5, 0.5, 0.75, 1 - bezier = quick, 0.15, 0, 0.1, 1 - - # Default animations, see https://wiki.hypr.land/Configuring/Animations/ - # NAME, ONOFF, SPEED, CURVE, [STYLE] - animation = global, 1, 10, default - animation = border, 1, 5.39, easeOutQuint - animation = windows, 1, 4.79, easeOutQuint - animation = windowsIn, 1, 4.1, easeOutQuint, popin 87% - animation = windowsOut, 1, 1.49, linear, popin 87% - animation = fadeIn, 1, 1.73, almostLinear - animation = fadeOut, 1, 1.46, almostLinear - animation = fade, 1, 3.03, quick - animation = layers, 1, 3.81, easeOutQuint - animation = layersIn, 1, 4, easeOutQuint, fade - animation = layersOut, 1, 1.5, linear, fade - animation = fadeLayersIn, 1, 1.79, almostLinear - animation = fadeLayersOut, 1, 1.39, almostLinear - animation = workspaces, 1, 1.94, almostLinear, fade - animation = workspacesIn, 1, 1.21, almostLinear, fade - animation = workspacesOut, 1, 1.94, almostLinear, fade - animation = zoomFactor, 1, 7, quick -} - -# Ref https://wiki.hypr.land/Configuring/Workspace-Rules/ -# "Smart gaps" / "No gaps when only" -# uncomment all if you wish to use that. -# workspace = w[tv1], gapsout:0, gapsin:0 -# workspace = f[1], gapsout:0, gapsin:0 -# windowrule = bordersize 0, floating:0, onworkspace:w[tv1] -# windowrule = rounding 0, floating:0, onworkspace:w[tv1] -# windowrule = bordersize 0, floating:0, onworkspace:f[1] -# windowrule = rounding 0, floating:0, onworkspace:f[1] - -# See https://wiki.hypr.land/Configuring/Dwindle-Layout/ for more -dwindle { - pseudotile = true # Master switch for pseudotiling. Enabling is bound to mainMod + P in the keybinds section below - preserve_split = true # You probably want this -} - -# See https://wiki.hypr.land/Configuring/Master-Layout/ for more -master { - new_status = master -} - -# https://wiki.hypr.land/Configuring/Variables/#misc -misc { - force_default_wallpaper = -1 # Set to 0 or 1 to disable the anime mascot wallpapers - disable_hyprland_logo = false # If true disables the random hyprland logo / anime girl background. :( -} - - -############# -### INPUT ### -############# - -# https://wiki.hypr.land/Configuring/Variables/#input -input { - kb_layout = de - kb_variant = - kb_model = - kb_options = - kb_rules = - - follow_mouse = 1 - - sensitivity = 0 # -1.0 - 1.0, 0 means no modification. - - touchpad { - natural_scroll = false - } -} - -# See https://wiki.hypr.land/Configuring/Gestures -gesture = 3, horizontal, workspace - -# Example per-device config -# See https://wiki.hypr.land/Configuring/Keywords/#per-device-input-configs for more -device { - name = epic-mouse-v1 - sensitivity = -0.5 -} - - -################### -### KEYBINDINGS ### -################### - -# See https://wiki.hypr.land/Configuring/Keywords/ -$mainMod = SUPER # Sets "Windows" key as main modifier - -# Example binds, see https://wiki.hypr.land/Configuring/Binds/ for more -bind = $mainMod, Q, exec, $terminal -bind = $mainMod, C, killactive, -bind = $mainMod, M, exit, -bind = $mainMod, E, exec, $fileManager -bind = $mainMod, V, togglefloating, -bind = $mainMod, R, exec, $menu -bind = $mainMod, P, pseudo, # dwindle -bind = $mainMod, J, togglesplit, # dwindle - -# Move focus with mainMod + arrow keys -bind = $mainMod, left, movefocus, l -bind = $mainMod, right, movefocus, r -bind = $mainMod, up, movefocus, u -bind = $mainMod, down, movefocus, d - -# Switch workspaces with mainMod + [0-9] -bind = $mainMod, 1, workspace, 1 -bind = $mainMod, 2, workspace, 2 -bind = $mainMod, 3, workspace, 3 -bind = $mainMod, 4, workspace, 4 -bind = $mainMod, 5, workspace, 5 -bind = $mainMod, 6, workspace, 6 -bind = $mainMod, 7, workspace, 7 -bind = $mainMod, 8, workspace, 8 -bind = $mainMod, 9, workspace, 9 -bind = $mainMod, 0, workspace, 10 - -# Move active window to a workspace with mainMod + SHIFT + [0-9] -bind = $mainMod SHIFT, 1, movetoworkspace, 1 -bind = $mainMod SHIFT, 2, movetoworkspace, 2 -bind = $mainMod SHIFT, 3, movetoworkspace, 3 -bind = $mainMod SHIFT, 4, movetoworkspace, 4 -bind = $mainMod SHIFT, 5, movetoworkspace, 5 -bind = $mainMod SHIFT, 6, movetoworkspace, 6 -bind = $mainMod SHIFT, 7, movetoworkspace, 7 -bind = $mainMod SHIFT, 8, movetoworkspace, 8 -bind = $mainMod SHIFT, 9, movetoworkspace, 9 -bind = $mainMod SHIFT, 0, movetoworkspace, 10 - -# Example special workspace (scratchpad) -bind = $mainMod, S, togglespecialworkspace, magic -bind = $mainMod SHIFT, S, movetoworkspace, special:magic - -# Scroll through existing workspaces with mainMod + scroll -bind = $mainMod, mouse_down, workspace, e+1 -bind = $mainMod, mouse_up, workspace, e-1 - -# Move/resize windows with mainMod + LMB/RMB and dragging -bindm = $mainMod, mouse:272, movewindow -bindm = $mainMod, mouse:273, resizewindow - -# Laptop multimedia keys for volume and LCD brightness -bindel = ,XF86AudioRaiseVolume, exec, wpctl set-volume -l 1 @DEFAULT_AUDIO_SINK@ 5%+ -bindel = ,XF86AudioLowerVolume, exec, wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%- -bindel = ,XF86AudioMute, exec, wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle -bindel = ,XF86AudioMicMute, exec, wpctl set-mute @DEFAULT_AUDIO_SOURCE@ toggle -bindel = ,XF86MonBrightnessUp, exec, brightnessctl -e4 -n2 set 5%+ -bindel = ,XF86MonBrightnessDown, exec, brightnessctl -e4 -n2 set 5%- - -# Requires playerctl -bindl = , XF86AudioNext, exec, playerctl next -bindl = , XF86AudioPause, exec, playerctl play-pause -bindl = , XF86AudioPlay, exec, playerctl play-pause -bindl = , XF86AudioPrev, exec, playerctl previous - -############################## -### WINDOWS AND WORKSPACES ### -############################## - -# See https://wiki.hypr.land/Configuring/Window-Rules/ for more -# See https://wiki.hypr.land/Configuring/Workspace-Rules/ for workspace rules - -# Example windowrule -# windowrule = float,class:^(kitty)$,title:^(kitty)$ - -# Ignore maximize requests from apps. You'll probably like this. -windowrule = suppressevent maximize, class:.* - -# Fix some dragging issues with XWayland -windowrule = nofocus,class:^$,title:^$,xwayland:1,floating:1,fullscreen:0,pinned:0 diff --git a/home/hyprland/settings.nix b/home/hyprland/settings.nix deleted file mode 100644 index 4351f17..0000000 --- a/home/hyprland/settings.nix +++ /dev/null @@ -1,85 +0,0 @@ -{ ... }: { - "$mod" = "SUPER"; - "$browser" = "zen"; - "$term" = "kitty"; - - general = { - border_size = 2; - gaps_in = 0; - gaps_out = 5; - layout = "dwindle"; - allow_tearing = false; - resize_on_border = true; - }; - - snap = { }; - - input = { - kb_layout = "de"; - follow_mouse = 1; - }; - - exec-once = [ - "hyprctl setcursor catppuccin-mocha-mauve-cursors 24" - ]; - - bind = - [ - "$mod, Q, exit" - "$mod, Return, exec, $term" - "$mod, D, exec, rofi -show drun -modes drun,calc" - "$mod, F2, exec, $browser" - "$mod, c, killactive" - "$mod, f, fullscreen" - "$mod, h, movefocus, l" - "$mod, j, movefocus, d" - "$mod, k, movefocus, u" - "$mod, l, movefocus, r" - "$mod+SHIFT, h, movewindow, l" - "$mod+SHIFT, j, movewindow, d" - "$mod+SHIFT, k, movewindow, u" - "$mod+SHIFT, l, movewindow, r" - ", Print, exec, grim -g \"$(slurp)\" \"/home/weckyy702/Pictures/screenshots/$(date -Iseconds).png\"" - "$mod+SHIFT, s, exec, hyprlock" - ] - ++ - # Switch workspaces - (map (i: "$mod, ${builtins.toString i}, workspace, ${builtins.toString i}") [ 1 2 3 4 5 6 7 8 9 ]) - ++ (map (i: "$mod+SHIFT, ${builtins.toString i}, movetoworkspacesilent, ${builtins.toString i}") [ 1 2 3 4 5 6 7 8 9 ]); - - bindm = [ - "$mod, mouse:272, movewindow" - ]; - - bindel = [ - ", XF86AudioRaiseVolume, exec, wpctl set-volume -l 1.5 @DEFAULT_AUDIO_SINK@ 5%+" - ", XF86AudioLowerVolume, exec, wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%-" - ]; - - bindl = [ - ", XF86AudioNext, exec, playerctl position 5+" - ", XF86AudioPrev, exec, playerctl position 5-" - ", XF86AudioPlay, exec, playerctl play-pause" - ]; - - bindo = [ - ", XF86AudioNext, exec, playerctl next" - ", XF86AudioPrev, exec, playerctl previous" - ]; - - decoration = { - shadow.enabled = false; - blur.enabled = true; - active_opacity = 0.8; - inactive_opacity = 0.8; - }; - - animations.enabled = false; - - misc.disable_hyprland_logo = true; - - cursor.inactive_timeout = 3; - - ecosystem.no_update_news = true; - ecosystem.no_donation_nag = true; -} diff --git a/home/ssh.nix b/home/ssh.nix deleted file mode 100644 index 7465559..0000000 --- a/home/ssh.nix +++ /dev/null @@ -1,32 +0,0 @@ -{ ... }: { - programs.ssh = { - enable = true; - enableDefaultConfig = false; - matchBlocks = { - "*" = { - forwardAgent = false; - addKeysToAgent = "no"; - compression = false; - serverAliveInterval = 0; - serverAliveCountMax = 3; - hashKnownHosts = false; - userKnownHostsFile = "~/.ssh/known_hosts"; - controlMaster = "no"; - controlPath = "~/.ssh/master-%r@%n:%p"; - controlPersist = "no"; - }; - "veltko.de" = { - user = "weckyy702"; - port = 47213; - }; - "duke.veltnet" = { - user = "konstantin"; - }; - #TODO: beastie - }; - }; - services.ssh-agent = { - enable = true; - enableZshIntegration = true; - }; -} diff --git a/modules/factory/autologin.nix b/modules/factory/autologin.nix new file mode 100644 index 0000000..70f0deb --- /dev/null +++ b/modules/factory/autologin.nix @@ -0,0 +1,22 @@ +{ inputs, ... }: { + config.flake.factory.autologin = username: { + imports = with inputs.self.modules.nixos; [ + ]; + services.getty.autologinUser = username; + + home-manager.sharedModules = [ + inputs.self.modules.homeManager.autologin + ]; + }; + + config.flake.modules.homeManager.autologin = { + imports = with inputs.self.modules.homeManager; [ + ]; + + programs.zsh.profileExtra = '' + if [ -z "$WAYLAND_DISPLAY" ] && [ "$XDG_VTNR" = 1 ]; then + exec hyprland + fi + ''; + }; +} diff --git a/modules/factory/flake-option.nix b/modules/factory/flake-option.nix new file mode 100644 index 0000000..534568d --- /dev/null +++ b/modules/factory/flake-option.nix @@ -0,0 +1,6 @@ +{ lib, ... }: { + options.flake.factory = lib.mkOption { + type = lib.types.attrsOf lib.types.unspecified; + default = { }; + }; +} diff --git a/modules/factory/grub-boot.nix b/modules/factory/grub-boot.nix new file mode 100644 index 0000000..95be47f --- /dev/null +++ b/modules/factory/grub-boot.nix @@ -0,0 +1,9 @@ +{ + config.flake.factory.grub-boot = device: { + boot.loader.grub = { + enable = true; + inherit device; + configurationLimit = 10; + }; + }; +} diff --git a/modules/factory/hyprpaper.nix b/modules/factory/hyprpaper.nix new file mode 100644 index 0000000..89680c3 --- /dev/null +++ b/modules/factory/hyprpaper.nix @@ -0,0 +1,19 @@ +{ + config.flake.factory.hyprpaper = + { wallpaper_path + , monitor_names + , + }: { config, ... }: { + services.hyprpaper = + /* + TODO: assert that hyprland is enabled + */ + { + enable = true; + settings = { + preload = [ wallpaper_path ]; + wallpaper = map (mon: "mon,${wallpaper_path}") monitor_names; + }; + }; + }; +} diff --git a/modules/factory/mount-cifs.nix b/modules/factory/mount-cifs.nix new file mode 100644 index 0000000..36de748 --- /dev/null +++ b/modules/factory/mount-cifs.nix @@ -0,0 +1,36 @@ +{ + config.flake.factory.mount-cifs = + { host + , resource + , destination + , credentials_path + , UID + , GID + , + }: { + fileSystems."${destination}" = { + device = "//${host}/${resource}"; + fsType = "cifs"; + options = [ + # automount + "x-systemd.automount" + "noauto" + "nofail" + "soft" + "x-systemd.idle-timeout=60" + "x-systemd.device-timeout=5s" + "x-systemd.mount-timeout=5s" + + # mount options + "rw" + "iocharset=utf8" + + # user + "uid=${UID}" + "gid=${GID}" + + "credentials=${credentials_path}" + ]; + }; + }; +} diff --git a/modules/factory/user.nix b/modules/factory/user.nix new file mode 100644 index 0000000..7e74bf6 --- /dev/null +++ b/modules/factory/user.nix @@ -0,0 +1,30 @@ +{ self, ... }: { + config.flake.factory.user = username: isAdmin: { + nixos."${username}" = + { lib + , pkgs + , ... + }: { + users.users."${username}" = { + isNormalUser = true; + home = "/home/${username}"; + extraGroups = lib.optionals isAdmin [ "wheel" ]; + shell = pkgs.zsh; + }; + + programs.zsh.enable = true; + # required for zsh completion + environment.pathsToLink = [ "/share/zsh" ]; + + home-manager.users."${username}" = { + imports = [ + self.modules.homeManager."${username}" + ]; + }; + }; + + homeManager."${username}" = { + home.username = "${username}"; + }; + }; +} diff --git a/modules/hosts/keith/configuration.nix b/modules/hosts/keith/configuration.nix new file mode 100644 index 0000000..10f3dc1 --- /dev/null +++ b/modules/hosts/keith/configuration.nix @@ -0,0 +1,14 @@ +{ inputs, ... }: { + flake.modules.nixos.keith = { + imports = with inputs.self.modules.nixos; + with inputs.self.factory; [ + system-desktop + (autologin "weckyy702") + (grub-boot "/dev/nvme0n1") + development-tools + i18n-de + + #TODO: moar aspects + ]; + }; +} diff --git a/modules/hosts/keith/filesystems.nix b/modules/hosts/keith/filesystems.nix new file mode 100644 index 0000000..2ab764c --- /dev/null +++ b/modules/hosts/keith/filesystems.nix @@ -0,0 +1,12 @@ +{ + flake.modules.nixos.keith = { + fileSystems."/" = { + device = "/dev/disk/by-uuid/0869e843-348d-47e3-b6a1-79ad814ff62b"; + fsType = "ext4"; + }; + + swapDevices = [ + { device = "/dev/disk/by-uuid/40b22e5b-839d-4189-93e7-246407cc76c7"; } + ]; + }; +} diff --git a/modules/hosts/keith/flake-parts.nix b/modules/hosts/keith/flake-parts.nix new file mode 100644 index 0000000..f1340cb --- /dev/null +++ b/modules/hosts/keith/flake-parts.nix @@ -0,0 +1,3 @@ +{ inputs, ... }: { + flake.nixosConfigurations = inputs.self.lib.mkNixos "x86_64-linux" "keith"; +} diff --git a/modules/hosts/keith/hardware.nix b/modules/hosts/keith/hardware.nix new file mode 100644 index 0000000..b654f43 --- /dev/null +++ b/modules/hosts/keith/hardware.nix @@ -0,0 +1,13 @@ +{ inputs, ... }: { + flake.modules.nixos.keith = { lib, ... }: { + hardware.enableRedistributableFirmware = true; + imports = with inputs.self.modules.nixos; [ + amd-gpu + ]; + + boot.initrd.availableKernelModules = [ "nvme" "xhci_pci" "ahci" "usbhid" "usb_storage" "sd_mod" ]; + + nixpkgs.hostPlatform = "x86_64-linux"; + hardware.cpu.amd.updateMicrocode = true; + }; +} diff --git a/modules/hosts/keith/networking.nix b/modules/hosts/keith/networking.nix new file mode 100644 index 0000000..8de15fb --- /dev/null +++ b/modules/hosts/keith/networking.nix @@ -0,0 +1,31 @@ +{ + flake.modules.nixos.keith = { + networking.hostName = "keith"; + + networking.networkmanager = { + enable = true; + ensureProfiles.profiles = { + p2p-nas = { + connection = { + id = "p2p-nas"; + type = "ethernet"; + interface-name = "enp1s0"; + autoconnect = true; + }; + ipv6 = { + method = "manual"; + addresses = "fd00:fa57::1/64"; + }; + ipv4.method = "disabled"; + ethernet.mtu = 9000; + }; + }; + }; + + networking.extraHosts = '' + fd00:fa57::2 duke.veltnet + ''; + + networking.firewall.enable = false; + }; +} diff --git a/modules/hosts/keith/users/weckyy702/filesystems.nix b/modules/hosts/keith/users/weckyy702/filesystems.nix new file mode 100644 index 0000000..e3e0fb2 --- /dev/null +++ b/modules/hosts/keith/users/weckyy702/filesystems.nix @@ -0,0 +1,6 @@ +{ + flake.modules.nixos.keith.fileSystems."/home/weckyy702/Documents" = { + device = "/dev/disk/by-uuid/2d6f2255-eca4-489b-9f0f-6c455cd394fc"; + fsType = "ext4"; + }; +} diff --git a/modules/hosts/keith/users/weckyy702/mount-nas.nix b/modules/hosts/keith/users/weckyy702/mount-nas.nix new file mode 100644 index 0000000..fb0eec8 --- /dev/null +++ b/modules/hosts/keith/users/weckyy702/mount-nas.nix @@ -0,0 +1,16 @@ +{ inputs, ... }: { + flake.modules.nixos.keith = { config, ... }: { + age.secrets."nas-creds".file = "${inputs.secrets}/nas-creds.age"; + + imports = with inputs.self.factory; [ + (mount-cifs { + host = "duke.veltnet"; + resource = "home"; + destination = "/home/weckyy702/duke"; + credentials_path = "${config.age.secrets.nas-creds.path}"; + UID = "weckyy702"; + GID = "users"; + }) + ]; + }; +} diff --git a/modules/hosts/keith/users/weckyy702/weckyy702.nix b/modules/hosts/keith/users/weckyy702/weckyy702.nix new file mode 100644 index 0000000..06fb76f --- /dev/null +++ b/modules/hosts/keith/users/weckyy702/weckyy702.nix @@ -0,0 +1,25 @@ +{ inputs, ... }: { + flake.modules.nixos.keith = { config, ... }: { + imports = with inputs.self.modules.nixos; [ + weckyy702 + steam + ]; + + home-manager.users.weckyy702 = { config, ... }: { + imports = with inputs.self.modules.homeManager; + with inputs.self.factory; [ + (hyprpaper { + wallpaper_path = "${inputs.assets}/horizontal_16x9.png"; + monitor_names = [ + "DP-1" + "HDMI-A-1" + ]; + }) + vesktop + spicetify + borgmatic + qbittorrent + ]; + }; + }; +} diff --git a/modules/nix/assets.nix b/modules/nix/assets.nix new file mode 100644 index 0000000..e74ae63 --- /dev/null +++ b/modules/nix/assets.nix @@ -0,0 +1,8 @@ +{ + flake-file.inputs = { + assets = { + url = "path:./assets"; + flake = false; + }; + }; +} diff --git a/modules/nix/flake-parts/flake-file.nix b/modules/nix/flake-parts/flake-file.nix new file mode 100644 index 0000000..a06d158 --- /dev/null +++ b/modules/nix/flake-parts/flake-file.nix @@ -0,0 +1,22 @@ +{ inputs, ... }: { + imports = [ + inputs.flake-parts.flakeModules.modules + inputs.flake-file.flakeModules.default + ]; + + flake-file.inputs = { + flake-parts.url = "github:hercules-ci/flake-parts"; + flake-file.url = "github:vic/flake-file"; + import-tree.url = "github:vic/import-tree"; + }; + + flake-file.outputs = '' + inputs: inputs.flake-parts.lib.mkFlake { inherit inputs; } (inputs.import-tree ./modules) + ''; + + systems = [ + # f Darwin >:( + "aarch64-linux" + "x86_64-linux" + ]; +} diff --git a/modules/nix/flake-parts/lib.nix b/modules/nix/flake-parts/lib.nix new file mode 100644 index 0000000..7b858fd --- /dev/null +++ b/modules/nix/flake-parts/lib.nix @@ -0,0 +1,33 @@ +{ inputs +, lib +, ... +}: { + # Helper functions for creating system / home-manager configurations + + options.flake.lib = lib.mkOption { + type = lib.types.attrsOf lib.types.unspecified; + default = { }; + }; + + config.flake.lib = { + mkNixos = system: name: { + ${name} = inputs.nixpkgs.lib.nixosSystem { + modules = [ + inputs.self.modules.nixos.${name} + { nixpkgs.hostPlatform = lib.mkDefault system; } + { nixpkgs.config.allowUnfree = true; } + ]; + }; + }; + + mkHomeManager = system: name: { + ${name} = inputs.home-manager.lib.homeManagerConfiguration { + pkgs = inputs.nixpkgs.legacyPackages.${system}; + modules = [ + inputs.self.modules.homeManager.${name} + { nixpkgs.config.allowUnfree = true; } + ]; + }; + }; + }; +} diff --git a/modules/nix/tools/home-manager.nix b/modules/nix/tools/home-manager.nix new file mode 100644 index 0000000..4de7145 --- /dev/null +++ b/modules/nix/tools/home-manager.nix @@ -0,0 +1,23 @@ +{ inputs +, config +, ... +}: { + # Add home-manager input + flake-file.inputs = { + home-manager.url = "github:nix-community/home-manager/release-25.11"; + home-manager.inputs.nixpkgs.follows = "nixpkgs"; + }; + + imports = [ inputs.home-manager.flakeModules.home-manager ]; + + flake.modules.nixos.home-manager = { + imports = [ + inputs.home-manager.nixosModules.home-manager + ]; + + home-manager = { + verbose = true; + useGlobalPkgs = true; + }; + }; +} diff --git a/modules/nix/tools/secrets.nix b/modules/nix/tools/secrets.nix new file mode 100644 index 0000000..74f3dd8 --- /dev/null +++ b/modules/nix/tools/secrets.nix @@ -0,0 +1,26 @@ +{ inputs, ... }: { + flake-file.inputs = { + agenix = { + url = "github:ryantm/agenix"; + inputs.nixpkgs.follows = "nixpkgs"; + inputs.home-manager.follows = "home-manager"; + }; + secrets = { + url = "path:./secrets"; + flake = false; + }; + }; + + flake.modules.nixos.secrets = { pkgs, ... }: { + imports = [ + inputs.agenix.nixosModules.default + ]; + environment.systemPackages = [ inputs.agenix.packages.${pkgs.stdenv.hostPlatform.system}.default ]; + }; + + flake.modules.homeManager.secrets = { pkgs, ... }: { + imports = [ + inputs.agenix.homeManagerModules.default + ]; + }; +} diff --git a/modules/programs/browser.nix b/modules/programs/browser.nix new file mode 100644 index 0000000..60c0b43 --- /dev/null +++ b/modules/programs/browser.nix @@ -0,0 +1,14 @@ +{ inputs, ... }: { + flake-file.inputs = { + zen-browser = { + url = "github:youwen5/zen-browser-flake"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + }; + + flake.modules.homeManager.browser = { pkgs, ... }: { + home.packages = [ + inputs.zen-browser.packages.${pkgs.stdenv.hostPlatform.system}.default + ]; + }; +} diff --git a/modules/programs/btop.nix b/modules/programs/btop.nix new file mode 100644 index 0000000..317d742 --- /dev/null +++ b/modules/programs/btop.nix @@ -0,0 +1,7 @@ +{ + flake.modules.homeManager.btop = { pkgs, ... }: { + home.packages = with pkgs; [ + btop + ]; + }; +} diff --git a/modules/programs/catppuccin.nix b/modules/programs/catppuccin.nix new file mode 100644 index 0000000..fc66816 --- /dev/null +++ b/modules/programs/catppuccin.nix @@ -0,0 +1,48 @@ +{ inputs, ... }: { + flake-file.inputs = { + catppuccin.url = "github:catppuccin/nix/release-25.11"; + catppuccin.inputs.nixpkgs.follows = "nixpkgs"; + }; + + flake.modules.nixos.catppuccin = { + imports = [ + inputs.catppuccin.nixosModules.catppuccin + ]; + + home-manager.sharedModules = [ + inputs.self.modules.homeManager.catppuccin + ]; + + catppuccin.enable = true; + }; + + flake.modules.homeManager.catppuccin = { pkgs, ... }: { + imports = [ + inputs.catppuccin.homeModules.catppuccin + ]; + + # Catppuccin cursor + home.pointerCursor = + let + size = 24; + in + { + enable = true; + package = pkgs.catppuccin-cursors.mochaMauve; + name = "catppuccin-mocha-mauve-cursors"; + inherit size; + + dotIcons.enable = true; + gtk.enable = true; + hyprcursor.enable = true; + hyprcursor.size = size; + }; + + catppuccin.enable = true; + # Required for QT apps to use the catppuccin colors + qt = { + enable = true; + style.name = "kvantum"; + }; + }; +} diff --git a/modules/programs/cli-tools.nix b/modules/programs/cli-tools.nix new file mode 100644 index 0000000..393624e --- /dev/null +++ b/modules/programs/cli-tools.nix @@ -0,0 +1,9 @@ +{ + flake.modules.nixos.cli-tools = { pkgs, ... }: { + environment.systemPackages = with pkgs; [ + git + htop + vim + ]; + }; +} diff --git a/modules/programs/development-tools/development-tools.nix b/modules/programs/development-tools/development-tools.nix new file mode 100644 index 0000000..d302678 --- /dev/null +++ b/modules/programs/development-tools/development-tools.nix @@ -0,0 +1,14 @@ +{ inputs, ... }: { + flake.modules.nixos.development-tools = { pkgs, ... }: { + imports = with inputs.self.modules.nixos; [ + rust + ]; + + environment.systemPackages = with pkgs; [ + cmake + gnumake + clang + gcc + ]; + }; +} diff --git a/modules/programs/development-tools/rust.nix b/modules/programs/development-tools/rust.nix new file mode 100644 index 0000000..477b639 --- /dev/null +++ b/modules/programs/development-tools/rust.nix @@ -0,0 +1,18 @@ +{ inputs, ... }: { + flake-file.inputs = { + rust-overlay = { + url = "github:oxalica/rust-overlay"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + }; + + flake.modules.nixos.rust = { pkgs, ... }: { + nixpkgs.overlays = [ + inputs.rust-overlay.overlays.default + ]; + + environment.systemPackages = with pkgs; [ + rust-bin.stable.latest.default + ]; + }; +} diff --git a/modules/programs/direnv.nix b/modules/programs/direnv.nix new file mode 100644 index 0000000..62a5c94 --- /dev/null +++ b/modules/programs/direnv.nix @@ -0,0 +1,9 @@ +{ + flake.modules.homeManager.direnv = { + programs.direnv = { + enable = true; + enableZshIntegration = true; + nix-direnv.enable = true; + }; + }; +} diff --git a/modules/programs/fzf.nix b/modules/programs/fzf.nix new file mode 100644 index 0000000..b8bbe9e --- /dev/null +++ b/modules/programs/fzf.nix @@ -0,0 +1,8 @@ +{ + flake.modules.homeManager.fzf = { + programs.fzf = { + enable = true; + enableZshIntegration = true; + }; + }; +} diff --git a/modules/programs/git.nix b/modules/programs/git.nix new file mode 100644 index 0000000..b59556d --- /dev/null +++ b/modules/programs/git.nix @@ -0,0 +1,16 @@ +{ + flake.modules.nixos.git = { pkgs, ... }: { + environment.systemPackages = [ pkgs.git ]; + }; + + flake.modules.homeManager.git = { + programs.git = { + enable = true; + settings.user = { + email = "weckyy702@gmail.com"; + name = "Weckyy702"; + }; + #TODO: signing + }; + }; +} diff --git a/modules/programs/gnupg.nix b/modules/programs/gnupg.nix new file mode 100644 index 0000000..613e782 --- /dev/null +++ b/modules/programs/gnupg.nix @@ -0,0 +1,8 @@ +{ + flake.modules.nixos.gnupg = { + programs.gnupg.agent = { + enable = true; + enableSSHSupport = true; + }; + }; +} diff --git a/modules/programs/hyprland/hyprland.nix b/modules/programs/hyprland/hyprland.nix new file mode 100644 index 0000000..4a41d07 --- /dev/null +++ b/modules/programs/hyprland/hyprland.nix @@ -0,0 +1,20 @@ +{ inputs, ... }: { + flake.modules.nixos.hyprland = { + programs.hyprland.enable = true; + # Force electron apps to use wayland + environment.sessionVariables.NIXOS_OZONE_WL = "1"; + + home-manager.sharedModules = [ + inputs.self.modules.homeManager.hyprland + ]; + }; + + flake.modules.homeManager.hyprland = { pkgs, ... }: { + wayland.windowManager.hyprland.enable = true; + services.hyprpolkitagent.enable = true; + + home.packages = with pkgs; [ + hyprpicker + ]; + }; +} diff --git a/modules/programs/hyprland/settings.nix b/modules/programs/hyprland/settings.nix new file mode 100644 index 0000000..f70be64 --- /dev/null +++ b/modules/programs/hyprland/settings.nix @@ -0,0 +1,89 @@ +{ + flake.modules.homeManager.hyprland = { + wayland.windowManager.hyprland.settings = { + "$mod" = "SUPER"; + "$browser" = "zen"; + "$term" = "kitty"; + + general = { + border_size = 2; + gaps_in = 0; + gaps_out = 5; + layout = "dwindle"; + allow_tearing = false; + resize_on_border = true; + }; + + snap = { }; + + input = { + kb_layout = "de"; + follow_mouse = 1; + }; + + exec-once = [ + "hyprctl setcursor catppuccin-mocha-mauve-cursors 24" + ]; + + bind = + [ + "$mod, Q, exit" + "$mod, Return, exec, $term" + "$mod, D, exec, rofi -show drun -modes drun,calc" + "$mod, F2, exec, $browser" + "$mod, c, killactive" + "$mod, f, fullscreen" + "$mod, h, movefocus, l" + "$mod, j, movefocus, d" + "$mod, k, movefocus, u" + "$mod, l, movefocus, r" + "$mod+SHIFT, h, movewindow, l" + "$mod+SHIFT, j, movewindow, d" + "$mod+SHIFT, k, movewindow, u" + "$mod+SHIFT, l, movewindow, r" + ", Print, exec, grim -g \"$(slurp)\" \"/home/weckyy702/Pictures/screenshots/$(date -Iseconds).png\"" + "$mod+SHIFT, s, exec, hyprlock" + ] + ++ + # Switch workspaces + (map (i: "$mod, ${builtins.toString i}, workspace, ${builtins.toString i}") [ 0 1 2 3 4 5 6 7 8 9 ]) + ++ (map (i: "$mod+SHIFT, ${builtins.toString i}, movetoworkspacesilent, ${builtins.toString i}") [ 0 1 2 3 4 5 6 7 8 9 ]); + + bindm = [ + "$mod, mouse:272, movewindow" + ]; + + bindel = [ + ", XF86AudioRaiseVolume, exec, wpctl set-volume -l 1.5 @DEFAULT_AUDIO_SINK@ 5%+" + ", XF86AudioLowerVolume, exec, wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%-" + ]; + + bindl = [ + ", XF86AudioNext, exec, playerctl position 5+" + ", XF86AudioPrev, exec, playerctl position 5-" + ", XF86AudioPlay, exec, playerctl play-pause" + ]; + + bindo = [ + ", XF86AudioNext, exec, playerctl next" + ", XF86AudioPrev, exec, playerctl previous" + ]; + + decoration = { + shadow.enabled = false; + blur.enabled = true; + active_opacity = 0.8; + inactive_opacity = 0.8; + }; + + animations.enabled = false; + + misc.disable_hyprland_logo = true; + + cursor.inactive_timeout = 3; + + ecosystem.no_update_news = true; + ecosystem.no_donation_nag = true; + }; + }; +} diff --git a/modules/programs/kitty/config.nix b/modules/programs/kitty/config.nix new file mode 100644 index 0000000..18046c2 --- /dev/null +++ b/modules/programs/kitty/config.nix @@ -0,0 +1,5 @@ +{ + flake.modules.homeManager.kitty = { + #TODO: kitty config + }; +} diff --git a/modules/programs/kitty/kitty.nix b/modules/programs/kitty/kitty.nix new file mode 100644 index 0000000..bdf6f22 --- /dev/null +++ b/modules/programs/kitty/kitty.nix @@ -0,0 +1,14 @@ +{ + flake.modules.homeManager.kitty = { + programs.kitty = { + enable = true; + enableGitIntegration = true; + font = { + name = "JetBrains Mono"; + size = 10; + }; + shellIntegration.enableZshIntegration = true; + #TODO: kitty config + }; + }; +} diff --git a/modules/programs/multimedia.nix b/modules/programs/multimedia.nix new file mode 100644 index 0000000..86d811f --- /dev/null +++ b/modules/programs/multimedia.nix @@ -0,0 +1,11 @@ +{ + flake.modules.homeManager.multimedia = { pkgs, ... }: { + home.packages = with pkgs; [ + feh + mpv + playerctl + file + zathura + ]; + }; +} diff --git a/home/nixvim/default.nix b/modules/programs/nixvim/_nixvim-config/default.nix similarity index 100% rename from home/nixvim/default.nix rename to modules/programs/nixvim/_nixvim-config/default.nix diff --git a/home/nixvim/keymaps.nix b/modules/programs/nixvim/_nixvim-config/keymaps.nix similarity index 100% rename from home/nixvim/keymaps.nix rename to modules/programs/nixvim/_nixvim-config/keymaps.nix diff --git a/home/nixvim/options.nix b/modules/programs/nixvim/_nixvim-config/options.nix similarity index 100% rename from home/nixvim/options.nix rename to modules/programs/nixvim/_nixvim-config/options.nix diff --git a/home/nixvim/plugins/cmp/default.nix b/modules/programs/nixvim/_nixvim-config/plugins/cmp/default.nix similarity index 100% rename from home/nixvim/plugins/cmp/default.nix rename to modules/programs/nixvim/_nixvim-config/plugins/cmp/default.nix diff --git a/home/nixvim/plugins/cmp/keymaps.nix b/modules/programs/nixvim/_nixvim-config/plugins/cmp/keymaps.nix similarity index 100% rename from home/nixvim/plugins/cmp/keymaps.nix rename to modules/programs/nixvim/_nixvim-config/plugins/cmp/keymaps.nix diff --git a/home/nixvim/plugins/default.nix b/modules/programs/nixvim/_nixvim-config/plugins/default.nix similarity index 100% rename from home/nixvim/plugins/default.nix rename to modules/programs/nixvim/_nixvim-config/plugins/default.nix diff --git a/home/nixvim/plugins/lsp.nix b/modules/programs/nixvim/_nixvim-config/plugins/lsp.nix similarity index 100% rename from home/nixvim/plugins/lsp.nix rename to modules/programs/nixvim/_nixvim-config/plugins/lsp.nix diff --git a/home/nixvim/plugins/telescope/default.nix b/modules/programs/nixvim/_nixvim-config/plugins/telescope/default.nix similarity index 100% rename from home/nixvim/plugins/telescope/default.nix rename to modules/programs/nixvim/_nixvim-config/plugins/telescope/default.nix diff --git a/home/nixvim/plugins/telescope/keymaps.nix b/modules/programs/nixvim/_nixvim-config/plugins/telescope/keymaps.nix similarity index 100% rename from home/nixvim/plugins/telescope/keymaps.nix rename to modules/programs/nixvim/_nixvim-config/plugins/telescope/keymaps.nix diff --git a/modules/programs/nixvim/nixvim.nix b/modules/programs/nixvim/nixvim.nix new file mode 100644 index 0000000..fa1a492 --- /dev/null +++ b/modules/programs/nixvim/nixvim.nix @@ -0,0 +1,19 @@ +{ inputs, ... }: { + flake-file.inputs = { + nixvim.url = "github:nix-community/nixvim/nixos-25.11"; + nixvim.inputs.nixpkgs.follows = "nixpkgs"; + }; + + flake.modules.homeManager.nixvim = { + imports = [ + inputs.nixvim.homeModules.nixvim + ]; + + programs.nixvim = { + enable = true; + imports = [ ./_nixvim-config ]; + }; + + home.sessionVariables.EDITOR = "nvim"; + }; +} diff --git a/modules/programs/qbittorrent.nix b/modules/programs/qbittorrent.nix new file mode 100644 index 0000000..ecff843 --- /dev/null +++ b/modules/programs/qbittorrent.nix @@ -0,0 +1,7 @@ +{ + flake.modules.homeManager.qbittorrent = { pkgs, ... }: { + home.packages = with pkgs; [ + qbittorrent + ]; + }; +} diff --git a/modules/programs/rofi.nix b/modules/programs/rofi.nix new file mode 100644 index 0000000..acc734d --- /dev/null +++ b/modules/programs/rofi.nix @@ -0,0 +1,15 @@ +{ + flake.modules.homeManager.rofi = { pkgs, ... }: { + programs.rofi = { + enable = true; + modes = [ + "combi" + "drun" + "calc" + ]; + plugins = [ + pkgs.rofi-calc + ]; + }; + }; +} diff --git a/modules/programs/spicetify.nix b/modules/programs/spicetify.nix new file mode 100644 index 0000000..de3c0a3 --- /dev/null +++ b/modules/programs/spicetify.nix @@ -0,0 +1,30 @@ +{ inputs, ... }: { + flake-file.inputs = { + spicetify-nix.url = "github:Gerg-L/spicetify-nix"; + spicetify-nix.inputs.nixpkgs.follows = "nixpkgs"; + }; + + flake.modules.homeManager.spicetify = { pkgs, ... }: { + imports = [ + inputs.spicetify-nix.homeManagerModules.default + ]; + + programs.spicetify = + let + spkgs = inputs.spicetify-nix.legacyPackages.${pkgs.stdenv.hostPlatform.system}; + in + { + enable = true; + enabledExtensions = with spkgs.extensions; [ + fullAppDisplay + shuffle + aiBandBlocker + ]; + enabledCustomApps = with spkgs.apps; [ + newReleases + ]; + theme = spkgs.themes.catppuccin; + colorScheme = "mocha"; + }; + }; +} diff --git a/modules/programs/steam.nix b/modules/programs/steam.nix new file mode 100644 index 0000000..2b9803c --- /dev/null +++ b/modules/programs/steam.nix @@ -0,0 +1,16 @@ +{ + flake.modules.nixos.steam = { pkgs, ... }: { + programs.steam = { + enable = true; + extraCompatPackages = [ + pkgs.proton-ge-bin + ]; + protontricks = { + enable = true; + }; + dedicatedServer.openFirewall = true; + localNetworkGameTransfers.openFirewall = true; + remotePlay.openFirewall = true; + }; + }; +} diff --git a/modules/programs/thunderbird.nix b/modules/programs/thunderbird.nix new file mode 100644 index 0000000..480379f --- /dev/null +++ b/modules/programs/thunderbird.nix @@ -0,0 +1,9 @@ +# might make this bad boy a factory later +{ + flake.modules.homeManager.thunderbird = { + programs.thunderbird = { + enable = true; + profiles.default.isDefault = true; + }; + }; +} diff --git a/modules/programs/vesktop.nix b/modules/programs/vesktop.nix new file mode 100644 index 0000000..a32807c --- /dev/null +++ b/modules/programs/vesktop.nix @@ -0,0 +1,5 @@ +{ + flake.modules.homeManager.vesktop = { + programs.vesktop.enable = true; + }; +} diff --git a/modules/programs/zathura.nix b/modules/programs/zathura.nix new file mode 100644 index 0000000..8b2724b --- /dev/null +++ b/modules/programs/zathura.nix @@ -0,0 +1,5 @@ +{ + flake.modules.homeManager.zathura = { + programs.zathura.enable = true; + }; +} diff --git a/modules/programs/zoxide.nix b/modules/programs/zoxide.nix new file mode 100644 index 0000000..4dc485a --- /dev/null +++ b/modules/programs/zoxide.nix @@ -0,0 +1,9 @@ +{ + flake.modules.homeManager.zoxide = { + programs.zoxide = { + enable = true; + enableZshIntegration = true; + options = [ "--cmd cd" ]; + }; + }; +} diff --git a/home/p10k/p10k.zsh b/modules/programs/zsh/p10k/p10k.zsh similarity index 100% rename from home/p10k/p10k.zsh rename to modules/programs/zsh/p10k/p10k.zsh diff --git a/modules/programs/zsh/zsh.nix b/modules/programs/zsh/zsh.nix new file mode 100644 index 0000000..a981965 --- /dev/null +++ b/modules/programs/zsh/zsh.nix @@ -0,0 +1,53 @@ +{ inputs, ... }: { + flake.modules.nixos.zsh = { + programs.zsh.enable = true; + + environment.pathsToLink = [ "/share/zsh" ]; + }; + + flake.modules.homeManager.zsh = { pkgs, ... }: { + imports = with inputs.self.modules.homeManager; [ + fzf + zoxide + ]; + + programs.zsh = { + enable = true; + + autocd = true; + enableCompletion = true; + autosuggestion.enable = true; + syntaxHighlighting.enable = true; + initContent = pkgs.lib.mkBefore '' + date + # Enable Powerlevel10k instant prompt. Should stay close to the top of ~/.zshrc. + # Initialization code that may require console input (password prompts, [y/n] + # confirmations, etc.) must go above this block; everything else may go below. + if [[ -r "''${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-''${(%):-%n}.zsh" ]]; then + source "''${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-''${(%):-%n}.zsh" + fi + ''; + + plugins = [ + { + name = "powerlevel10k"; + src = "${pkgs.zsh-powerlevel10k}/share/zsh-powerlevel10k/"; + file = "powerlevel10k.zsh-theme"; + } + { + name = "p10k-config"; + src = ./p10k; + file = "p10k.zsh"; + } + ]; + + oh-my-zsh = { + enable = true; + plugins = [ + "git" + ]; + theme = "robbyrussell"; + }; + }; + }; +} diff --git a/modules/services/borgmatic.nix b/modules/services/borgmatic.nix new file mode 100644 index 0000000..c5dedc3 --- /dev/null +++ b/modules/services/borgmatic.nix @@ -0,0 +1,67 @@ +{ + flake.modules.homeManager.borgmatic = + { config + , pkgs + , ... + }: + let + hostname = config.networking.hostname; + username = config.home.username; + in + { + home.packages = with pkgs; [ + libnotify + ]; + + programs.borgmatic = { + backups.default = { + location = { + repositories = [ + { + label = "duke"; + path = "ssh://borg@duke.veltnet:2222/home/borg/backups/${hostname}-${username}"; + } + ]; + excludeHomeManagerSymlinks = true; + patterns = [ + #TODO: home.homeDirectory might be usable here + "R /home/${username}/Documents" + "R /home/${username}/.ssh" + "- /home/${username}/Documents/SteamLibrary" + "- /home/${username}/Documents/PrismLauncher instances" + "- /home/${username}/Documents/.Trash-1000" + "- /home/${username}/Documents/VMs/Data" + "- **/node_modules" + "- **/.git" + "- **/.cache" + "- **/*build" + "- **/target" + "- **/.venv" + "- **/venv" + "- **/.gradle" + "- **/out" + "- **/dist" + "- **/.pio" + ]; + }; + retention.keepWeekly = 2; + storage.extraConfig.ssh_command = "ssh -i /home/${username}/.ssh/id_ed25519_borg"; + #FIXME: consistency checks!!! + }; + }; + + systemd.user.services.borgmatic = { + Unit.Description = "Create a backup using borgmatic"; + Service.ExecStart = "${pkgs.borgmatic}/bin/borgmatic create --stats"; + }; + + systemd.user.timers.borgmatic = { + Unit.Description = "Create weekly backups using borgmatic"; + Timer = { + OnCalendar = "Weekly"; + Persistent = true; + }; + Install.WantedBy = [ "timers.target" ]; + }; + }; +} diff --git a/modules/services/debuginfo.nix b/modules/services/debuginfo.nix new file mode 100644 index 0000000..ac8cf75 --- /dev/null +++ b/modules/services/debuginfo.nix @@ -0,0 +1,5 @@ +{ + flake.modules.nixos.debuginfod = { + services.nixseparatedebuginfod2.enable = true; + }; +} diff --git a/modules/services/kanata.nix b/modules/services/kanata.nix new file mode 100644 index 0000000..29cd54f --- /dev/null +++ b/modules/services/kanata.nix @@ -0,0 +1,47 @@ +{ + flake.modules.nixos.kanata = { + services.kanata = { + enable = true; + #TODO: move kanata config to module + keyboards.remap-specials = { + config = '' + (deflocalkeys-linux + ö 39 + ) + + (defsrc + a s d j k l ö + ) + + (defvar + tap-time 200 + hold-time 200 + ) + + (defalias + a (tap-hold $tap-time $hold-time a lmet) + s (tap-hold $tap-time $hold-time s lctl) + d (tap-hold $tap-time $hold-time d lsft) + k (tap-hold $tap-time $hold-time k rsft) + l (tap-hold $tap-time $hold-time l rctl) + ö (tap-hold $tap-time $hold-time ö ralt) + + activate (tap-dance $tap-time (j _ _ (layer-switch home-mods))) + deactivate (tap-dance $tap-time (j _ _ (layer-switch base))) + ) + + (deflayer base + a s d @activate k l ö + ) + + (deflayer home-mods + @a @s @d @deactivate @k @l @ö + ) + ''; + extraDefCfg = '' + process-unmapped-keys yes + ''; + }; + }; + }; +} diff --git a/modules/services/mullvad.nix b/modules/services/mullvad.nix new file mode 100644 index 0000000..e1e87f6 --- /dev/null +++ b/modules/services/mullvad.nix @@ -0,0 +1,5 @@ +{ + flake.modules.nixos.mullvad = { + services.mullvad-vpn.enable = true; + }; +} diff --git a/modules/services/openssh.nix b/modules/services/openssh.nix new file mode 100644 index 0000000..27cea29 --- /dev/null +++ b/modules/services/openssh.nix @@ -0,0 +1,6 @@ +{ + flake.modules.nixos.openssh = { lib, ... }: { + services.openssh.enable = true; + services.openssh.openFirewall = lib.mkDefault false; + }; +} diff --git a/modules/services/pipewire.nix b/modules/services/pipewire.nix new file mode 100644 index 0000000..74645ce --- /dev/null +++ b/modules/services/pipewire.nix @@ -0,0 +1,9 @@ +{ + flake.modules.nixos.pipewire = { + services.pipewire = { + alsa.enable = true; + enable = true; + wireplumber.enable = true; + }; + }; +} diff --git a/modules/system-settings/amd-gpu.nix b/modules/system-settings/amd-gpu.nix new file mode 100644 index 0000000..174b96e --- /dev/null +++ b/modules/system-settings/amd-gpu.nix @@ -0,0 +1,18 @@ +{ + flake.modules.nixos.amd-gpu = { pkgs, ... }: { + environment.systemPackages = with pkgs; [ + rocmPackages.amdsmi + ]; + + boot.kernelModules = [ "kvm-amd" ]; + + hardware.graphics = { + enable = true; + extraPackages = [ pkgs.rocmPackages.clr.icd ]; + }; + hardware.amdgpu = { + initrd.enable = true; + opencl.enable = true; + }; + }; +} diff --git a/modules/system-settings/i18n-de.nix b/modules/system-settings/i18n-de.nix new file mode 100644 index 0000000..3894738 --- /dev/null +++ b/modules/system-settings/i18n-de.nix @@ -0,0 +1,23 @@ +{ + flake.modules.nixos.i18n-de = { + time.timeZone = "Europe/Berlin"; + + # Select internationalisation properties. + i18n.defaultLocale = "en_US.UTF-8"; + + i18n.extraLocaleSettings = { + LC_ADDRESS = "de_DE.UTF-8"; + LC_IDENTIFICATION = "de_DE.UTF-8"; + LC_MEASUREMENT = "de_DE.UTF-8"; + LC_MONETARY = "de_DE.UTF-8"; + LC_NAME = "de_DE.UTF-8"; + LC_NUMERIC = "de_DE.UTF-8"; + LC_PAPER = "de_DE.UTF-8"; + LC_TELEPHONE = "de_DE.UTF-8"; + LC_TIME = "de_DE.UTF-8"; + }; + + # Configure console keymap + console.keyMap = "de"; + }; +} diff --git a/modules/system-settings/linux-latest.nix b/modules/system-settings/linux-latest.nix new file mode 100644 index 0000000..0b0636e --- /dev/null +++ b/modules/system-settings/linux-latest.nix @@ -0,0 +1,5 @@ +{ + flake.modules.nixos.linux-latest = { pkgs, ... }: { + boot.kernelPackages = pkgs.linuxPackages_latest; + }; +} diff --git a/modules/system-settings/nerdfonts.nix b/modules/system-settings/nerdfonts.nix new file mode 100644 index 0000000..6c7c2aa --- /dev/null +++ b/modules/system-settings/nerdfonts.nix @@ -0,0 +1,11 @@ +{ + flake.modules.nixos.nerdfonts = { pkgs, ... }: { + fonts = { + enableDefaultPackages = true; + packages = with pkgs; [ + nerd-fonts.jetbrains-mono + ]; + fontDir.enable = true; + }; + }; +} diff --git a/modules/system-types/base/homeManager.nix b/modules/system-types/base/homeManager.nix new file mode 100644 index 0000000..10e617d --- /dev/null +++ b/modules/system-types/base/homeManager.nix @@ -0,0 +1,9 @@ +{ inputs, ... }: { + flake.modules.homeManager.system-base = { config, ... }: { + imports = with inputs.self.modules.homeManager; [ + ]; + + home.homeDirectory = "/home/${config.home.username}"; + home.stateVersion = "25.11"; + }; +} diff --git a/modules/system-types/base/nixos.nix b/modules/system-types/base/nixos.nix new file mode 100644 index 0000000..0ae0bd0 --- /dev/null +++ b/modules/system-types/base/nixos.nix @@ -0,0 +1,65 @@ +{ inputs, ... }: { + flake-file.inputs = { + nixpkgs.url = "github:nixos/nixpkgs/nixos-25.11"; + nixpkgs-unstable.url = "github:nixos/nixpkgs/nixos-unstable"; + }; + + flake.modules.nixos.system-base = { pkgs, ... }: { + imports = with inputs.self.modules.nixos; [ + home-manager + secrets + openssh + linux-latest + cli-tools + zsh + gnupg + ]; + + # Make unstable nixpkgs available as pkgs.unstable + nixpkgs.overlays = [ + (final: _prev: { + unstable = import inputs.nixpkgs-unstable { + inherit (final) config; + system = pkgs.stdenv.hostPlatform.system; + }; + }) + ]; + nixpkgs.config.allowUnfree = true; + + nix.gc = { + automatic = true; + dates = "weekly"; + options = "--delete-older-than 7d"; + }; + + nix.settings = { + substituters = [ + # high priority since it's almost always used + "https://cache.nixos.org?priority=10" + "https://install.determinate.systems" + "https://nix-community.cachix.org" + ]; + + trusted-public-keys = [ + "cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY=" + "cache.flakehub.com-3:hJuILl5sVK4iKm86JzgdXW12Y2Hwd5G07qKtHTOcDCM" + "nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs=" + ]; + + experimental-features = [ + "nix-command" + "flakes" + # "allow-import-from-derivation" + ]; + + download-buffer-size = 1024 * 1024 * 1024; + + trusted-users = [ + "root" + "@wheel" + ]; + }; + + system.stateVersion = "25.11"; + }; +} diff --git a/modules/system-types/desktop/desktop.nix b/modules/system-types/desktop/desktop.nix new file mode 100644 index 0000000..7c072a2 --- /dev/null +++ b/modules/system-types/desktop/desktop.nix @@ -0,0 +1,28 @@ +{ inputs, ... }: { + flake.modules.nixos.system-desktop = { + imports = with inputs.self.modules.nixos; [ + system-base + hyprland + + #TODO: moar aspects + ]; + + home-manager.sharedModules = [ + inputs.self.modules.homeManager.system-desktop + ]; + }; + + flake.modules.homeManager.system-desktop = { + imports = with inputs.self.modules.homeManager; [ + system-base + + rofi + kitty + + browser + multimedia + zsh + thunderbird + ]; + }; +} diff --git a/modules/users/weckyy702/weckyy702.nix b/modules/users/weckyy702/weckyy702.nix new file mode 100644 index 0000000..e8ace79 --- /dev/null +++ b/modules/users/weckyy702/weckyy702.nix @@ -0,0 +1,29 @@ +{ inputs +, self +, lib +, ... +}: { + flake.homeConfigurations = inputs.self.lib.mkHomeManager "x86_64-linux" "weckyy702"; + + flake.modules = lib.mkMerge [ + (self.factory.user "weckyy702" true) + { + nixos.weckyy702 = { + imports = with self.modules.nixos; [ + kanata + catppuccin + ]; + + users.users.weckyy702.extraGroups = [ "networkmanager" "dialout" ]; + }; + + homeManager.weckyy702 = { pkgs, ... }: { + imports = with self.modules.homeManager; [ + nixvim + btop + #TODO: moar aspects + ]; + }; + } + ]; +} diff --git a/secrets/nas-creds.age b/secrets/nas-creds.age new file mode 100644 index 0000000..e61eabb --- /dev/null +++ b/secrets/nas-creds.age @@ -0,0 +1,12 @@ +-----BEGIN AGE ENCRYPTED FILE----- +YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IHNzaC1lZDI1NTE5IFNjTWNPZyB6Mzk1 +MWl5cW5uNkc0WTFUTEF1TGFOS0J3a1YyRzJieTlDOGVPbm84WVVNCjJUNlp5K3Ny +YUhMdWp2Zk5tNGp1TkxKcnNST2h1N0VrVnNiaUZzV21QUFUKLT4gc3NoLWVkMjU1 +MTkgZkJwNFR3IDR5UFhoTkNOUlJyVmovMUQzTExGK2Y2bFZPMW9ZZFdQTFliUFVj +WDRPM2cKSjFQVWhVZXFMY0ZzdDEraXdkeW1BVkRtemFQdHYzeUI4ZjhrNFdsdmo1 +WQotPiBzc2gtZWQyNTUxOSBZazBxSWcgOUJxQkMzYzFrYWhVOTVFTnNvVmI1WDBn +U2ZCVDU0WTliQzRxTVZKdCtCdwpYbUlJVmNHaHpuY0dJMldJSEFkbmpkZTlmTkI1 +Y3lhQWRBaWdNOGpvcHdzCi0tLSA0dm04SEovSnZ5dW9MaTdxV1NSUGxnZ3orTzNy +WUt6eUt6TFAyTGFhdWFVCs0loU4KFs/vYaJX4d31Gf1y8Fv/jWEIALZ4KIqbEPPf +3C1Ljr2Mbfz231S/zxjfjK2vhHNtYdBtPOsEtpvThCZSTzuJ/WUzox5XUfL7 +-----END AGE ENCRYPTED FILE----- diff --git a/secrets/secrets.nix b/secrets/secrets.nix new file mode 100644 index 0000000..4a2fdf4 --- /dev/null +++ b/secrets/secrets.nix @@ -0,0 +1,14 @@ +let + weckyy702 = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPHlqOxre3cZWtTRaQWqn0zKjsnFZGCI4qdbpAeaQE2g"; + users = [ weckyy702 ]; + + keith = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIKrauXP79zUm2FlVj3HRm+C8ufYAABiIoe68OCGbIm+2"; + tux = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIFB7bh6ioZrTSR0AkKvJ1qxVWX0kwcM8yeHghTYFGpqZ"; + systems = [ keith tux ]; +in +{ + "nas-creds.age" = { + publicKeys = systems ++ users; + armor = true; + }; +}