diff options
73 files changed, 1648 insertions, 1369 deletions
diff --git a/common.nix b/common.nix new file mode 100644 index 0000000..6ab48a6 --- /dev/null +++ b/common.nix @@ -0,0 +1,60 @@ +{pkgs, lib, ...}: { + imports = [ + ./modules + ]; + + nix.settings.experimental-features = ["nix-command" "flakes"]; + nixpkgs = { + config = { + allowUnfree = true; + }; + }; + time.timeZone = "Europe/Amsterdam"; # Set timezone + + systemd.oomd = { + enable = true; + enableUserSlices = true; + enableRootSlice = true; + }; + + nix.gc = { + automatic = true; + dates = "weekly"; + options = "--delete-older-than 30d"; + }; + + environment.systemPackages = with pkgs; [ + htop + btop + nmap + dig + ripgrep + unzip + sshfs + ranger + file + lm_sensors + + bashInteractive + coreutils + utillinux + iproute2 + iputils + pciutils + usbutils + vim + + # Dev stuff, move later + git + pkg-config + cmake + ( hiPrio gcc) + gnumake + clang + rustup + ]; + + # This option defines the first version of NixOS you have installed on this particular machine, + # DO NOT CHANGE UNLESS USING NIXOS-INSTALL + system.stateVersion = "24.11"; # Did you read the comment? +} diff --git a/nixos/flake.lock b/flake.lock index 359c4df..4dc32b1 100644 --- a/nixos/flake.lock +++ b/flake.lock @@ -7,32 +7,31 @@ ] }, "locked": { - "lastModified": 1751468302, - "narHash": "sha256-tWosziZTT039x6PgEZUhzGlV8oLvdDmIgKTE8ESMaEA=", + "lastModified": 1752093218, + "narHash": "sha256-+3rXu8ewcNDi65/2mKkdSGrivQs5zEZVp5aYszXC0d0=", "owner": "nix-community", "repo": "home-manager", - "rev": "501cfec8277f931a9c9af9f23d3105c537faeafe", + "rev": "206ed3c71418b52e176f16f58805c96e84555320", "type": "github" }, "original": { "owner": "nix-community", - "ref": "release-25.05", "repo": "home-manager", "type": "github" } }, "nixpkgs": { "locked": { - "lastModified": 1751582995, - "narHash": "sha256-u7ubvtxdTnFPpV27AHpgoKn7qHuE7sgWgza/1oj5nzA=", - "owner": "NixOS", + "lastModified": 1751984180, + "narHash": "sha256-LwWRsENAZJKUdD3SpLluwDmdXY9F45ZEgCb0X+xgOL0=", + "owner": "nixos", "repo": "nixpkgs", - "rev": "7a732ed41ca0dd64b4b71b563ab9805a80a7d693", + "rev": "9807714d6944a957c2e036f84b0ff8caf9930bc0", "type": "github" }, "original": { - "owner": "NixOS", - "ref": "nixos-25.05", + "owner": "nixos", + "ref": "nixos-unstable", "repo": "nixpkgs", "type": "github" } diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..f7ff977 --- /dev/null +++ b/flake.nix @@ -0,0 +1,57 @@ +{ + description = "Nixos config flake"; + + inputs = { + nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; + + home-manager = { + url = "github:nix-community/home-manager"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + }; + + outputs = { self, nixpkgs, ... }@inputs: { + packages."x86_64-linux".full-iso = self.nixosConfigurations.full-iso.config.system.build.isoImage; + nixosConfigurations = { + + apocalypse = nixpkgs.lib.nixosSystem { + specialArgs = { + inherit inputs; + }; + system = "x86_64-linux"; + modules = [ + ./common.nix + ./hosts/apocalypse + ./users/wilkuu.nix + inputs.home-manager.nixosModules.default + ]; + }; + test_vm = nixpkgs.lib.nixosSystem { + specialArgs = { + inherit inputs; + }; + system = "x86_64-linux"; + modules = [ + ./common.nix + ./hosts/test_vm + ./users/wilkuu.nix + inputs.home-manager.nixosModules.default + ]; + }; + full-iso = nixpkgs.lib.nixosSystem { + specialArgs = { + inherit inputs; + isoImage.squashfsCompression = "lz4"; + isoImage.isoLabel = "NIX_WQ_ISO"; + }; + system = "x86_64-linux"; + modules = [ + ./common.nix + ./hosts/full-iso + ./users/live-user.nix + inputs.home-manager.nixosModules.default + ]; + }; + }; + }; +} diff --git a/home-manager/flake.lock b/home-manager/flake.lock deleted file mode 100644 index 8b7a454..0000000 --- a/home-manager/flake.lock +++ /dev/null @@ -1,187 +0,0 @@ -{ - "nodes": { - "flake-utils": { - "inputs": { - "systems": "systems" - }, - "locked": { - "lastModified": 1731533236, - "narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=", - "owner": "numtide", - "repo": "flake-utils", - "rev": "11707dc2f618dd54ca8739b309ec4fc024de578b", - "type": "github" - }, - "original": { - "owner": "numtide", - "repo": "flake-utils", - "type": "github" - } - }, - "flake-utils_2": { - "inputs": { - "systems": "systems_2" - }, - "locked": { - "lastModified": 1731533236, - "narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=", - "owner": "numtide", - "repo": "flake-utils", - "rev": "11707dc2f618dd54ca8739b309ec4fc024de578b", - "type": "github" - }, - "original": { - "owner": "numtide", - "repo": "flake-utils", - "type": "github" - } - }, - "home-manager": { - "inputs": { - "nixpkgs": [ - "nixpkgs" - ] - }, - "locked": { - "lastModified": 1751468302, - "narHash": "sha256-tWosziZTT039x6PgEZUhzGlV8oLvdDmIgKTE8ESMaEA=", - "owner": "nix-community", - "repo": "home-manager", - "rev": "501cfec8277f931a9c9af9f23d3105c537faeafe", - "type": "github" - }, - "original": { - "owner": "nix-community", - "ref": "release-25.05", - "repo": "home-manager", - "type": "github" - } - }, - "iamb": { - "inputs": { - "flake-utils": "flake-utils_2", - "nixpkgs": "nixpkgs", - "rust-overlay": "rust-overlay" - }, - "locked": { - "lastModified": 1751675138, - "narHash": "sha256-xz2zaw9WQf1t113fVxRgI8Le0GtXw2GJ4qBaVPSpDAU=", - "owner": "ulyssa", - "repo": "iamb", - "rev": "34d3b844af99315a84fbae554e4b20594ecefc66", - "type": "github" - }, - "original": { - "owner": "ulyssa", - "repo": "iamb", - "type": "github" - } - }, - "nixpkgs": { - "locked": { - "lastModified": 1736883708, - "narHash": "sha256-uQ+NQ0/xYU0N1CnXsa2zghgNaOPxWpMJXSUJJ9W7140=", - "owner": "nixos", - "repo": "nixpkgs", - "rev": "eb62e6aa39ea67e0b8018ba8ea077efe65807dc8", - "type": "github" - }, - "original": { - "owner": "nixos", - "ref": "nixos-unstable", - "repo": "nixpkgs", - "type": "github" - } - }, - "nixpkgs_2": { - "locked": { - "lastModified": 1736320768, - "narHash": "sha256-nIYdTAiKIGnFNugbomgBJR+Xv5F1ZQU+HfaBqJKroC0=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "4bc9c909d9ac828a039f288cf872d16d38185db8", - "type": "github" - }, - "original": { - "owner": "NixOS", - "ref": "nixpkgs-unstable", - "repo": "nixpkgs", - "type": "github" - } - }, - "nixpkgs_3": { - "locked": { - "lastModified": 1751582995, - "narHash": "sha256-u7ubvtxdTnFPpV27AHpgoKn7qHuE7sgWgza/1oj5nzA=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "7a732ed41ca0dd64b4b71b563ab9805a80a7d693", - "type": "github" - }, - "original": { - "owner": "NixOS", - "ref": "nixos-25.05", - "repo": "nixpkgs", - "type": "github" - } - }, - "root": { - "inputs": { - "flake-utils": "flake-utils", - "home-manager": "home-manager", - "iamb": "iamb", - "nixpkgs": "nixpkgs_3" - } - }, - "rust-overlay": { - "inputs": { - "nixpkgs": "nixpkgs_2" - }, - "locked": { - "lastModified": 1736994333, - "narHash": "sha256-v4Jrok5yXsZ6dwj2+2uo5cSyUi9fBTurHqHvNHLT1XA=", - "owner": "oxalica", - "repo": "rust-overlay", - "rev": "848db855cb9e88785996e961951659570fc58814", - "type": "github" - }, - "original": { - "owner": "oxalica", - "repo": "rust-overlay", - "type": "github" - } - }, - "systems": { - "locked": { - "lastModified": 1681028828, - "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", - "owner": "nix-systems", - "repo": "default", - "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", - "type": "github" - }, - "original": { - "owner": "nix-systems", - "repo": "default", - "type": "github" - } - }, - "systems_2": { - "locked": { - "lastModified": 1681028828, - "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", - "owner": "nix-systems", - "repo": "default", - "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", - "type": "github" - }, - "original": { - "owner": "nix-systems", - "repo": "default", - "type": "github" - } - } - }, - "root": "root", - "version": 7 -} diff --git a/home-manager/flake.nix b/home-manager/flake.nix deleted file mode 100644 index 822f43b..0000000 --- a/home-manager/flake.nix +++ /dev/null @@ -1,43 +0,0 @@ -{ - description = "Home-manager configuration"; - - nixConfig = { - experimental-feature = [ - "nix-command" - "flakes" - ]; - }; - inputs = { - nixpkgs.url = "github:NixOS/nixpkgs/nixos-25.05"; - # nixpkgs-unstable.url = "github:NixOS/nixpkgs/nixos-unstable"; - flake-utils.url = "github:numtide/flake-utils"; - home-manager = { - url = "github:nix-community/home-manager/release-25.05"; - inputs.nixpkgs.follows = "nixpkgs"; - }; - iamb.url = "github:ulyssa/iamb"; - }; - - outputs = - { - self, - nixpkgs, - home-manager, - ... - }@inputs: - let - inherit (self) outputs; - in { - homeConfigurations = { - "wilkuu" = home-manager.lib.homeManagerConfiguration { - modules = [ - (import ./home) - (import ./modules) - ]; - # TODO: Figure out how to ship on other platforms in case you want to use a NixOS Pi, or a 32bit machine - pkgs = nixpkgs.legacyPackages.x86_64-linux; - extraSpecialArgs = {inherit inputs outputs;}; - }; - }; - }; -} diff --git a/home-manager/home/default.nix b/home-manager/home/default.nix deleted file mode 100644 index ed3c564..0000000 --- a/home-manager/home/default.nix +++ /dev/null @@ -1,17 +0,0 @@ -{pkgs, ...}: { - imports = [ - #./hyprland.nix - #./syncthing.nix - ./theming.nix - #./neovim.nix - #./xdg.nix - ]; - - nixpkgs.config.allowUnfree = true; - - - home.username = "wilkuu"; - home.homeDirectory = "/home/wilkuu"; - home.stateVersion = "24.11"; - programs.home-manager.enable = true; -} diff --git a/home-manager/home/session_vars.nix b/home-manager/home/session_vars.nix deleted file mode 100644 index 27ef47b..0000000 --- a/home-manager/home/session_vars.nix +++ /dev/null @@ -1,9 +0,0 @@ - {config, ...}: - { - home.sessionVariables = { - EDITOR = "nvim"; - GTK_USE_PORTAL = "1"; - QT_STYLE_OVERRIDE = "kvantum"; - QT_QPA_PLATFORM_THEME = "kvantum"; - }; -} diff --git a/home-manager/home/theming.nix b/home-manager/home/theming.nix deleted file mode 100644 index 45a09a6..0000000 --- a/home-manager/home/theming.nix +++ /dev/null @@ -1,43 +0,0 @@ -{ config, pkgs, ... }: -let - catppuccin_gtk = pkgs.catppuccin-gtk.override { - accents = ["pink"]; - size = "compact"; - tweaks = ["black"]; - variant = "mocha"; - }; -in -{ - #Gtk Theming - gtk = { - enable=true; - theme = { - package= catppuccin_gtk; - name="catppuccin-mocha-pink-compact+black"; - }; - iconTheme = { - package = pkgs.catppuccin-papirus-folders; - name = "Papirus-Dark"; - }; - }; - - - home.pointerCursor = { - gtk.enable = true; - package = pkgs.catppuccin-cursors.mochaDark; - name = "catppuccin-mocha-dark-cursors"; - size = 32; - }; - - qt = { - enable = true; - platformTheme.name = "qtct"; - style.name="kvantum"; - }; - - xdg.configFile."Kvantum/kvantum.kvconfig".source = (pkgs.formats.ini {}).generate "kvantum.kvconfig" { - General.theme = "Catppuccin-Mocha-Pink"; - }; - -} - diff --git a/home-manager/modules/apps/default.nix b/home-manager/modules/apps/default.nix deleted file mode 100644 index e47ee81..0000000 --- a/home-manager/modules/apps/default.nix +++ /dev/null @@ -1,34 +0,0 @@ -{lib, pkgs, inputs, ...}: -with lib; -{ - imports = [ - ./nvim - ./desktop - ./zsh.nix - ]; - - # Stuff that is to be sorted to its appropriate files - # If no appropriate category is found or thought of, put it in misc.nix - home.packages = with pkgs; [ - htop - btop - nmap - dig - ripgrep - unzip - unrar - xdg-user-dirs - zsh - cmake - ( hiPrio gcc) - gnumake - clang - rustup - lm_sensors - sshfs - pkg-config - ranger - file - inputs.iamb.packages."${pkgs.system}".default - ]; -} diff --git a/home-manager/modules/apps/desktop/default.nix b/home-manager/modules/apps/desktop/default.nix deleted file mode 100644 index 3665aa0..0000000 --- a/home-manager/modules/apps/desktop/default.nix +++ /dev/null @@ -1,55 +0,0 @@ -{lib, pkgs, ...}: with lib; { - imports = [ - ./hyprland.nix - ./wine.nix - ./ghidra.nix - ./floorp.nix - ]; - - home.packages = with pkgs; [ - speedcrunch - thunderbird - element-desktop - kdePackages.filelight - libreoffice - evince - obsidian - krita - hugo - qalculate-qt - libsForQt5.kdeconnect-kde - libreoffice-qt6-fresh - obsidian - krita - kitty - zotero - syncthingtray - gparted - eduvpn-client - wireshark-qt - - spotify - prismlauncher - ani-cli - vlc - mpv - openttd - anki-bin - vesktop - inkscape - zathura - - #Theme - qt6Packages.qt6ct - kdePackages.qtstyleplugin-kvantum - (catppuccin-kvantum.override { - accent = "pink"; - variant = "mocha"; - }) - ]; - - services.syncthing.tray = { - enable = true; - command = "syncthingtray --wait"; - }; -} diff --git a/home-manager/modules/apps/desktop/floorp.nix b/home-manager/modules/apps/desktop/floorp.nix deleted file mode 100644 index ebdad90..0000000 --- a/home-manager/modules/apps/desktop/floorp.nix +++ /dev/null @@ -1,11 +0,0 @@ -{pkgs, config, ...}: { - programs.floorp = { - enable = true; - nativeMessagingHosts = [ pkgs.uget-integrator ]; - }; - - home.packages = with pkgs; [ - uget - uget-integrator - ]; -} diff --git a/home-manager/modules/apps/desktop/hyprland.nix b/home-manager/modules/apps/desktop/hyprland.nix deleted file mode 100644 index 99efe1c..0000000 --- a/home-manager/modules/apps/desktop/hyprland.nix +++ /dev/null @@ -1,286 +0,0 @@ -{lib, pkgs, ...}: -with lib; -{ - - - home.packages = with pkgs; [ - mako - wofi - hyprshot - networkmanagerapplet - xdg-desktop-portal-gnome - xdg-desktop-portal-hyprland - wl-clipboard - ]; - - - # Environment variables for hyprland. - # This can be used to configure wayland/hyprland-specific things - home.file.".config/uwsm/env-hyprland".text = '' - export XDG_SESSION_TYPE=wayland - export GDK_BACKEND=wayland - export GTK_USE_PORTAL=1 - export QT_QPA_PLATFORM=wayland;xcb - export QT_STYLE_OVERRIDE=kvantum - export QT_QPA_PLATFORM_THEME=kvantum - export QT_WAYLAND_DISABLE_WINDOWDECORATION=1 - export QT_AUTO_SCREEN_SCALE_FACTOR=1 - export MOZ_ENABLE_WAYLAND=1 - export -n GTK_IM_MODULE - ''; - - # Hyprland - wayland.windowManager.hyprland = { - systemd.enable = false; - enable = true; - xwayland.enable = true; - settings = { - exec-once = map (s: "uwsm app -- " + s) [ - "kitty &" - "lxqt-policykit-agent &" - "waybar &" - "nm-applet &" - "blueman-tray &" - "blueman-applet &" - "hyprctl setcursor Catppuccin-Mocha-Dark-Cursors 24" - "kdeconnect-indicator &" - ] ++ [ - "systemctl --user start hypridle.service" - "systemctl --user start hyprpaper.service" - "systemctl --user start hyprpolkitagent.service" - "uwsm finalize QT_QPA_PLATFORM QT_PLUGIN_PATH" - ]; - general = { - gaps_in = 3; - gaps_out = 8; - border_size = 1; - - "col.active_border" = "rgba(ed45b8ee) rgba(611449ee) 45deg"; - "col.inactive_border" = "rgba(595959aa)"; - - resize_on_border = true; - allow_tearing = true; - layout = "dwindle"; - }; - - animations = { - enabled = true; - bezier = "myBezier, 0.05, 0.9, 0.1, 1.05"; - animation = [ - "windows, 1, 7, myBezier" - "windowsOut, 1, 7, default, popin 80%" - "border, 1, 10, default" - "borderangle, 1, 8, default" - "fade, 1, 7, default" - "workspaces, 1, 6, default" - ]; - }; - - decoration = { - rounding = 10; - - # Change transparency of focused and unfocused windows - active_opacity = "1.0"; - inactive_opacity = "1.0"; - - # drop_shadow = true; - # shadow_range = 4; - # shadow_render_power = 3; - # "col.shadow" = "rgba(1a1a1aee)"; - - # https://wiki.hyprland.org/Configuring/Variables/#blur - blur = { - enabled = true; - size = 3; - passes = 1; - - vibrancy = "0.1696"; - }; - }; - dwindle = { - pseudotile = true; - preserve_split = true; - }; - - #master = { - # new_is_master = true; - #}; - input = { - kb_layout = "pl"; - kb_variant = ""; - kb_model = ""; - kb_options = ""; - kb_rules = ""; - - follow_mouse = 1; - - sensitivity = 0; # -1.0 - 1.0, 0 means no modification. - - touchpad = { - natural_scroll = true; - }; - }; - gestures = { - workspace_swipe = true; - }; - 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. :( - }; - monitor= [ ",preferred,auto,1" ]; - - # Mod key - "$mod" = "SUPER"; - - # Programs - "$terminal" = "kitty"; - "$fileManager" = "thunar"; - "$menu" = "wofi --show drun"; - "$screenshot" = "hyprshot -m region -f screenshots/screenshot_$(date +'%d-%m-%y_%H-%M-%S').png"; - - - bind = [ - # Example binds, see https://wiki.hyprland.org/Configuring/Binds/ for more - "$mod, RETURN, exec, $terminal" - "$mod, Q, killactive," - "$mod SHIFT, M, exec, uwsm stop" - "$mod, E, exec, uwsm app -- $fileManager" - "$mod, V, togglefloating," - "$mod, R, exec, uwsm app -- $menu" - "$mod, P, pseudo" - "$mod, J, togglesplit" - "$mod, L, exec, uwsm app -- hyprlock" - ",Print, exec, uwsm app -- $screenshot " - - # Move focus with mod + arrow keys - "$mod, left, movefocus, l" - "$mod, right, movefocus, r" - "$mod, up, movefocus, u" - "$mod, down, movefocus, d" - - # Example special workspace (scratchpad) - "$mod, S, togglespecialworkspace, magic" - "$mod SHIFT, S, movetoworkspace, special:magic" - - # Scroll through existing workspaces with mod + scroll - "$mod, mouse_down, workspace, e+1" - "$mod, mouse_up, workspace, e-1" - ] ++ ( - # workspaces - builtins.concatLists (builtins.genList ( - x: let - ws = let - c = (x + 1) / 10; - in - builtins.toString (x + 1 - (c * 10)); - in [ - # binds $mod + [shift +] {1..10} to [move to] workspace {1..10} - "$mod, ${ws}, workspace, ${toString (x + 1)}" - "$mod SHIFT, ${ws}, movetoworkspace, ${toString (x + 1)}" - - # Move workspace {1..10} to current monitor - "CTRL ALT $mod , ${ws}, focusworkspaceoncurrentmonitor, ${toString(x + 1)}" - ] - ) - 10) - ) ++ ( - # Monitor {0..4} --> Key {1..5} - builtins.concatLists (builtins.genList ( - x: let - mon = builtins.toString(x); - key = builtins.toString(x + 1); - in [ - - # Move current workspace to a monitor {1..4} - "CTRL ALT SHIFT $mod, ${key}, movecurrentworkspacetomonitor, ${mon} " - ] - ) - 4)); - - bindm = [ - "$mod, mouse:272, movewindow" - "$mod, mouse:273, resizewindow" - ]; - - - windowrulev2 = [ - "suppressevent maximize, class:.*" # You'll probably like this. - ]; - - source = [ - "~/.config/hypr/hypr_test.conf" - ]; - }; - }; - - services.hyprpaper = { - enable = true; - settings = { - ipc = "on"; - splash = false; - splash_offset = 2.0; - - preload = - [ "/home/wilkuu/Pictures/Wallpapers/peony.png" ]; - wallpaper= [",/home/wilkuu/Pictures/Wallpapers/peony.png"]; - }; - }; - - programs.hyprlock = { - enable=true; - settings = { - general = { - disable_loading_bar = true; - grace = 0; - hide_cursor = true; - no_fade_in = false; - }; - - background = [ - { - path = "screenshot"; - blur_passes = 3; - blur_size = 16; - } - ]; - - input-field = [ - { - size = "200, 50"; - position = "0, -80"; - monitor = ""; - dots_center = true; - fade_on_empty = false; - font_color = "rgb(202, 211, 245)"; - inner_color = "rgb(91, 96, 120)"; - outer_color = "rgb(24, 25, 38)"; - outline_thickness = 5; - placeholder_text = "<span foreground=\"##cad3f5\">Password...</span>"; - shadow_passes = 2; - } - ]; - }; - }; - - services.hypridle.enable = true; - services.hypridle.settings = { - general = { - lock_cmd ="pidof hyprlock || hyprlock"; - before_sleep_cmd="loginctl lock-session"; - ignore_dbus_inhibit=false; - after_sleep_cmd="hyprctl_dispatch dpms on"; - }; - listener = [ - { - timeout = 30; - on-timeout = "hyprlock"; - } - { - timeout = 90; - on-timeout = "hyprctl dispatch dpms off"; - on-resume = "hyprctl dispatch dpms on"; - } - ]; - }; - -} diff --git a/home-manager/modules/apps/nvim/default.nix b/home-manager/modules/apps/nvim/default.nix deleted file mode 100644 index c4e9325..0000000 --- a/home-manager/modules/apps/nvim/default.nix +++ /dev/null @@ -1,56 +0,0 @@ -{ pkgs, config, lib,...}: -let -ts_ls=pkgs.typescript-language-server; -vue_ls=pkgs.vue-language-server; -in { - programs.neovim = { - enable = true; - defaultEditor = true; - viAlias = true; - vimAlias = true; - vimdiffAlias = true; - withPython3 = true; - withNodeJs = true; - withRuby = true; - - coc.enable = false; - # - plugins = [ - ]; - }; - - home.file."./.config/nvim/lua/wilkuu/init.lua".text = '' - require("wilkuu.set") - require("wilkuu.remap") - ''; - - home.file."./.config/nvim/lua/wilkuu/nix.lua".text = '' - return { - vue_ts_plugin = "${lib.getBin vue_ls}/lib/node_modules/@vue/language-server/node_modules/@vue/typescript-plugin/" - } - ''; - - home.sessionPath = [ - "/home/wilkuu/.npm/bin/" - ]; - - home.packages = with pkgs; [ - lua - lua-language-server - gopls - go - typescript - nodejs_22 - rustup - nil - statix - nixfmt-rfc-style - # phpactor - pyright - nodePackages.intelephense - texlive.combined.scheme-full - texlab - mermaid-cli - ] ++ [ ts_ls vue_ls]; - -} diff --git a/home-manager/modules/apps/zsh.nix b/home-manager/modules/apps/zsh.nix deleted file mode 100644 index 7a940e6..0000000 --- a/home-manager/modules/apps/zsh.nix +++ /dev/null @@ -1,24 +0,0 @@ -{config ,pkgs, ...}: { - programs.zsh = { - enable = true; - enableCompletion = true; - oh-my-zsh = { - enable = true; - theme = "clean"; - }; - plugins = [ - { - name = "zsh-nix-shell"; - file = "nix-shell.plugin.zsh"; - src = pkgs.fetchFromGitHub { - owner = "chisui"; - repo = "zsh-nix-shell"; - rev = "v0.8.0"; - sha256 = "1lzrn0n4fxfcgg65v0qhnj7wnybybqzs4adz7xsrkgmcsr0ii8b7"; - }; - } - ]; - }; - - -} diff --git a/home-manager/modules/default.nix b/home-manager/modules/default.nix deleted file mode 100644 index 93bb7d5..0000000 --- a/home-manager/modules/default.nix +++ /dev/null @@ -1,9 +0,0 @@ -{lib, ...}: -with lib; -{ - imports = [ - ./apps - ./services - ./direnv.nix - ]; -} diff --git a/home-manager/modules/direnv.nix b/home-manager/modules/direnv.nix deleted file mode 100644 index 90a8215..0000000 --- a/home-manager/modules/direnv.nix +++ /dev/null @@ -1,8 +0,0 @@ -{pkgs, config, ...}: -{ - programs.direnv = { - enable = true; - enableZshIntegration = true; - nix-direnv.enable = true; - }; -} diff --git a/home-manager/modules/services/default.nix b/home-manager/modules/services/default.nix deleted file mode 100644 index 5ac3f6a..0000000 --- a/home-manager/modules/services/default.nix +++ /dev/null @@ -1,3 +0,0 @@ -{lib, ...}: { - imports = [ ./syncthing.nix ]; -} diff --git a/home-modules/apps/default.nix b/home-modules/apps/default.nix new file mode 100644 index 0000000..20a3f33 --- /dev/null +++ b/home-modules/apps/default.nix @@ -0,0 +1,126 @@ +{lib, pkgs, inputs, config, ...}: +with lib; +let +cfg = config.homeapps.presets; +in +{ + imports = [ + ./nvim + ./desktop + ./zsh.nix + ]; + + options.homeapps.presets = { + base.enable = lib.mkOption { + type = lib.types.bool; + default = true; + description ="Enable basics for home-config"; + } ; + full.enable = lib.mkEnableOption "Enable everything" ; + email.enable = lib.mkEnableOption "Enable email-related config"; + browser.enable = lib.mkEnableOption "Enable the browser (librewolf)"; + comms.enable = lib.mkEnableOption "Enable communication-related config"; + utils.enable = lib.mkEnableOption "Enable utilities" ; + note-taking.enable = lib.mkEnableOption "Enable note taking apps"; + art.enable = lib.mkEnableOption "Enable art apps config"; + work.enable = lib.mkEnableOption "Enable research-related config"; + dev.enable = lib.mkEnableOption "Enable development apps"; + connectivity.enable = lib.mkEnableOption "Enable connectivity"; + multimedia.enable = lib.mkEnableOption "Enable multimedia apps"; + games.enable = lib.mkEnableOption "Enable games"; + }; + + + config = lib.mkMerge [ + (lib.mkIf cfg.full.enable { + homeapps.presets = { + base.enable = true; + email.enable = true; + browser.enable = true; + comms.enable = true; + utils.enable = true; + note-taking.enable = true; + art.enable = true; + work.enable = true; + dev.enable = true; + connectivity.enable = true; + multimedia.enable = true; + games.enable = true; + }; + }) + (lib.mkIf cfg.base.enable { + home.packages = with pkgs; [ + lm_sensors + ]; + homeapps.zsh.enable = true; + homeapps.nvim.enable = true; + }) + (lib.mkIf cfg.email.enable { + home.packages = with pkgs; [ + ]; + }) + (lib.mkIf cfg.comms.enable { + home.packages = with pkgs; [ + iamb + ]; + }) + (lib.mkIf cfg.utils.enable { + home.packages = with pkgs; [ + htop + btop + nmap + dig + ripgrep + unzip + unrar + sshfs + xdg-user-dirs + zsh + ranger + file + ]; + }) + (lib.mkIf cfg.note-taking.enable { + home.packages = with pkgs; [ ]; + # Todo force synthing to be on here + }) + (lib.mkIf cfg.work.enable { + home.packages = with pkgs; [ + ]; + }) + (lib.mkIf cfg.dev.enable { + home.packages = with pkgs; [ + cmake + ( hiPrio gcc) + gnumake + clang + rustup + pkg-config + ]; + homeapps.nvim.enable = true; + homesv.direnv.enable = true; + }) + (lib.mkIf cfg.connectivity.enable { + home.packages = with pkgs; [ + libsForQt5.kdeconnect-kde + syncthingtray + eduvpn-client + ]; + services.syncthing = { + enable = true; + }; + }) + (lib.mkIf cfg.multimedia.enable { + home.packages = with pkgs; [ + ani-cli + playerctl + ]; + + services.playerctld.enable = true; + }) + (lib.mkIf cfg.games.enable { + home.packages = with pkgs; [ + ]; + }) + ]; +} diff --git a/home-modules/apps/desktop/default.nix b/home-modules/apps/desktop/default.nix new file mode 100644 index 0000000..3a06860 --- /dev/null +++ b/home-modules/apps/desktop/default.nix @@ -0,0 +1,100 @@ +{lib, pkgs, config ,hostconfig, ...}: +let + cfg = config.homeapps.presets; +in +{ + imports = [ + ./floorp.nix + ]; + + config = lib.mkIf hostconfig.addons.desktop.enable or false (lib.mkMerge [ + (lib.mkIf cfg.base.enable { + home.packages = with pkgs; [ + # Base + evince + kitty + mpv + #Theme + qt6Packages.qt6ct + kdePackages.qtstyleplugin-kvantum + (catppuccin-kvantum.override { + accent = "pink"; + variant = "mocha"; + }) + ]; + }) + (lib.mkIf cfg.email.enable { + home.packages = with pkgs; [ + thunderbird + ]; + }) + (lib.mkIf cfg.comms.enable { + home.packages = with pkgs; [ + element-desktop + vesktop + ]; + }) + (lib.mkIf cfg.utils.enable { + home.packages = with pkgs; [ + kdePackages.filelight + qalculate-qt + gparted + ]; + }) + (lib.mkIf cfg.note-taking.enable { + home.packages = with pkgs; [ obsidian ]; + # Todo force synthing to be on here + }) + (lib.mkIf cfg.art.enable { + home.packages = with pkgs; [ + krita + inkscape + ]; + }) + (lib.mkIf cfg.browser.enable { + home.packages = with pkgs; [ + librewolf + ]; + }) + (lib.mkIf cfg.work.enable { + home.packages = with pkgs; [ + libreoffice-qt6-fresh + zotero + ]; + }) + (lib.mkIf cfg.dev.enable { + home.packages = with pkgs; [ + hugo + wireshark-qt + ]; + }) + (lib.mkIf cfg.connectivity.enable { + home.packages = with pkgs; [ + libsForQt5.kdeconnect-kde + syncthingtray + eduvpn-client + ]; + services.syncthing = { + tray = { + enable = true; + command = "syncthingtray --wait"; + }; + }; + }) + (lib.mkIf cfg.multimedia.enable { + home.packages = with pkgs; [ + ani-cli + vlc + spotify + ]; + }) + (lib.mkIf cfg.games.enable { + home.packages = with pkgs; [ + # Games + prismlauncher + openttd + anki-bin + ]; + }) + ]); +} diff --git a/home-modules/apps/desktop/floorp.nix b/home-modules/apps/desktop/floorp.nix new file mode 100644 index 0000000..2d8cadb --- /dev/null +++ b/home-modules/apps/desktop/floorp.nix @@ -0,0 +1,2 @@ +{pkgs, config, ...}: { +} diff --git a/home-manager/modules/apps/desktop/ghidra.nix b/home-modules/apps/desktop/ghidra.nix index 7bbcd0a..7bbcd0a 100644 --- a/home-manager/modules/apps/desktop/ghidra.nix +++ b/home-modules/apps/desktop/ghidra.nix diff --git a/home-manager/modules/apps/desktop/wine.nix b/home-modules/apps/desktop/wine.nix index 4aa00b6..4aa00b6 100644 --- a/home-manager/modules/apps/desktop/wine.nix +++ b/home-modules/apps/desktop/wine.nix diff --git a/home-modules/apps/nvim/default.nix b/home-modules/apps/nvim/default.nix new file mode 100644 index 0000000..64c9619 --- /dev/null +++ b/home-modules/apps/nvim/default.nix @@ -0,0 +1,61 @@ +{ pkgs, config, lib,...}: +let +ts_ls=pkgs.typescript-language-server; +vue_ls=pkgs.vue-language-server; +in { + options.homeapps.nvim = { + enable = lib.mkEnableOption "Enables neovim configuration"; + }; + + config = lib.mkIf config.homeapps.nvim.enable { + programs.neovim = { + enable = true; + defaultEditor = true; + viAlias = true; + vimAlias = true; + vimdiffAlias = true; + withPython3 = true; + withNodeJs = true; + withRuby = true; + + coc.enable = false; + plugins = [ + ]; + }; + + home.file."./.config/nvim/lua/wilkuu/init.lua".text = '' + require("wilkuu.set") + require("wilkuu.remap") + ''; + + home.file."./.config/nvim/lua/wilkuu/nix.lua".text = '' + return { + vue_ts_plugin = "${lib.getBin vue_ls}/lib/node_modules/@vue/language-server/node_modules/@vue/typescript-plugin/" + } + ''; + + home.sessionPath = [ + "/home/wilkuu/.npm/bin/" + ]; + + home.packages = with pkgs; [ + lua + lua-language-server + gopls + go + typescript + nodejs_22 + rustup + nil + statix + nixfmt-rfc-style + # phpactor + pyright + nodePackages.intelephense + texlive.combined.scheme-medium + texlab + mermaid-cli + ] ++ [ ts_ls vue_ls]; + + }; +} diff --git a/home-modules/apps/zsh.nix b/home-modules/apps/zsh.nix new file mode 100644 index 0000000..b979a83 --- /dev/null +++ b/home-modules/apps/zsh.nix @@ -0,0 +1,29 @@ +{config ,pkgs, lib, ...}: { + options.homeapps.zsh = { + enable = lib.mkEnableOption "Enable ZSH shell"; + }; + + config = lib.mkIf config.homeapps.zsh.enable { + + programs.zsh = { + enable = true; + enableCompletion = true; + oh-my-zsh = { + enable = true; + theme = "clean"; + }; + plugins = [ + { + name = "zsh-nix-shell"; + file = "nix-shell.plugin.zsh"; + src = pkgs.fetchFromGitHub { + owner = "chisui"; + repo = "zsh-nix-shell"; + rev = "v0.8.0"; + sha256 = "1lzrn0n4fxfcgg65v0qhnj7wnybybqzs4adz7xsrkgmcsr0ii8b7"; + }; + } + ]; + }; + }; +} diff --git a/home-modules/default.nix b/home-modules/default.nix new file mode 100644 index 0000000..413a08e --- /dev/null +++ b/home-modules/default.nix @@ -0,0 +1,4 @@ +{pkgs, ...}: { + imports = [./theming.nix ./apps ./desktop ./services ]; + +} diff --git a/home-modules/desktop/default.nix b/home-modules/desktop/default.nix new file mode 100644 index 0000000..d02f217 --- /dev/null +++ b/home-modules/desktop/default.nix @@ -0,0 +1,4 @@ +{pkgs, hostconfig, ...}: { + imports = [./wayland ./hyprland.nix]; + +} diff --git a/home-modules/desktop/hyprland.nix b/home-modules/desktop/hyprland.nix new file mode 100644 index 0000000..e2ce7ab --- /dev/null +++ b/home-modules/desktop/hyprland.nix @@ -0,0 +1,306 @@ +{lib, pkgs, config, hostconfig , ...}: +with lib; +{ + config = mkIf hostconfig.addons.desktop.hyprland.enable { + home.packages = with pkgs; [ + mako + wofi + hyprshot + networkmanagerapplet + xdg-desktop-portal-gnome + xdg-desktop-portal-hyprland + wl-clipboard + brightnessctl + lxqt.lxqt-policykit + ]; + + homeprogs.waybar.enable = true; + homeprogs.mako.enable = true; + # Environment variables for hyprland. + # This can be used to configure wayland/hyprland-specific things + home.file.".config/uwsm/env-hyprland".text = '' + export XDG_SESSION_TYPE=wayland + export GDK_BACKEND=wayland + export GTK_USE_PORTAL=1 + export QT_QPA_PLATFORM=wayland;xcb + export QT_STYLE_OVERRIDE=kvantum + export QT_QPA_PLATFORM_THEME=kvantum + export QT_WAYLAND_DISABLE_WINDOWDECORATION=1 + export QT_AUTO_SCREEN_SCALE_FACTOR=1 + export MOZ_ENABLE_WAYLAND=1 + export -n GTK_IM_MODULE + ''; + + # Hyprland + wayland.windowManager.hyprland = { + systemd.enable = false; + enable = true; + xwayland.enable = true; + settings = { + exec-once = map (s: "uwsm app -- " + s) [ + "kitty &" + "lxqt-policykit-agent &" + "waybar &" + "nm-applet &" + "blueman-tray &" + "blueman-applet &" + "hyprctl setcursor Catppuccin-Mocha-Dark-Cursors 24" + "kdeconnect-indicator &" + "fcitx5 -d" + ] ++ [ + "systemctl --user start hypridle.service" + "systemctl --user start hyprpaper.service" + "systemctl --user start hyprpolkitagent.service" + "uwsm finalize QT_QPA_PLATFORM QT_PLUGIN_PATH" + ]; + general = { + gaps_in = 3; + gaps_out = 8; + border_size = 1; + + "col.active_border" = "rgba(ed45b8ee) rgba(611449ee) 45deg"; + "col.inactive_border" = "rgba(595959aa)"; + + resize_on_border = true; + allow_tearing = true; + layout = "dwindle"; + }; + + animations = { + enabled = true; + bezier = "myBezier, 0.05, 0.9, 0.1, 1.05"; + animation = [ + "windows, 1, 7, myBezier" + "windowsOut, 1, 7, default, popin 80%" + "border, 1, 10, default" + "borderangle, 1, 8, default" + "fade, 1, 7, default" + "workspaces, 1, 6, default" + ]; + }; + + decoration = { + rounding = 10; + + # Change transparency of focused and unfocused windows + active_opacity = "1.0"; + inactive_opacity = "1.0"; + + # drop_shadow = true; + # shadow_range = 4; + # shadow_render_power = 3; + # "col.shadow" = "rgba(1a1a1aee)"; + + # https://wiki.hyprland.org/Configuring/Variables/#blur + blur = { + enabled = true; + size = 3; + passes = 1; + + vibrancy = "0.1696"; + }; + }; + dwindle = { + pseudotile = true; + preserve_split = true; + }; + + #master = { + # new_is_master = true; + #}; + input = { + kb_layout = "pl"; + kb_variant = ""; + kb_model = ""; + kb_options = ""; + kb_rules = ""; + + follow_mouse = 1; + + sensitivity = 0; # -1.0 - 1.0, 0 means no modification. + + touchpad = { + natural_scroll = true; + }; + }; + gestures = { + workspace_swipe = true; + }; + 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. :( + }; + monitor= [ ",preferred,auto,1" ]; + + # Mod key + "$mod" = "SUPER"; + + # Programs + "$terminal" = "kitty"; + "$fileManager" = "thunar"; + "$menu" = "wofi --show drun"; + "$screenshot" = "hyprshot -m region -f screenshots/screenshot_$(date +'%y-%m-%d_%H-%M-%S').png"; + + bind = [ + # Example binds, see https://wiki.hyprland.org/Configuring/Binds/ for more + "$mod, RETURN, exec, $terminal" + "$mod, Q, killactive," + "$mod SHIFT, M, exec, uwsm stop" + "$mod, E, exec, uwsm app -- $fileManager" + "$mod, V, togglefloating," + "$mod, R, exec, uwsm app -- $menu" + "$mod, P, pseudo" + "$mod, J, togglesplit" + "$mod, L, exec, uwsm app -- hyprlock" + ",Print, exec, uwsm app -- $screenshot " + + # Move focus with mod + arrow keys + "$mod, left, movefocus, l" + "$mod, right, movefocus, r" + "$mod, up, movefocus, u" + "$mod, down, movefocus, d" + + # Example special workspace (scratchpad) + "$mod, S, togglespecialworkspace, magic" + "$mod SHIFT, S, movetoworkspace, special:magic" + + # Scroll through existing workspaces with mod + scroll + "$mod, mouse_down, workspace, e+1" + "$mod, mouse_up, workspace, e-1" + ] ++ ( + # workspaces + builtins.concatLists (builtins.genList ( + x: let + ws = let + c = (x + 1) / 10; + in + builtins.toString (x + 1 - (c * 10)); + in [ + # binds $mod + [shift +] {1..10} to [move to] workspace {1..10} + "$mod, ${ws}, workspace, ${toString (x + 1)}" + "$mod SHIFT, ${ws}, movetoworkspace, ${toString (x + 1)}" + + # Move workspace {1..10} to current monitor + "CTRL ALT $mod , ${ws}, focusworkspaceoncurrentmonitor, ${toString(x + 1)}" + ] + ) + 10) + ) ++ ( + # Monitor {0..4} --> Key {1..5} + builtins.concatLists (builtins.genList ( + x: let + mon = builtins.toString(x); + key = builtins.toString(x + 1); + in [ + + # Move current workspace to a monitor {1..4} + "CTRL ALT SHIFT $mod, ${key}, movecurrentworkspacetomonitor, ${mon} " + ] + ) 4)); + + bindm = [ + "$mod, mouse:272, movewindow" + "$mod, mouse:273, resizewindow" + ]; + + bindl = [ + "$mod, O, exec, sleep 1 && hyprctl dispatch dpms toggle" + ] ++ (lib.optionals config.homeapps.presets.multimedia.enable [ + # Playerctl binds if playerctl is enabled + " , XF86AudioNext, exec, playerctl next" + " , XF86AudioPause, exec, playerctl play-pause" + " , XF86AudioPlay, exec, playerctl play-pause" + " , XF86AudioPrev, exec, playerctl previous" + ]); + + bindel = [ + # Laptop multimedia keys for volume and LCD brightness + " ,XF86AudioRaiseVolume, exec, wpctl set-volume -l 1 @DEFAULT_AUDIO_SINK@ 5%+" + " ,XF86AudioLowerVolume, exec, wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%-" + " ,XF86AudioMute, exec, wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle" + " ,XF86AudioMicMute, exec, wpctl set-mute @DEFAULT_AUDIO_SOURCE@ toggle" + " ,XF86MonBrightnessUp, exec, brightnessctl -e4 -n2 set 5%+" + " ,XF86MonBrightnessDown, exec, brightnessctl -e4 -n2 set 5%-" + ]; + + + windowrulev2 = [ + "suppressevent maximize, class:.*" # You'll probably like this. + ]; + + source = [ + "~/.config/hypr/hypr_test.conf" + ]; + }; + }; + + services.hyprpaper = { + enable = true; + settings = { + ipc = "on"; + splash = false; + splash_offset = 2.0; + + preload = [ "${./wallpaper.png}" ]; + wallpaper= [ ",${./wallpaper.png}" ]; + }; + }; + + programs.hyprlock = { + enable=true; + settings = { + general = { + disable_loading_bar = true; + grace = 0; + hide_cursor = true; + no_fade_in = false; + }; + + background = [ + { + path = "screenshot"; + blur_passes = 3; + blur_size = 16; + } + ]; + + input-field = [ + { + size = "200, 50"; + position = "0, -80"; + monitor = ""; + dots_center = true; + fade_on_empty = false; + font_color = "rgb(202, 211, 245)"; + inner_color = "rgb(91, 96, 120)"; + outer_color = "rgb(24, 25, 38)"; + outline_thickness = 5; + placeholder_text = "<span foreground=\"##cad3f5\">Password...</span>"; + shadow_passes = 2; + } + ]; + }; + }; + + services.hypridle.enable = true; + services.hypridle.settings = { + general = { + lock_cmd ="pidof hyprlock || hyprlock"; + before_sleep_cmd="loginctl lock-session"; + ignore_dbus_inhibit=false; + after_sleep_cmd="hyprctl_dispatch dpms on"; + }; + listener = [ + { + timeout = 120; + on-timeout = "hyprlock"; + } + { + timeout = 300; + on-timeout = "hyprctl dispatch dpms off"; + on-resume = "hyprctl dispatch dpms on"; + } + ]; + }; + }; +} diff --git a/home-modules/desktop/wallpaper.png b/home-modules/desktop/wallpaper.png Binary files differnew file mode 100644 index 0000000..42f8bea --- /dev/null +++ b/home-modules/desktop/wallpaper.png diff --git a/home-modules/desktop/wayland/default.nix b/home-modules/desktop/wayland/default.nix new file mode 100644 index 0000000..9be2fe9 --- /dev/null +++ b/home-modules/desktop/wayland/default.nix @@ -0,0 +1,3 @@ +{pkgs, hostconfig, ...}: { + imports = [./waybar.nix ./mako.nix]; +} diff --git a/home-modules/desktop/wayland/mako.ini b/home-modules/desktop/wayland/mako.ini new file mode 100644 index 0000000..27b16c8 --- /dev/null +++ b/home-modules/desktop/wayland/mako.ini @@ -0,0 +1,25 @@ +max-visible=4 +max-history=8 +sort=-time + +font=Hermit 12 + +background-color=#ED45B8AA +text-color=#FFFFFFFF + +margin=10 +padding=5 +border-radius=5 +progress-color=source #FFFFFFFF +#max-icon-size=64 +default-timeout=4000 + +on-button-middle=exec makoctl menu -n "$id" wofi -dp "Select action: " + +[urgency=normal] +border-color=#FFFFFFFF + +[urgency=high] +border-color=#FF5544 +default-timeout=0 + diff --git a/home-modules/desktop/wayland/mako.nix b/home-modules/desktop/wayland/mako.nix new file mode 100644 index 0000000..15c7969 --- /dev/null +++ b/home-modules/desktop/wayland/mako.nix @@ -0,0 +1,12 @@ +{pkgs, config, hostconfig, lib,...}: { + options.homeprogs.mako.enable = lib.mkEnableOption "Enable Mako notification manager"; + config = lib.mkIf config.homeprogs.mako.enable { + services.mako = { + enable = true; + }; + xdg.configFile."mako/config".source = ./mako.ini; + + }; + + +} diff --git a/home-modules/desktop/wayland/waybar.css b/home-modules/desktop/wayland/waybar.css new file mode 100644 index 0000000..3c90892 --- /dev/null +++ b/home-modules/desktop/wayland/waybar.css @@ -0,0 +1,230 @@ +* { + /* `otf-font-awesome` is required to be installed for icons */ + font-family: Hermit, Minecraftia ,FontAwesome, Helvetica, Arial, sans-serif; + font-size: 13px; +} + +window#waybar { + background-color: rgba(43, 48, 59, 0.5); + border-bottom: 3px solid rgba(100, 114, 125, 0.5); + color: #ffffff; + transition-property: background-color; + transition-duration: .5s; +} + +window#waybar.hidden { + opacity: 0.2; +} + +/* +window#waybar.empty { + background-color: transparent; +} +window#waybar.solo { + background-color: #FFFFFF; +} +*/ + +window#waybar.termite { + background-color: #3F3F3F; +} + +window#waybar.chromium { + background-color: #000000; + border: none; +} + +button { + /* Use box-shadow instead of border so the text isn't offset */ + box-shadow: inset 0 -3px transparent; + /* Avoid rounded borders under each button name */ + border: none; + border-radius: 0; +} + +/* https://github.com/Alexays/Waybar/wiki/FAQ#the-workspace-buttons-have-a-strange-hover-effect */ +button:hover { + background: inherit; + box-shadow: inset 0 -3px #ed45b8; +} + +#workspaces button { + padding: 0 5px; + background-color: transparent; + color: #ffffff; +} + +#workspaces button:hover { + background: rgba(0, 0, 0, 0.2); +} + +#workspaces button.focused { + background-color: #64727D; + box-shadow: inset 0 -3px #ffffff; +} + +#workspaces button.urgent { + background-color: #eb4d4b; +} + +#mode { + background-color: #64727D; + border-bottom: 3px solid #ffffff; +} + +#clock, +#battery, +#cpu, +#memory, +#disk, +#temperature, +#backlight, +#network, +#pulseaudio, +#wireplumber, +#custom-media, +#tray, +#mode, +#idle_inhibitor, +#scratchpad, +#mpd { + padding: 0 10px; + color: #ffffff; +} + +#window, +#workspaces { + margin: 0 4px; +} + +/* If workspaces is the leftmost module, omit left margin */ +.modules-left > widget:first-child > #workspaces { + margin-left: 0; +} + +/* If workspaces is the rightmost module, omit right margin */ +.modules-right > widget:last-child > #workspaces { + margin-right: 0; +} + +#clock { + color: #000000; + background-color: #ffffff; +} + +#battery { + color: #000000; + background-color: #ffffff; +} + +#battery.charging, #battery.plugged { +} + +@keyframes blink { + to { + color: #FFFFFF; + background-color: #000000 ; + } +} + +#battery.critical:not(.charging) { + background-color: #f53c3c; + color: #ffffff; + animation-name: blink; + animation-duration: 0.5s; + animation-timing-function: linear; + animation-iteration-count: infinite; + animation-direction: alternate; +} + +label:focus { + background-color: #000000; +} + +#cpu { +} + +#memory { +} + +#disk { +} + +#backlight { +} + +#network { +} + +#network.disconnected { +} + +#wireplumber { + background-color: #fff0f5; + color: #000000; +} + +#wireplumber.muted { + background-color: #f53c3c; +} + +#temperature { +} + +#temperature.critical { +} + +#tray { + background-color: #ed45b8; +} + +#tray > .passive { + -gtk-icon-effect: dim; +} + +#tray > .needs-attention { + -gtk-icon-effect: highlight; + background-color: #eb4d4b; +} + +#idle_inhibitor { +} + +#idle_inhibitor.activated { +} + +#mpd { +} + +#mpd.disconnected { +} + +#mpd.stopped { +} + +#mpd.paused { +} + +#language { + background: #ed45b8; + color: #740864; + padding: 0 5px; + margin: 0 5px; + min-width: 16px; +} + +#keyboard-state { + background: #ed45b8; + color: #000000; + padding: 0 0px; + margin: 0 5px; + min-width: 16px; +} + +#keyboard-state > label { + padding: 0 5px; +} + +#keyboard-state > label.locked { + background: rgba(255, 0, 0, 0.2); +} diff --git a/home-modules/desktop/wayland/waybar.nix b/home-modules/desktop/wayland/waybar.nix new file mode 100644 index 0000000..5f3c532 --- /dev/null +++ b/home-modules/desktop/wayland/waybar.nix @@ -0,0 +1,131 @@ +{pkgs, hostconfig, lib, config,...}: { + options.homeprogs.waybar.enable = lib.mkEnableOption "Enable waybar"; + + config = lib.mkIf config.homeprogs.waybar.enable { + programs.waybar = { + enable = true; + settings = [{ + layer = "top"; + position = "top"; + height = 30; + spacing = 6; + modules-left = [ + "hyprland/workspaces" + "hyprland/window" + ]; + + modules-center = [ + "clock" + "hyprland/language" + "tray" + "battery" + ]; + + modules-right = [ + "idle_inhibitor" + "wireplumber" + "network" + "cpu" + "memory" + "disk" + "temperature" + "backlight" + ]; + wireplumber = { + scroll-step = 1; #%, can be a float + format = "{volume}% "; + format-muted = "Muted"; + on-click = "wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle"; + on-click-right = "pavucontrol"; + }; + + network = { + # interface = "wlp2*"; # (Optional) To force the use of this interface + format-wifi = "({signalStrength}%) "; + format-ethernet = "{ifname} "; + tooltip-format = "{ifname} via {gwaddr} "; + format-linked = "{ifname} (No IP) "; + format-disconnected = "Disconnected ⚠"; + format-alt= "{essid}: {ipaddr}/{cidr}"; + }; + + "hyprland/workspaces" = { + all-outputs = false; + active-only = false; + format = "{name}"; + format-icons = { + urgent = ""; + focused = ""; + default = ""; + }; + }; + + "hyprland/window" = { + max-length = 200; + separate-outputs = true; + }; + + + keyboard-state = { + numlock = false; + format = "{name} {icon}"; + format-icons = { + locked = ""; + unlocked = ""; + }; + }; + idle_inhibitor = { + format = "{icon}"; + format-icons = { + activated = ""; + deactivated = ""; + }; + }; + tray = { + icon-size = 21; + spacing = 10; + }; + clock = { + timezone = "Europe/Amsterdam"; + tooltip-format = "<big>{:%Y %B}</big>\n<tt><small>{calendar}</small></tt>"; + format-alt = "{:%Y-%m-%d}"; + }; + cpu = { + format = "{usage}% "; + tooltip = false; + }; + memory = { + format = "{}% "; + }; + temperature = { + thermal-zone = 1; + # hwmon-path = "/sys/class/hwmon/hwmon2/temp1_input"; + critical-threshold = 80; + # format-critical = "{temperatureC}°C {icon}"; + format = "{temperatureC}°C {icon}"; + format-icons = ["" "" ""]; + }; + "backlight" = { + # device = "acpi_video1"; + format = "{percent}{icon}"; + format-icons = ["" "" "" "" "" "" "" "" ""]; + }; + battery = { + states = { + # good = 95; + warning = 30; + critical = 15; + }; + format = "{capacity}% {icon}"; + format-charging = "{capacity}% "; + format-plugged = "{capacity}% "; + format-alt = "{time} {icon}"; + # format-good = ""; // An empty format will hide the module + # format-full = ""; + format-icons = ["" "" "" "" ""]; + }; + }]; + style = ./waybar.css; + }; + }; +} diff --git a/home-modules/services/default.nix b/home-modules/services/default.nix new file mode 100644 index 0000000..0483d63 --- /dev/null +++ b/home-modules/services/default.nix @@ -0,0 +1,3 @@ +{lib, ...}: { + imports = [./direnv.nix]; +} diff --git a/home-modules/services/direnv.nix b/home-modules/services/direnv.nix new file mode 100644 index 0000000..7e68f99 --- /dev/null +++ b/home-modules/services/direnv.nix @@ -0,0 +1,11 @@ +{pkgs, config, lib ,...}: +{ + options.homesv.direnv.enable = lib.mkEnableOption "Enable Direnv support"; + config = lib.mkIf config.homesv.direnv.enable { + programs.direnv = { + enable = true; + enableZshIntegration = true; + nix-direnv.enable = true; + }; + }; +} diff --git a/home-manager/modules/services/syncthing.nix b/home-modules/services/syncthing.nix index 06b94a2..06b94a2 100644 --- a/home-manager/modules/services/syncthing.nix +++ b/home-modules/services/syncthing.nix diff --git a/home-modules/theming.nix b/home-modules/theming.nix new file mode 100644 index 0000000..291dadc --- /dev/null +++ b/home-modules/theming.nix @@ -0,0 +1,45 @@ +{ hostconfig, pkgs, lib,... }: +let + catppuccin_gtk = pkgs.catppuccin-gtk.override { + accents = ["pink"]; + size = "compact"; + tweaks = ["black"]; + variant = "mocha"; + }; +in +{ + config = lib.mkIf hostconfig.addons.desktop.enable { + #Gtk Theming + gtk = { + enable=true; + theme = { + package= catppuccin_gtk; + name="catppuccin-mocha-pink-compact+black"; + }; + iconTheme = { + package = pkgs.catppuccin-papirus-folders; + name = "Papirus-Dark"; + }; + }; + + + home.pointerCursor = { + gtk.enable = true; + package = pkgs.catppuccin-cursors.mochaDark; + name = "catppuccin-mocha-dark-cursors"; + size = 32; + }; + + qt = { + enable = true; + platformTheme.name = "qtct"; + style.name="kvantum"; + }; + + xdg.configFile."Kvantum/kvantum.kvconfig".source = (pkgs.formats.ini {}).generate "kvantum.kvconfig" { + General.theme = "Catppuccin-Mocha-Pink"; + }; + }; +} + + diff --git a/home/live-user.nix b/home/live-user.nix new file mode 100644 index 0000000..e4dfd8b --- /dev/null +++ b/home/live-user.nix @@ -0,0 +1,13 @@ +{ config ,pkgs, ... }: { + imports = [../home-modules]; + + homeapps.presets = { + browser.enable = true; + utils.enable = true; + }; + + home.username = "live-user"; + home.homeDirectory = "/home/live-user"; + home.stateVersion = "24.11"; + programs.home-manager.enable = true; +} diff --git a/home/wilkuu.nix b/home/wilkuu.nix new file mode 100644 index 0000000..d97d3fc --- /dev/null +++ b/home/wilkuu.nix @@ -0,0 +1,11 @@ +{ config ,pkgs, ... }: { + imports = [../home-modules]; + + homeapps.presets.full.enable = true; + + + home.username = "wilkuu"; + home.homeDirectory = "/home/wilkuu"; + home.stateVersion = "24.11"; + programs.home-manager.enable = true; +} diff --git a/nixos/hosts/apocalypse/backup.nix b/hosts/apocalypse/backup.nix index 07386be..3529024 100644 --- a/nixos/hosts/apocalypse/backup.nix +++ b/hosts/apocalypse/backup.nix @@ -10,6 +10,10 @@ instances."remote_vault" = { onCalendar = "weekly"; settings = { + snapshot_preserve_min = "1w"; + snapshot_preserve = "2w"; + target_preserve_min = "1w"; + target_preserve = "4w"; ssh_identity = "/etc/vault_key"; # NOTE: must be readable by user/group btrbk ssh_user = "vaultmanager"; stream_compress = "lz4"; @@ -17,7 +21,7 @@ target = "ssh://10.127.9.1/vault/backups/apocalypse"; subvolume = { "@root" = { - snapshot_create = "always"; + snapshot_create = "ondemand"; }; }; }; diff --git a/nixos/hosts/apocalypse/default.nix b/hosts/apocalypse/default.nix index e57105c..8993dc2 100644 --- a/nixos/hosts/apocalypse/default.nix +++ b/hosts/apocalypse/default.nix @@ -1,12 +1,24 @@ - {pkgs, config, lib, ...}: + {lib, ...}: { imports = [ ./hardware-configuration.nix - ../../common ./nvidia.nix ./backup.nix ./firewall.nix ]; + + ## Addons for this system + addons = { + desktop.hyprland.enable = true; + desktop.xfce.enable = true; + + virtualisation.guest = false; + virtualisation.host = true; + + vpn.mullvad.enable = true; + gpg.enable = true; + }; + boot.loader.grub = { useOSProber = true; device = "nodev"; @@ -18,7 +30,7 @@ }; boot.loader.efi.canTouchEfiVariables = true; boot.initrd.systemd.enable = true; - boot.crashDump.enable = false; + boot.crashDump.enable = true; boot.plymouth = { enable = true; theme = "bgrt"; @@ -47,7 +59,7 @@ programs.nix-ld.enable = true; services.printing.enable = true; - nixpkgs.config.allowUnfree = true; + # nix.config.allowUnfree = true; services.resolved = { @@ -58,7 +70,6 @@ dnsovertls = "opportunistic"; }; - networking.useDHCP = lib.mkDefault true; networking.firewall.checkReversePath = false; diff --git a/nixos/hosts/apocalypse/firewall.nix b/hosts/apocalypse/firewall.nix index 5c73966..5c73966 100644 --- a/nixos/hosts/apocalypse/firewall.nix +++ b/hosts/apocalypse/firewall.nix diff --git a/nixos/hosts/apocalypse/hardware-configuration.nix b/hosts/apocalypse/hardware-configuration.nix index d8ae434..d8ae434 100644 --- a/nixos/hosts/apocalypse/hardware-configuration.nix +++ b/hosts/apocalypse/hardware-configuration.nix diff --git a/nixos/hosts/apocalypse/nvidia.nix b/hosts/apocalypse/nvidia.nix index ef95b43..ef95b43 100644 --- a/nixos/hosts/apocalypse/nvidia.nix +++ b/hosts/apocalypse/nvidia.nix diff --git a/hosts/full-iso/default.nix b/hosts/full-iso/default.nix new file mode 100644 index 0000000..d2ca00a --- /dev/null +++ b/hosts/full-iso/default.nix @@ -0,0 +1,12 @@ +{modulesPath, pkgs, ...}: { + imports = [ + (modulesPath + "/installer/cd-dvd/installation-cd-base.nix") + ]; + + boot.loader.systemd-boot.enable = true; + boot.loader.efi.canTouchEfiVariables = true; + + addons.desktop.hyprland.enable = true; + addons.desktop.xfce.enable = false; + addons.gpg.enable = false; +} diff --git a/hosts/test_vm/default.nix b/hosts/test_vm/default.nix new file mode 100644 index 0000000..280cb9a --- /dev/null +++ b/hosts/test_vm/default.nix @@ -0,0 +1,17 @@ +{pkgs, lib, ...}: { + + boot.loader.systemd-boot.enable = true; + boot.loader.efi.canTouchEfiVariables = true; + + addons.desktop.hyprland.enable = true; + addons.desktop.xfce.enable = true; + addons.virtualisation.guest = true; + virtualisation.vmVariant = { + # following configuration is added only when building VM with build-vm + virtualisation = { + memorySize = 2048; # Use 2048MiB memory. + cores = 3; + graphics = true; + }; + }; +} diff --git a/modules/btrfs.nix b/modules/btrfs.nix new file mode 100644 index 0000000..70d35ac --- /dev/null +++ b/modules/btrfs.nix @@ -0,0 +1,18 @@ +{pkgs, lib, config, ...}: +let + cfg = config.addons.btrfs; +in +{ + options.addons.btrfs = { + enable = lib.mkEnableOption "Enable btrfs-related apps and utils"; + }; + + config = lib.mkMerge [ + (lib.mkIf cfg.enable { + services.btrfs.autoScrub = { + enable = true; + interval = "weekly"; + }; + }) + ]; +} diff --git a/modules/default.nix b/modules/default.nix new file mode 100644 index 0000000..786c440 --- /dev/null +++ b/modules/default.nix @@ -0,0 +1,10 @@ +{pkgs, lib, config ,...}: { + imports = [ + ./desktop + ./virt.nix + ./gpg.nix + ./btrfs.nix + ./vpn.nix + ]; + +} diff --git a/modules/desktop/common.nix b/modules/desktop/common.nix new file mode 100644 index 0000000..088ad73 --- /dev/null +++ b/modules/desktop/common.nix @@ -0,0 +1,72 @@ +{pkgs, config, lib, ...}: { + options.addons.desktop.enable = lib.mkEnableOption "On if the machine needs a desktop"; + + config = lib.mkIf config.addons.desktop.enable { + programs = { + dconf.enable = true; + thunar = { + enable = true; + plugins = with pkgs.xfce; [ + thunar-archive-plugin + thunar-media-tags-plugin + thunar-volman + ]; + }; + }; + + environment.systemPackages = with pkgs; [ + xdg-user-dirs + zathura + sioyek + vlc + mpv + gparted + kitty + # qalculate + networkmanagerapplet + surf # A basic browser in case we don't want to import a larger browser + ]; + + + # Enable CUPS to print documents. + # services.printing.enable = true; + + + # Enable touchpad support (enabled default in most desktopManager). + services.libinput.enable = true; + + services = { + blueman.enable = true; + # Enable sound + pipewire = { + enable = true; + pulse.enable = true; + }; + + displayManager.sddm = { + enable=true; + #theme = "catppuccin-mocha"; + }; + + }; + + i18n.inputMethod = { + type = "fcitx5"; + enable = true; + fcitx5.addons = with pkgs; [ + fcitx5-gtk + fcitx5-lua + fcitx5-mozc + catppuccin-fcitx5 + fcitx5-table-other + ]; + }; + + fonts.packages = with pkgs; [ + noto-fonts + font-awesome + nerd-fonts.hurmit + minecraftia + ]; + }; +} diff --git a/modules/desktop/default.nix b/modules/desktop/default.nix new file mode 100644 index 0000000..c3e0b45 --- /dev/null +++ b/modules/desktop/default.nix @@ -0,0 +1,49 @@ +{pkgs, lib, config,...}: +with lib; + let + wmMeta = config.addons.desktop.wmMeta; + + # Gets all the vm's that are enabled and checks which protocols are used + enabledWMs = (filter (wm: wm.enable) (attrValues wmMeta)); + protos = (unique (map (wm: wm.protocol) enabledWMs)); + desktopEnabled = protos != []; + x11Enabled = elem "x11" protos; + waylandEnabled = elem "wayland" protos; + + +in { + imports = [ + ./common.nix + ./x11.nix + ./wayland.nix + ./wms + ]; + options.addons.desktop = with types; { + wmMeta = mkOption { + type = attrsOf (submodule { + options = { + enable = mkOption { + type = bool; + default = false; + }; + protocol = mkOption { + type = str; + description = "Used display protocol (x11 or wayland)"; + }; + }; + }); + default = {}; + description = "Window manager metadata used for determining which protocol to enable."; + }; + + # enable = lib.mkEnableOption "Whenever any desktop environment is enabled."; + # x11.enable = lib.mkEnableOption "Whenever x11 desktop environment is enabled."; + # wayland.enable = lib.mkEnableOption "Whenever wayland desktop environment is enabled."; + }; + + config.addons.desktop = { + enable = desktopEnabled; + x11.enable = x11Enabled; + wayland.enable = waylandEnabled; + }; +} diff --git a/modules/desktop/wayland.nix b/modules/desktop/wayland.nix new file mode 100644 index 0000000..0b78daf --- /dev/null +++ b/modules/desktop/wayland.nix @@ -0,0 +1,6 @@ +{pkgs, lib, config, ...}: { + options.addons.desktop.wayland.enable = lib.mkEnableOption "Enable wayland" ; + config = lib.mkIf config.addons.desktop.wayland.enable { + services.displayManager.sddm.wayland.enable = true; + }; +} diff --git a/modules/desktop/wms/default.nix b/modules/desktop/wms/default.nix new file mode 100644 index 0000000..94d0e05 --- /dev/null +++ b/modules/desktop/wms/default.nix @@ -0,0 +1,6 @@ +{...}: { + imports = [ + ./hyprland.nix + ./xfce.nix + ]; +} diff --git a/modules/desktop/wms/hyprland.nix b/modules/desktop/wms/hyprland.nix new file mode 100644 index 0000000..8243b3d --- /dev/null +++ b/modules/desktop/wms/hyprland.nix @@ -0,0 +1,43 @@ +{pkgs, lib, config, ...}: + let cfg = config.addons.desktop.hyprland; +in { + options.addons.desktop.hyprland = { + enable = lib.mkEnableOption "Enable Hyprland"; + }; + + config = lib.mkIf cfg.enable (lib.mkMerge [ + (import ../../../utils/makeWm.nix "hyprland" "wayland" ) + { + programs.hyprland.enable = true; + programs.hyprland.withUWSM = true; + programs.uwsm = { + enable = true; + waylandCompositors ={ + hyprland = { + prettyName = "Hyprland"; + comment = "Hyprland compositor managed by UWSM"; + binPath = "/run/current-system/sw/bin/Hyprland"; + }; + }; + }; + + environment.systemPackages = with pkgs; [ + hyprland + hyprshot + hypridle + hyprpaper + hyprpicker + hyprnotify + hyprcursor + hyprpolkitagent + wofi + waybar + waybar-mpris + mako + xdg-desktop-portal-gnome + xdg-desktop-portal-hyprland + wl-clipboard + ]; + } + ]); +} diff --git a/nixos/desktop/xfce.nix b/modules/desktop/wms/xfce.nix index 563b205..0c62ee0 100644 --- a/nixos/desktop/xfce.nix +++ b/modules/desktop/wms/xfce.nix @@ -1,5 +1,15 @@ -{pkgs, ...}: -{ +{pkgs, config, lib, ...}: +let + cfg = config.addons.desktop.xfce; +in { + + options.addons.desktop.xfce = { + enable = lib.mkEnableOption "Enable xfce"; + }; + + config = lib.mkIf cfg.enable (lib.mkMerge [ + (import ../../../utils/makeWm.nix "xfce" "x11" ) + { environment.systemPackages = with pkgs; [ # XFCE stuff xfce.catfish @@ -23,4 +33,5 @@ gnome-disk-utility ]; services.xserver.desktopManager.xfce.enable = true; + }]); } diff --git a/modules/desktop/x11.nix b/modules/desktop/x11.nix new file mode 100644 index 0000000..cdbf3a3 --- /dev/null +++ b/modules/desktop/x11.nix @@ -0,0 +1,11 @@ +{pkgs, lib, config, ...}: { + options.addons.desktop.x11.enable = lib.mkEnableOption "Enabled if X11 is needed for this machine"; + config = lib.mkIf config.addons.desktop.x11.enable { + services.xserver = { + enable = true; + excludePackages = with pkgs; [ + xterm + ]; + }; + }; +} diff --git a/modules/gpg.nix b/modules/gpg.nix new file mode 100644 index 0000000..e7b6984 --- /dev/null +++ b/modules/gpg.nix @@ -0,0 +1,18 @@ +{pkgs, config, lib, ... }: +let cfg = config.addons.gpg; in +{ + options.addons.gpg = { + enable = lib.mkEnableOption "Allow gpg for all users"; + }; + + config = lib.mkMerge ([ + (lib.mkIf cfg.enable { + programs.gnupg = { + agent = { + enable = true; + }; + }; + }) + ]); + +} diff --git a/modules/virt.nix b/modules/virt.nix new file mode 100644 index 0000000..416f1c4 --- /dev/null +++ b/modules/virt.nix @@ -0,0 +1,35 @@ +{pkgs, config, lib, ...}: +let + cfg = config.addons.virtualisation; +in +{ + options.addons.virtualisation = { + host = lib.mkEnableOption "Allow to host vm's and containers"; + guest = lib.mkEnableOption "Enable guest agents"; + }; + + config = lib.mkMerge([ + (lib.mkIf cfg.host { + environment.systemPackages = with pkgs; [ + qemu + ]; + virtualisation = { + docker.enable = true; + libvirtd = { + enable = true; + qemu = { + swtpm.enable = true; + vhostUserPackages = with pkgs; [ virtiofsd ]; + ovmf.enable = true; + ovmf.packages = [ pkgs.OVMFFull.fd ]; + }; + }; + }; + + }) + (lib.mkIf cfg.guest { + virtualisation.spiceUSBRedirection.enable = true; + services.spice-vdagentd.enable = true; + }) + ]); +} diff --git a/modules/vpn.nix b/modules/vpn.nix new file mode 100644 index 0000000..5b5cf09 --- /dev/null +++ b/modules/vpn.nix @@ -0,0 +1,20 @@ +{config, pkgs, lib, ...}: +let + desktop = config.addons.desktop; + cfg = config.addons.vpn; + opt-mullvad = config.addons.vpn.mullvad; +in +{ + options.addons.vpn = { + mullvad.enable = lib.mkEnableOption "Enable mullvad vpn"; + }; + + config = lib.mkMerge [ + ({ services.mullvad-vpn.enable = opt-mullvad.enable; }) + (lib.mkIf desktop.enable (lib.mkMerge [ + (lib.mkIf opt-mullvad.enable { + services.mullvad-vpn.package = pkgs.mullvad-vpn; + }) + ])) + ]; +} diff --git a/nixos/common/default.nix b/nixos/common/default.nix deleted file mode 100644 index b199ca5..0000000 --- a/nixos/common/default.nix +++ /dev/null @@ -1,77 +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, on -# https://search.nixos.org/options and in the NixOS manual (`nixos-help`). - -{ config, lib, pkgs, ... }: - -{ - imports = - [ # Include the results of the hardware scan. - ./services.nix - ]; - - nix.settings.experimental-features = ["nix-command" "flakes"]; - time.timeZone = "Europe/Amsterdam"; # Set timezone - - # Configure network proxy if necessary - # networking.proxy.default = "http://user:password@proxy:port/"; - # networking.proxy.noProxy = "127.0.0.1,localhost,internal.domain"; - - # Select internationalisation properties. - i18n.defaultLocale = "en_US.UTF-8"; - console = { - font = "Lat2-Terminus16"; - keyMap = "us"; - # useXkbConfig = true; # use xkb.options in tty. - }; - - # Enable the X11 windowing system. - # services.xserver.enable = true; - - # Define a user account. Don't forget to set a password with ‘passwd’. - programs.zsh.enable = true; - users.users.wilkuu = { - shell = pkgs.zsh; - isNormalUser = true; - extraGroups = [ "wheel" "networkmanager" "input" "docker" "adbusers" "libvirtd" ]; # Enable ‘sudo’ for the user. - packages = with pkgs; [ - tree - home-manager - ]; - }; - - # Configure keymap in X11 - # services.xserver.xkb.layout = "us"; - # services.xserver.xkb.options = "eurosign:e,caps:escape"; - - - # programs.firefox.enable = true; - - # List packages installed in system profile. To search, run: - environment.variables.EDITOR = "vim"; - # $ nix search wget - environment.systemPackages = with pkgs; [ - vim # Do not forget to add an editor to edit configuration.nix! The Nano editor is also installed by default. - wget - git - tmux - usbutils - lz4 - ]; - - systemd.oomd = { - enable = true; - enableUserSlices = true; - enableRootSlice = true; - }; - - - - # This option defines the first version of NixOS you have installed on this particular machine, - # DO NOT CHANGE UNLESS USING NIXOS-INSTALL - - system.stateVersion = "24.11"; # Did you read the comment? - -} - diff --git a/nixos/common/services.nix b/nixos/common/services.nix deleted file mode 100644 index 8a73d42..0000000 --- a/nixos/common/services.nix +++ /dev/null @@ -1,27 +0,0 @@ -{config, lib, pkgs, ...}: -{ - - ## VM's - programs.dconf.enable = true; - programs.virt-manager.enable = true; - virtualisation = { - docker.enable = true; - libvirtd = { - enable = true; - qemu = { - swtpm.enable = true; - vhostUserPackages = with pkgs; [ virtiofsd ]; - ovmf.enable = true; - ovmf.packages = [ pkgs.OVMFFull.fd ]; - }; - }; - spiceUSBRedirection.enable = true; - }; - services.spice-vdagentd.enable = true; - - services.mullvad-vpn = { - enable = true; - package = pkgs.mullvad-vpn; - }; - -} diff --git a/nixos/desktop/apps.nix b/nixos/desktop/apps.nix deleted file mode 100644 index 68e5090..0000000 --- a/nixos/desktop/apps.nix +++ /dev/null @@ -1,13 +0,0 @@ -{pkgs, ...} : -{ - environment.systemPackages = with pkgs; [ - neovim - kitty - ]; - - programs.steam = { - enable = true; - protontricks.enable = true; - gamescopeSession.enable = true; - }; -} diff --git a/nixos/desktop/default.nix b/nixos/desktop/default.nix deleted file mode 100644 index b987376..0000000 --- a/nixos/desktop/default.nix +++ /dev/null @@ -1,67 +0,0 @@ - -{pkgs, ...}: -{ - imports = [ - ./apps.nix - ./xfce.nix - ./hyprland.nix - ]; - - programs = { - dconf.enable = true; - thunar = { - enable = true; - plugins = with pkgs.xfce; [ - thunar-archive-plugin - thunar-media-tags-plugin - thunar-volman - ]; - }; - }; - # Enable CUPS to print documents. - services.printing.enable = true; - - - # Enable touchpad support (enabled default in most desktopManager). - services.libinput.enable = true; - - services = { - blueman.enable = true; - # Enable sound - pipewire = { - enable = true; - pulse.enable = true; - }; - - displayManager.sddm = { - enable=true; - wayland.enable = true; - #theme = "catppuccin-mocha"; - }; - - xserver = { - enable = true; - excludePackages = with pkgs; [ - xterm - ]; - }; - }; - - i18n.inputMethod = { - type = "fcitx5"; - enable = true; - fcitx5.addons = with pkgs; [ - fcitx5-gtk - fcitx5-lua - fcitx5-mozc - catppuccin-fcitx5 - fcitx5-table-other - ]; - }; - - fonts.packages = with pkgs; [ - noto-fonts - font-awesome - nerd-fonts.hurmit - ]; -} diff --git a/nixos/desktop/hyprland.nix b/nixos/desktop/hyprland.nix deleted file mode 100644 index 62b39ae..0000000 --- a/nixos/desktop/hyprland.nix +++ /dev/null @@ -1,46 +0,0 @@ -{pkgs, ...}: { - environment.systemPackages = with pkgs; [ - hyprland - hyprshot - hyprkeys - hypridle - hyprpaper - hyprpicker - hyprnotify - hyprcursor - hyprpolkitagent - waybar - waybar-mpris - ]; - - - services.xserver.exportConfiguration = true; # This makes it easy to search for a valid keymap - # Enable KDE6 env in case Hyprland gets borked. - # services.desktopManager.plasma6.enable = true; - programs.hyprland.enable = true; - programs.hyprland.withUWSM = true; - programs.uwsm = { - enable = true; - waylandCompositors ={ - hyprland = { - prettyName = "Hyprland"; - comment = "Hyprland compositor managed by UWSM"; - binPath = "/run/current-system/sw/bin/Hyprland"; - }; - }; - }; - - xdg.portal = { - enable = true; - extraPortals = with pkgs; [ xdg-desktop-portal-hyprland xdg-desktop-portal-gtk ]; - config = { - common = { - default = [ - "hyprland" - "gtk" - ]; - "org.freedesktop.impl.portal.Filechooser"="gtk"; - }; - }; - }; -} diff --git a/nixos/flake.nix b/nixos/flake.nix deleted file mode 100644 index 8bb7d06..0000000 --- a/nixos/flake.nix +++ /dev/null @@ -1,47 +0,0 @@ -{ - description = "NixOS configuration"; - - inputs = { - nixpkgs.url = "github:NixOS/nixpkgs/nixos-25.05"; - home-manager = { - url = "github:nix-community/home-manager/release-25.05"; - inputs.nixpkgs.follows = "nixpkgs"; - }; - }; - - outputs = { self, nixpkgs, home-manager, ... }: { - nixosConfigurations.crank-vm = nixpkgs.lib.nixosSystem { - system = "x86_64-linux"; - modules = [ - ./hosts/crank-vm - ./desktop - home-manager.nixosModules.home-manager { - home-manager.useGlobalPkgs = true; - home-manager.useUserPackages = true; - } - ]; - }; - nixosConfigurations.icetea-dispenser = nixpkgs.lib.nixosSystem { - system = "x86_64-linux"; - modules = [ - ./hosts/icetea-dispenser - ./desktop - home-manager.nixosModules.home-manager { - home-manager.useGlobalPkgs = true; - home-manager.useUserPackages = true; - } - ]; - }; - nixosConfigurations.apocalypse = nixpkgs.lib.nixosSystem { - system = "x86_64-linux"; - modules = [ - ./hosts/apocalypse - ./desktop - home-manager.nixosModules.home-manager { - home-manager.useGlobalPkgs = true; - home-manager.useUserPackages = true; - } - ]; - }; - }; -} diff --git a/nixos/hosts/crank-vm/default.nix b/nixos/hosts/crank-vm/default.nix deleted file mode 100644 index 1415674..0000000 --- a/nixos/hosts/crank-vm/default.nix +++ /dev/null @@ -1,20 +0,0 @@ -{ config, inputs, pkgs, ...}: -{ - imports = [ - ./hardware-configuration.nix - ../../common - ]; - - networking.hostName = "crank-vm"; # Define your hostname. - # Use the systemd-boot EFI boot loader. - # boot.loader.systemd-boot.enable = true; - boot.loader.efi.canTouchEfiVariables = true; - boot.loader.grub = { - device = "nodev"; - useOSProber = true; - efiSupport = true; - default = "saved"; - memtest86.enable = true; - }; - networking.firewall.enable = false; -} diff --git a/nixos/hosts/crank-vm/hardware-configuration.nix b/nixos/hosts/crank-vm/hardware-configuration.nix deleted file mode 100644 index e73cd34..0000000 --- a/nixos/hosts/crank-vm/hardware-configuration.nix +++ /dev/null @@ -1,65 +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, ... }: - -{ - imports = - [ (modulesPath + "/profiles/qemu-guest.nix") - ]; - - boot.initrd.availableKernelModules = [ "ahci" "xhci_pci" "virtio_pci" "sr_mod" "virtio_blk" ]; - boot.initrd.kernelModules = [ ]; - boot.kernelModules = [ "kvm-intel" ]; - boot.extraModulePackages = [ ]; - - fileSystems."/" = - { device = "/dev/disk/by-uuid/4b8e866a-bbf0-4312-a134-e6369276ed60"; - fsType = "btrfs"; - options = [ "subvol=root" ]; - }; - - boot.initrd.luks.devices."system".device = "/dev/disk/by-uuid/70bdaa2d-b736-417b-899e-50f6c61c0036"; - - fileSystems."/home" = - { device = "/dev/disk/by-uuid/4b8e866a-bbf0-4312-a134-e6369276ed60"; - fsType = "btrfs"; - options = [ "subvol=home" ]; - }; - - fileSystems."/nix" = - { device = "/dev/disk/by-uuid/4b8e866a-bbf0-4312-a134-e6369276ed60"; - fsType = "btrfs"; - options = [ "subvol=nix" ]; - }; - - fileSystems."/snapshots" = - { device = "/dev/disk/by-uuid/4b8e866a-bbf0-4312-a134-e6369276ed60"; - fsType = "btrfs"; - options = [ "subvol=snapshots" ]; - }; - - fileSystems."/boot" = - { device = "/dev/disk/by-uuid/D0B7-5718"; - fsType = "vfat"; - options = [ "fmask=0022" "dmask=0022" ]; - }; - - 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.<interface>.useDHCP`. - networking.useDHCP = lib.mkDefault true; - # networking.interfaces.enp1s0.useDHCP = lib.mkDefault true; - - nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; - - services = { - qemuGuest.enable = true; - spice-vdagentd.enable = true; - }; -} - - diff --git a/nixos/hosts/icetea-dispenser/GrubBG.png b/nixos/hosts/icetea-dispenser/GrubBG.png Binary files differdeleted file mode 100644 index 0f5028f..0000000 --- a/nixos/hosts/icetea-dispenser/GrubBG.png +++ /dev/null diff --git a/nixos/hosts/icetea-dispenser/default.nix b/nixos/hosts/icetea-dispenser/default.nix deleted file mode 100644 index a8d4630..0000000 --- a/nixos/hosts/icetea-dispenser/default.nix +++ /dev/null @@ -1,49 +0,0 @@ - {pkgs, config, ...}: - { - imports = [ - ./hardware-configuration.nix - ../../common - ]; - boot.loader.grub = { - useOSProber = true; - device = "nodev"; - - - efiSupport = true; - default = "saved"; - memtest86.enable = true; - # splashImage = ./GrubBG.png; - }; - boot.loader.efi.canTouchEfiVariables = true; - boot.crashDump.enable = false; - boot.plymouth = { - enable = true; - theme = "bgrt"; - }; - - boot.kernelParams = [ - "quiet" - "splash" - "loglevel=3" - "rd.systemd.show_status=false" - "rd.udev.log_level=3" - "udev.logpriority=3" - ]; - boot.consoleLogLevel = 0; - - networking.hostName = "icetea-dispenser"; # Define your hostname. - networking.firewall.enable = false; - networking.networkmanager.enable = true; # Easiest to use and most distros use this by default. - - hardware.bluetooth.enable = true; - hardware.bluetooth.settings = { - General = {Enable = "Source,Sink,Media,Socket";}; - }; - - hardware.bluetooth.powerOnBoot = true; - services.blueman.enable = true; - - programs.nix-ld.enable = true; - services.printing.enable = true; - nixpkgs.config.allowUnfree = true; -} diff --git a/nixos/hosts/icetea-dispenser/hardware-configuration.nix b/nixos/hosts/icetea-dispenser/hardware-configuration.nix deleted file mode 100644 index 7ae80aa..0000000 --- a/nixos/hosts/icetea-dispenser/hardware-configuration.nix +++ /dev/null @@ -1,155 +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, ... }: - -{ - imports = - [ (modulesPath + "/installer/scan/not-detected.nix") - ]; - - boot.initrd.availableKernelModules = [ "xhci_pci" "nvme" "usbhid" "usb_storage" "sd_mod" "sdhci_pci" ]; - boot.initrd.kernelModules = [ "aesni_intel" "cryptd" ]; - boot.kernelModules = [ "kvm-intel" ]; - boot.extraModulePackages = [ ]; - boot.supportedFilesystems = [ "ntfs" "btrfs" "vfat" ]; - # GRUB 2 with UEFI example, chainloading another distro - boot.loader.grub.extraEntries = - '' -menuentry 'UEFI Firmware' $menuentry_id_option 'uefi-firmware' { - fwsetup -} - ''; - fileSystems."/" = - { device = "/dev/disk/by-uuid/f75781bf-b2bf-4bb0-915d-95193e8eee9e"; - fsType = "btrfs"; - options = [ "noatime" "compress=zstd" "subvol=root" ]; - }; - - fileSystems."/home" = - { device = "/dev/disk/by-uuid/f75781bf-b2bf-4bb0-915d-95193e8eee9e"; - fsType = "btrfs"; - options = [ "noatime" "compress=zstd" "subvol=home" ]; - }; - - fileSystems."/nix" = - { device = "/dev/disk/by-uuid/f75781bf-b2bf-4bb0-915d-95193e8eee9e"; - fsType = "btrfs"; - options = [ "noatime" "compress=zstd" "subvol=nix" ]; - }; - - fileSystems."/snapshots" = - { device = "/dev/disk/by-uuid/f75781bf-b2bf-4bb0-915d-95193e8eee9e"; - fsType = "btrfs"; - options = [ "noatime" "compress=zstd" "subvol=snapshots" ]; - }; - - fileSystems."/boot" = - { device = "/dev/disk/by-uuid/6E1A-07F4"; - fsType = "vfat"; - options = [ "fmask=0077" "dmask=0077" ]; - }; - - fileSystems."/store2" = - { device = "/dev/disk/by-uuid/5368282f-c09d-44cf-9cf2-e69a2d415da6"; - fsType = "btrfs"; - options = [ "noatime" "compress=zstd" "subvol=/"]; - }; - fileSystems."/store1" = - { device = "/dev/disk/by-uuid/6A2E2BFF2E2BC2C5"; - fsType = "ntfs-3g" ; - options = ["rw" "uid=1000" "gid=100"]; - }; - fileSystems."/win_games" = - { device = "/dev/disk/by-uuid/6A680789680752ED"; - fsType = "ntfs-3g" ; - options = ["rw" "uid=1000" "gid=100"]; - }; - - - - swapDevices = - [ { device = "/dev/disk/by-uuid/f1dfc6a1-55f3-4148-9f1d-2a998c3b3168"; } - ]; - - # Thunderbolt - services.hardware.bolt.enable = true; - powerManagement.enable = 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.<interface>.useDHCP`. - # networking.nameservers = [ "1.1.1.1#one.one.one.one" "1.0.0.1#one.one.one.one" ]; - - services.resolved = { - enable = true; - dnssec = "false"; - domains = [ "~." ]; - fallbackDns = [ ]; - dnsovertls = "opportunistic"; - }; - - - networking.useDHCP = lib.mkDefault true; - networking.firewall.checkReversePath = false; - - # networking.interfaces.enp0s31f6.useDHCP = lib.mkDefault true; - # networking.interfaces.enp81s0u1u4.useDHCP = lib.mkDefault true; - # networking.interfaces.wlp0s20f3.useDHCP = lib.mkDefault true; - - nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; - hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; - - # Enable OpenGL - hardware.graphics = { - enable = true; - }; - - # Load nvidia driver for Xorg and Wayland - services.xserver.videoDrivers = ["nvidia"]; - - hardware.nvidia = { - - # Modesetting is required. - modesetting.enable = true; - - # Nvidia power management. Experimental, and can cause sleep/suspend to fail. - # Enable this if you have graphical corruption issues or application crashes after waking - # up from sleep. This fixes it by saving the entire VRAM memory to /tmp/ instead - # of just the bare essentials. - powerManagement.enable = false; - - # Fine-grained power management. Turns off GPU when not in use. - # Experimental and only works on modern Nvidia GPUs (Turing or newer). - powerManagement.finegrained = false; - - # Use the NVidia open source kernel module (not to be confused with the - # independent third-party "nouveau" open source driver). - # Support is limited to the Turing and later architectures. Full list of - # supported GPUs is at: - # https://github.com/NVIDIA/open-gpu-kernel-modules#compatible-gpus - # Only available from driver 515.43.04+ - # Currently alpha-quality/buggy, so false is currently the recommended setting. - open = false; - - # Enable the Nvidia settings menu, - # accessible via `nvidia-settings`. - nvidiaSettings = true; - - # Optionally, you may need to select the appropriate driver version for your specific GPU. - package = config.boot.kernelPackages.nvidiaPackages.production; - - prime = { - offload = { - enable = true; - enableOffloadCmd = true; - }; - - sync.enable = false; - - intelBusId = "PCI:0:2:0"; - nvidiaBusId = "PCI:1:0:0"; - }; - }; -} diff --git a/users/live-user.nix b/users/live-user.nix new file mode 100644 index 0000000..b7182c8 --- /dev/null +++ b/users/live-user.nix @@ -0,0 +1,16 @@ +{pkgs, lib, config,...}: { + imports = [./user-common.nix]; + programs.zsh.enable = true; + users.users.live-user = { + shell = pkgs.zsh; + isNormalUser = true; + initialPassword = "PleazeChangeThis123"; + extraGroups = [ "wheel" "networkmanager" "input" "docker" "adbusers" "libvirtd" ]; # Enable ‘sudo’ for the user. + packages = with pkgs; [ + home-manager + ]; + }; + + home-manager.users.live-user.imports = [ ../home/live-user.nix ]; + +} diff --git a/users/user-common.nix b/users/user-common.nix new file mode 100644 index 0000000..4b60044 --- /dev/null +++ b/users/user-common.nix @@ -0,0 +1,16 @@ +{pkgs, config, ...}: { + # Pass host config to HM (Common config) + # TODO: Move this somewhere else. + home-manager = { + useUserPackages = true; + useGlobalPkgs = true; + backupFileExtension = "bak"; + + sharedModules = [ + ({ ...}: { + _module.args.hostconfig = config; + + }) + ]; + }; +} diff --git a/users/wilkuu.nix b/users/wilkuu.nix new file mode 100644 index 0000000..c4e7cf3 --- /dev/null +++ b/users/wilkuu.nix @@ -0,0 +1,16 @@ +{pkgs, lib, config,...}: { + imports = [./user-common.nix]; + programs.zsh.enable = true; + users.users.wilkuu = { + shell = pkgs.zsh; + isNormalUser = true; + initialPassword = "PleazeChangeThis123"; + extraGroups = [ "wheel" "networkmanager" "input" "docker" "adbusers" "libvirtd" ]; # Enable ‘sudo’ for the user. + packages = with pkgs; [ + home-manager + ]; + }; + + home-manager.users.wilkuu.imports = [ ../home/wilkuu.nix ]; + +} diff --git a/utils/makeWm.nix b/utils/makeWm.nix new file mode 100644 index 0000000..166f35d --- /dev/null +++ b/utils/makeWm.nix @@ -0,0 +1,7 @@ +name: protocol: { + addons.desktop.wmMeta.${name} = { + enable = true; + inherit protocol; + + }; +} |
