diff --git a/flake.nix b/flake.nix index cd8603c..d2d4dc2 100644 --- a/flake.nix +++ b/flake.nix @@ -1,23 +1,14 @@ { inputs = { - # This is pointing to an unstable release. - # If you prefer a stable release instead, you can this to the latest number shown here: https://nixos.org/download - # i.e. nixos-24.11 - # Use `nix flake update` to update the flake to the latest revision of the chosen release channel. haumea.url = "github:nix-community/haumea"; home-manager.url = "github:nix-community/home-manager"; nixpkgs.url = "github:NixOS/nixpkgs/nixos-25.11"; }; outputs = inputs@{ self, nixpkgs, home-manager, ... }: { - # NOTE: 'nixos' is the default hostname nixosConfigurations = { galen = nixpkgs.lib.nixosSystem { modules = [ home-manager.nixosModules.home-manager - { - home-manager.useGlobalPkgs = true; - home-manager.useUserPackages = true; - } ./systems/galen/configuration.nix ]; }; diff --git a/programs/all.nix b/programs/all.nix index 611c4a3..07c8490 100644 --- a/programs/all.nix +++ b/programs/all.nix @@ -2,11 +2,15 @@ { imports = [ + ./boot.nix ./default.nix ./git.nix ./greetd.nix ./home-manager.nix ./lix.nix + ./nix.nix ./polkit.nix + ./qemuGuest.nix + ./security.nix ]; } diff --git a/programs/boot.nix b/programs/boot.nix new file mode 100644 index 0000000..21df790 --- /dev/null +++ b/programs/boot.nix @@ -0,0 +1,15 @@ +{ pkgs, ... }: + +{ + boot = { + kernelPackages = pkgs.linuxPackages_latest; + loader = { + timeout = 3; + efi.canTouchEfiVariables = true; + limine = { + enable = true; + style.wallpapers = []; + }; + }; + }; +} diff --git a/programs/default.nix b/programs/default.nix index 1acb15f..63edd18 100644 --- a/programs/default.nix +++ b/programs/default.nix @@ -1,5 +1,8 @@ -{ ... }: +{ pkgs, ... }: { - programs.git.enable = true; + environment.systemPackages = with pkgs; [ + openssh + git + ]; } diff --git a/programs/home-manager.nix b/programs/home-manager.nix index 8f3b4ae..68237f0 100644 --- a/programs/home-manager.nix +++ b/programs/home-manager.nix @@ -1,5 +1,8 @@ { home-manager, ... }: { - home-manager.backupFileExtension = "backup"; + home-manager = { + backupFileExtension = "backup"; + useUserPackages = true; + }; } diff --git a/programs/nix.nix b/programs/nix.nix new file mode 100644 index 0000000..c4d2c12 --- /dev/null +++ b/programs/nix.nix @@ -0,0 +1,8 @@ +{ ... }: + +{ + nix.settings.experimental-features = [ + "nix-command" + "flakes" + ]; +} diff --git a/programs/qemuGuest.nix b/programs/qemuGuest.nix new file mode 100644 index 0000000..9b7d290 --- /dev/null +++ b/programs/qemuGuest.nix @@ -0,0 +1,17 @@ +{ config, lib, ... }: + +let + inherit (lib) mkEnableOption; + cfg = config.modules.vmGuest; +in + +{ + options.modules.vmGuest.enable = mkEnableOption "Enable VM Guest addons"; + + config = { + services = { + qemuGuest.enable = cfg.enable; + spice-vdagentd.enable = cfg.enable; + }; + }; +} diff --git a/programs/security.nix b/programs/security.nix new file mode 100644 index 0000000..fb72f00 --- /dev/null +++ b/programs/security.nix @@ -0,0 +1,8 @@ +{ pkgs, ... }: + +{ + security = { + sudo.enable = false; + sudo-rs.enable = true; + }; +} diff --git a/systems/galen/configuration.nix b/systems/galen/configuration.nix index 6825084..1816e62 100644 --- a/systems/galen/configuration.nix +++ b/systems/galen/configuration.nix @@ -12,11 +12,7 @@ ]; users.mara.enable = true; - - boot.loader.systemd-boot.enable = true; - boot.loader.efi.canTouchEfiVariables = true; - - boot.kernelPackages = pkgs.linuxPackages_latest; + modules.vmGuest.enable = true; networking.hostName = "galen"; networking.networkmanager.enable = true; diff --git a/users/mara/config.nix b/users/mara/config.nix index 8e6efa3..a70ed32 100644 --- a/users/mara/config.nix +++ b/users/mara/config.nix @@ -1,11 +1,10 @@ { config, lib, pkgs, home-manager, ... }: let + inherit (lib) mkEnableOption mkIf; cfg = config.users.mara; in -with lib; - { options.users.mara.enable = mkEnableOption "Enable the user Mara"; @@ -22,6 +21,7 @@ with lib; username = "mara"; homeDirectory = "/home/mara"; }; + custom.backgroundDir = config.home.homeDirectory + "/Pictures/Archive/Wallpaper/Landscape"; }; programs.fish.enable = true; diff --git a/users/mara/config/all.nix b/users/mara/config/all.nix index 6259964..1e6563c 100644 --- a/users/mara/config/all.nix +++ b/users/mara/config/all.nix @@ -3,8 +3,11 @@ { imports = [ ./fish.nix + ./fuzzel.nix ./helix.nix ./kitty.nix + ./nix.nix ./sway.nix + ./swww.nix ]; } diff --git a/users/mara/config/fuzzel.nix b/users/mara/config/fuzzel.nix new file mode 100644 index 0000000..be21a58 --- /dev/null +++ b/users/mara/config/fuzzel.nix @@ -0,0 +1,35 @@ +{ ... }: + +{ + programs.fuzzel = { + enable = true; + settings = { + main = { + icons-enabled = "no"; + font = "Maple Mono NF:size=12"; + dpi-aware = "no"; + horizontal-pad = 8; + vertical-pad = 8; + inner-pad = 8; + width = 64; + }; + + colors = { + background = "23213688"; + text = "e0def4ff"; + prompt = "e0def4ff"; + input = "e0def4ff"; + match = "8f66c6ff"; + selection = "eb6f92ff"; + selection-text = "232136ff"; + selection-match = "232136ff"; + border = "8f66c6ff"; + }; + + border = { + width = 2; + radius = 2; + }; + }; + }; +} diff --git a/users/mara/config/helix.nix b/users/mara/config/helix.nix index 7340538..53a57d8 100644 --- a/users/mara/config/helix.nix +++ b/users/mara/config/helix.nix @@ -1,4 +1,4 @@ -{ pkgs, ... }: +{ lib, pkgs, ... }: { programs.helix = { @@ -20,7 +20,7 @@ { name = "nix"; auto-format = true; - formatter.command = "${pkgs.nixfmt}/bin/nixfmt"; + formatter.command = "${lib.getExe pkgs.nixfmt-rfc-style} -s"; } ]; diff --git a/users/mara/config/kitty.nix b/users/mara/config/kitty.nix index d6ff1ec..eb385a8 100644 --- a/users/mara/config/kitty.nix +++ b/users/mara/config/kitty.nix @@ -10,6 +10,8 @@ size = 11; }; + shellIntegration.enableFishIntegration = true; + settings = { confirm_os_window_close = 0; enable_audio_bell = false; @@ -56,7 +58,7 @@ window_margin_width = 3; tab_bar_style = "separator"; - tab_seperator = "|"; + tab_seperator = "| "; tab_bar_margin_width = 3; tab_bar_margin_height = 3; tab_switch_strategy = "right"; diff --git a/users/mara/config/nix.nix b/users/mara/config/nix.nix new file mode 100644 index 0000000..831f14c --- /dev/null +++ b/users/mara/config/nix.nix @@ -0,0 +1,8 @@ +{ ... }: + +{ + programs.nix-index = { + enable = true; + enableFishIntegration = true; + }; +} diff --git a/users/mara/config/sway.nix b/users/mara/config/sway.nix index 2691f66..cd40024 100644 --- a/users/mara/config/sway.nix +++ b/users/mara/config/sway.nix @@ -1,12 +1,179 @@ -{ ... }: +{ config, lib, pkgs, ... }: + +let + inherit (lib) concatMapStringsSep getExe getExe'; +in { wayland.windowManager.sway = { enable = true; + package = pkgs.swayfx; wrapperFeatures.gtk = true; + checkConfig = false; + extraConfigEarly = '' + blur enable + blur_passes 2 + blur_radius 4 + + shadows enable + shadow_blur_radius 16 + + layer_effects "waybar" blur enable + layer_effects "launcher" blur enable + layer_effects "notifications" blur enable + ''; config = rec { - modifier = "Mod4"; - terminal = "kitty"; + modifier = "Mod1"; + + input."*" = { + xkb_layout = "de,gb"; + xkb_variant = ",colemak_dh"; + xkb_numlock = "enabled"; + }; + + output."BOE 0x0BCA Unknown".scale = "1.5"; + + seat = { + "*".hide_cursor = "when-typing enable"; + seat0.fallback = "true"; + seat1."\r" = concatMapStringsSep "\n " (s: " attach ${s}") [ + "9390:4610:Rapoo_Rapoo_Gaming_Device" + "9390:4610:Rapoo_Rapoo_Gaming_Device_Keyboard" + ]; + }; + + keybindings = + let + mod = config.wayland.windowManager.sway.config.modifier; + in + { + # Computer Control + "${modifier}+Escape" = "exit"; + "${modifier}+Shift+Escape" = "exec ${getExe' pkgs.coreutils "printf"} 'poweroff\\nreboot\\nhibernate\\n' | ${getExe pkgs.fuzzel} -d'"; + + # Focus + "${modifier}+Down" = "focus down"; + "${modifier}+Left" = "focus left"; + "${modifier}+Right" = "focus right"; + "${modifier}+Up" = "focus up"; + # Movement + "${modifier}+Shift+Down" = "move down"; + "${modifier}+Shift+Left" = "move left"; + "${modifier}+Shift+Right" = "move right"; + "${modifier}+Shift+Up" = "move up"; + # Toggle + "${modifier}+Shift+f" = "fullscreen toggle"; + "${modifier}+Shift+space" = "floating toggle"; + # Workspaces + "${modifier}+Ctrl+Left" = "workspace prev"; + "${modifier}+Ctrl+Right" = "workspace next"; + "${modifier}+Ctrl+Shift+Left" = "move window to workspace prev"; + "${modifier}+Ctrl+Shift+Right" = "move window to workspace next"; + "${modifier}+1" = "workspace number 1"; + "${modifier}+Shift+1" = "move window to workspace number 1"; + "${modifier}+2" = "workspace number 2"; + "${modifier}+Shift+2" = "move window to workspace number 2"; + "${modifier}+3" = "workspace number 3"; + "${modifier}+Shift+3" = "move window to workspace number 3"; + "${modifier}+4" = "workspace number 4"; + "${modifier}+Shift+4" = "move window to workspace number 4"; + "${modifier}+5" = "workspace number 5"; + "${modifier}+Shift+5" = "move window to workspace number 5"; + "${modifier}+6" = "workspace number 6"; + "${modifier}+Shift+6" = "move window to workspace number 6"; + "${modifier}+7" = "workspace number 7"; + "${modifier}+Shift+7" = "move window to workspace number 7"; + "${modifier}+8" = "workspace number 8"; + "${modifier}+Shift+8" = "move window to workspace number 8"; + "${modifier}+9" = "workspace number 9"; + "${modifier}+Shift+9" = "move window to workspace number 9"; + "${modifier}+0" = "workspace number 0"; + "${modifier}+Shift+0" = "move window to workspace number 0"; + + + # Sway Control + "${modifier}+Shift+q" = "kill"; + "${modifier}+Shift+c" = "reload"; + "${modifier}+Shift+r" = "restart"; + + # Shadow Dimension + "${modifier}+Shift+Tab" = "move scratchpad"; + "${modifier}+Tab" = "scratchpad show"; + + # Programs + "${modifier}+a" = "exec ${getExe pkgs.nemo}"; + "${modifier}+Return" = "exec ${getExe pkgs.kitty}"; + + # dmenu + "${modifier}+d" = "exec ${getExe pkgs.fuzzel}"; + }; + + colors = { + background = "#856cf9"; + focused = { + background = "#182030"; + border = "#5c4a94"; + childBorder = "#856cd9"; + indicator = "#856cd9"; + text = "#856cd9"; + }; + focusedInactive = { + background = "#5c4a94"; + border = "#5c4a94"; + childBorder = "#5c4a94"; + indicator = "#5c4a94"; + text = "#5c4a94"; + }; + unfocused = { + background = "#5c4a94"; + border = "#5c4a94"; + childBorder = "#5c4a94"; + indicator = "#5c4a94"; + text = "#5c4a94"; + }; + urgent = { + background = "#2f343a"; + border = "#900000"; + childBorder = "#ffffff"; + indicator = "#900000"; + text = "#900000"; + }; + placeholder = { + background = "#000000"; + border = "#0c0c0c"; + childBorder = "#ffffff"; + indicator = "#000000"; + text = "#0c0c0c"; + }; + }; + + gaps = { + inner = 5; + outer = 0; + }; + + floating = { + border = 2; + titlebar = false; + }; + window = { + border = 2; + titlebar = false; + commands = [ + { + criteria.app_id = ".*"; + command = "inhibit_idle fullscreen"; + } + { + criteria.app_id = "org\.keepassxc\.KeePassXC"; + command = "floating enable"; + } + { + criteria.app_id = "xfce-polkit"; + command = "floating enable"; + } + ]; + }; }; }; } diff --git a/users/mara/config/swww.nix b/users/mara/config/swww.nix new file mode 100644 index 0000000..a03fa95 --- /dev/null +++ b/users/mara/config/swww.nix @@ -0,0 +1,37 @@ +{ config, lib, pkgs, ... }: + +let + inherit (lib) getExe getExe' mkOption types; +in + +{ + options.custom.backgroundDir = mkOption { + default = config.home.homeDirectory + "/Pictures/Backgrounds"; + type = with types; uniq str; + }; + + config = { + services.swww.enable = true; + systemd.user = { + services.swww-randomize = { + Unit = { + Description = "randomly change the swww background image"; + Requires = "swww.service"; + }; + Service = { + Type = "oneshot"; + ExecStart = "${getExe pkgs.bash} -c '${getExe pkgs.findutils} ${config.custom.backgroundDir} -type f | ${getExe' pkgs.coreutils "shuf"} -n 1 | ${getExe' pkgs.findutils "xargs"} ${getExe pkgs.swww} img --transition-step 16'"; + }; + Install.WantedBy = [ "default.target" ]; + }; + timers.swww-randomize = { + Unit.Description = "randomly changes the swww background image"; + Timer = { + Unit = "swww-random"; + OnCalendar = "*-*-* *:00,30:00"; + }; + Install.WantedBy = [ "timers.target" ]; + }; + }; + }; +}