diff --git a/flake.lock b/flake.lock index 43087cb..9598da2 100644 --- a/flake.lock +++ b/flake.lock @@ -248,25 +248,6 @@ "type": "github" } }, - "helix": { - "inputs": { - "nixpkgs": "nixpkgs", - "rust-overlay": "rust-overlay" - }, - "locked": { - "lastModified": 1748359092, - "narHash": "sha256-bfQVlnTe1PZ3DfulcHUwJzh6qcir0n1F8B0xYUV+Vu0=", - "owner": "helix-editor", - "repo": "helix", - "rev": "2bd7452fe0309e273d06280d15caad6943034377", - "type": "github" - }, - "original": { - "owner": "helix-editor", - "repo": "helix", - "type": "github" - } - }, "hercules-ci-effects": { "inputs": { "flake-parts": [ @@ -602,7 +583,7 @@ "nixpkgs" ], "pre-commit-hooks-nix": "pre-commit-hooks-nix", - "rust-overlay": "rust-overlay_2" + "rust-overlay": "rust-overlay" }, "locked": { "lastModified": 1747056319, @@ -681,15 +662,15 @@ }, "nixpkgs": { "locked": { - "lastModified": 1740560979, - "narHash": "sha256-Vr3Qi346M+8CjedtbyUevIGDZW8LcA1fTG0ugPY/Hic=", - "owner": "nixos", + "lastModified": 1748190013, + "narHash": "sha256-R5HJFflOfsP5FBtk+zE8FpL8uqE7n62jqOsADvVshhE=", + "owner": "NixOS", "repo": "nixpkgs", - "rev": "5135c59491985879812717f4c9fea69604e7f26f", + "rev": "62b852f6c6742134ade1abdd2a21685fd617a291", "type": "github" }, "original": { - "owner": "nixos", + "owner": "NixOS", "ref": "nixos-unstable", "repo": "nixpkgs", "type": "github" @@ -708,22 +689,6 @@ } }, "nixpkgs_2": { - "locked": { - "lastModified": 1748190013, - "narHash": "sha256-R5HJFflOfsP5FBtk+zE8FpL8uqE7n62jqOsADvVshhE=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "62b852f6c6742134ade1abdd2a21685fd617a291", - "type": "github" - }, - "original": { - "owner": "NixOS", - "ref": "nixos-unstable", - "repo": "nixpkgs", - "type": "github" - } - }, - "nixpkgs_3": { "locked": { "lastModified": 1736429638, "narHash": "sha256-dDWqQqSgMQXw5eFtcyoVijv7HbYJZOIo+jWQdJtsxn4=", @@ -810,12 +775,11 @@ }, "root": { "inputs": { - "helix": "helix", "hyprland": "hyprland", "impermanence": "impermanence", "lanzaboote": "lanzaboote", "lix-module": "lix-module", - "nixpkgs": "nixpkgs_2", + "nixpkgs": "nixpkgs", "quickshell": "quickshell", "schizofox": "schizofox", "superfreq": "superfreq", @@ -823,27 +787,6 @@ } }, "rust-overlay": { - "inputs": { - "nixpkgs": [ - "helix", - "nixpkgs" - ] - }, - "locked": { - "lastModified": 1740623427, - "narHash": "sha256-3SdPQrZoa4odlScFDUHd4CUPQ/R1gtH4Mq9u8CBiK8M=", - "owner": "oxalica", - "repo": "rust-overlay", - "rev": "d342e8b5fd88421ff982f383c853f0fc78a847ab", - "type": "github" - }, - "original": { - "owner": "oxalica", - "repo": "rust-overlay", - "type": "github" - } - }, - "rust-overlay_2": { "inputs": { "nixpkgs": [ "lanzaboote", @@ -870,7 +813,7 @@ "flake-parts": "flake-parts_2", "home-manager": "home-manager", "nixpak": "nixpak", - "nixpkgs": "nixpkgs_3", + "nixpkgs": "nixpkgs_2", "searx-randomizer": "searx-randomizer", "systems": "systems_2" }, diff --git a/flake.nix b/flake.nix index cc6af58..b2418bd 100644 --- a/flake.nix +++ b/flake.nix @@ -21,10 +21,9 @@ inherit (import ./packages { inherit pkgs; - helix = inputs.helix.packages.${system}.default; }) fish - wrapped-helix + helix kakoune ; } @@ -32,7 +31,7 @@ pkgsFor; apps = eachSystem (system: let - inherit (inputs.self.packages.${system}) fish wrapped-helix; + inherit (inputs.self.packages.${system}) fish helix; in { default = { type = "app"; @@ -40,7 +39,7 @@ }; helix = { type = "app"; - program = "${wrapped-helix}/bin/hx"; + program = "${helix}/bin/hx"; }; }); }; @@ -71,8 +70,6 @@ inputs.systems.follows = "systems"; }; - helix.url = "github:helix-editor/helix"; - quickshell = { url = "git+https://git.outfoxxed.me/outfoxxed/quickshell"; # THIS IS IMPORTANT diff --git a/hosts/common.nix b/hosts/common.nix index 999772c..b94adb7 100644 --- a/hosts/common.nix +++ b/hosts/common.nix @@ -9,7 +9,7 @@ ... }: let inherit (lib.meta) hiPrioSet; - inherit (self.packages.${pkgs.stdenv.system}) wrapped-helix fish; + inherit (self.packages.${pkgs.stdenv.system}) helix fish; in { environment.systemPackages = builtins.attrValues { @@ -46,7 +46,7 @@ in { ; } ++ builtins.attrValues (hiPrioSet { - inherit wrapped-helix fish; + inherit helix fish; }); # helix as the only editor, a reasonable choice. environment.sessionVariables.EDITOR = "hx"; diff --git a/hosts/default.nix b/hosts/default.nix index e2001df..3a02583 100644 --- a/hosts/default.nix +++ b/hosts/default.nix @@ -31,7 +31,7 @@ inputs: let networking.hostName = hostname; nixpkgs.hostPlatform = system; }) - (flatten ( + ( concatLists [ # configuration for the host, passed as an argument. (singleton ./${hostname}/default.nix) @@ -39,12 +39,12 @@ inputs: let (singleton ./common.nix) # Import all files called module.nix from my modules directory. ( - filter (hasSuffix "module.nix") ( - map toString (listFilesRecursive ../modules) - ) + map toString (listFilesRecursive ../modules) + |> filter (hasSuffix "module.nix") ) ] - )) + |> flatten + ) ]; }; in { @@ -61,8 +61,8 @@ in { system = "aarch64-linux"; hostname = "tower"; }; - world = mkSystem { - system = "x86_64-linux"; - hostname = "world"; - }; + # world = mkSystem { + # system = "x86_64-linux"; + # hostname = "world"; + # }; } diff --git a/hosts/hermit/configuration.nix b/hosts/hermit/configuration.nix index c282d5e..2fe6657 100644 --- a/hosts/hermit/configuration.nix +++ b/hosts/hermit/configuration.nix @@ -23,7 +23,9 @@ pinentryPackage = pkgs.pinentry-qt; }; modules = { - desktops.hyprland.enable = true; + wms.wayland.enable = true; + desktops.hyprland.enable = false; + desktops.niri.enable = true; theming = { gtk.enable = true; @@ -62,8 +64,8 @@ services = { locate.enable = true; kanata.enable = true; - uwsm.enable = true; - greetd.enable = true; + uwsm.enable = false; + greetd.enable = false; media.mpd = { enable = true; diff --git a/hosts/hermit/programs.nix b/hosts/hermit/programs.nix index 196dffa..f5e234d 100644 --- a/hosts/hermit/programs.nix +++ b/hosts/hermit/programs.nix @@ -18,13 +18,12 @@ comma difftastic dua - element - element-desktop evince eza fselect gcc gh + ghostty grc gparted git @@ -48,7 +47,6 @@ mprocs mpv networkmanagerapplet - nil nitch obsidian swww diff --git a/hosts/tower/configuration.nix b/hosts/tower/configuration.nix index 4a1f12b..411ac2f 100644 --- a/hosts/tower/configuration.nix +++ b/hosts/tower/configuration.nix @@ -36,6 +36,7 @@ forgejo.enable = true; grafana.enable = true; prometheus.enable = true; + plausible.enable = true; }; programs = { editors = { diff --git a/modules/programs/tui/zellij/config.kdl b/modules/programs/tui/zellij/config.kdl index 1b4604f..b26ff6f 100644 --- a/modules/programs/tui/zellij/config.kdl +++ b/modules/programs/tui/zellij/config.kdl @@ -1,161 +1,327 @@ // taken from https://lobste.rs/s/ft797a/why_zellij#c_4g7k3x - - // Make the default layout compact and non-disturbing default_layout "compact" // do not pane frames pane_frames false // do not show startup tips show_startup_tips false - // Choose the mode that zellij uses when starting up. // Default: normal // default_mode "locked" - default_shell "fish" - theme "catppuccin-frappe" - // Toggle enabling the mouse mode. On certain configurations, or terminals this // could potentially interfere with copying text. // Default: true // mouse_mode true - - // If you'd like to override the default keybindings completely, be sure to change "keybinds" to "keybinds clear-defaults=true" keybinds clear-defaults=true { - scroll { - bind "Esc" "Ctrl s" { SwitchToMode "Locked"; } - bind "e" { EditScrollback; SwitchToMode "Locked"; } - bind "/" { SwitchToMode "EnterSearch"; SearchInput 0; } - bind "Ctrl c" { ScrollToBottom; SwitchToMode "Locked"; } - bind "j" "Down" { ScrollDown; } - bind "k" "Up" { ScrollUp; } - bind "Ctrl f" "PageDown" "Right" "l" { PageScrollDown; } - bind "Ctrl b" "PageUp" "Left" "h" { PageScrollUp; } - bind "d" { HalfPageScrollDown; } - bind "u" { HalfPageScrollUp; } - bind "g" { ScrollToTop; } - bind "G" { ScrollToBottom; } + bind "Esc" "Ctrl s" { + SwitchToMode "Locked" + } + bind "e" { + EditScrollback + SwitchToMode "Locked" + } + bind "/" { + SwitchToMode "EnterSearch" + SearchInput 0 + } + bind "Ctrl c" { + ScrollToBottom + SwitchToMode "Locked" + } + bind "j" "Down" { + ScrollDown + } + bind "k" "Up" { + ScrollUp + } + bind "Ctrl f" "PageDown" "Right" "l" { + PageScrollDown + } + bind "Ctrl b" "PageUp" "Left" "h" { + PageScrollUp + } + bind "d" { + HalfPageScrollDown + } + bind "u" { + HalfPageScrollUp + } + bind "g" { + ScrollToTop + } + bind "G" { + ScrollToBottom + } } - search { - bind "Ctrl s" { SwitchToMode "Locked"; } - bind "Esc" "Ctrl c" { ScrollToBottom; SwitchToMode "Locked"; } - bind "j" "Down" { ScrollDown; } - bind "k" "Up" { ScrollUp; } - bind "Ctrl f" "PageDown" "Right" "l" { PageScrollDown; } - bind "Ctrl b" "PageUp" "Left" "h" { PageScrollUp; } - bind "d" { HalfPageScrollDown; } - bind "u" { HalfPageScrollUp; } - bind "n" { Search "down"; } - bind "p" { Search "up"; } - bind "c" { SearchToggleOption "CaseSensitivity"; } - bind "w" { SearchToggleOption "Wrap"; } - bind "o" { SearchToggleOption "WholeWord"; } + bind "Ctrl s" { + SwitchToMode "Locked" + } + bind "Esc" "Ctrl c" { + ScrollToBottom + SwitchToMode "Locked" + } + bind "j" "Down" { + ScrollDown + } + bind "k" "Up" { + ScrollUp + } + bind "Ctrl f" "PageDown" "Right" "l" { + PageScrollDown + } + bind "Ctrl b" "PageUp" "Left" "h" { + PageScrollUp + } + bind "d" { + HalfPageScrollDown + } + bind "u" { + HalfPageScrollUp + } + bind "n" { + Search "down" + } + bind "p" { + Search "up" + } + bind "c" { + SearchToggleOption "CaseSensitivity" + } + bind "w" { + SearchToggleOption "Wrap" + } + bind "o" { + SearchToggleOption "WholeWord" + } } - entersearch { - bind "Ctrl c" "Esc" { SwitchToMode "Scroll"; } - bind "Enter" { SwitchToMode "Search"; } + bind "Ctrl c" "Esc" { + SwitchToMode "Scroll" + } + bind "Enter" { + SwitchToMode "Search" + } } - renametab { - bind "Ctrl c" { SwitchToMode "Locked"; } - bind "Esc" { UndoRenameTab; SwitchToMode "Tmux"; } + bind "Ctrl c" { + SwitchToMode "Locked" + } + bind "Esc" { + UndoRenameTab + SwitchToMode "Tmux" + } } - renamepane { - bind "Ctrl c" { SwitchToMode "Locked"; } - bind "Esc" { UndoRenamePane; SwitchToMode "Tmux"; } + bind "Ctrl c" { + SwitchToMode "Locked" + } + bind "Esc" { + UndoRenamePane + SwitchToMode "Tmux" + } } - tmux { - bind "[" { SwitchToMode "Scroll"; } - bind "Ctrl Space" { Write 1; SwitchToMode "Locked"; } - bind "z" { ToggleFocusFullscreen; SwitchToMode "Locked"; } - + bind "[" { + SwitchToMode "Scroll" + } + bind "Ctrl Space" { + Write 1 + SwitchToMode "Locked" + } + bind "z" { + ToggleFocusFullscreen + SwitchToMode "Locked" + } // manipulate tabs - bind "c" { NewTab; SwitchToMode "Locked"; } - bind "K" { CloseTab; SwitchToMode "Locked"; } - bind "R" { SwitchToMode "RenameTab"; } - + bind "c" { + NewTab + SwitchToMode "Locked" + } + bind "K" { + CloseTab + SwitchToMode "Locked" + } + bind "R" { + SwitchToMode "RenameTab" + } // switch modes - bind "/" { SwitchToMode "EnterSearch"; SearchInput 0; } - + bind "/" { + SwitchToMode "EnterSearch" + SearchInput 0 + } // miscellaneous - bind "s" { ToggleActiveSyncTab; SwitchToMode "Locked"; } - bind "m" { ToggleMouseMode; SwitchToMode "Locked"; } - bind "y" { Run "yazi"; SwitchToMode "Locked"; } - + bind "s" { + ToggleActiveSyncTab + SwitchToMode "Locked" + } + bind "m" { + ToggleMouseMode + SwitchToMode "Locked" + } + bind "y" { + Run "yazi" + SwitchToMode "Locked" + } // create new pane - bind "Space" { NewPane; SwitchToMode "Locked"; } - bind "-" "_" { NewPane "Down"; SwitchToMode "Locked"; } - bind "|" "\\" { NewPane "Right"; SwitchToMode "Locked"; } - bind "r" { SwitchToMode "RenamePane"; } - + bind "Space" { + NewPane + SwitchToMode "Locked" + } + bind "-" "_" { + NewPane "Down" + SwitchToMode "Locked" + } + bind "|" "\\" { + NewPane "Right" + SwitchToMode "Locked" + } + bind "r" { + SwitchToMode "RenamePane" + } // switch between tabs - bind "h" { GoToPreviousTab; SwitchToMode "Locked"; } - bind "l" { GoToNextTab; SwitchToMode "Locked"; } - bind "1" { GoToTab 1; SwitchToMode "Locked"; } - bind "2" { GoToTab 2; SwitchToMode "Locked"; } - bind "3" { GoToTab 3; SwitchToMode "Locked"; } - bind "4" { GoToTab 4; SwitchToMode "Locked"; } - bind "5" { GoToTab 5; SwitchToMode "Locked"; } - bind "6" { GoToTab 6; SwitchToMode "Locked"; } - bind "7" { GoToTab 7; SwitchToMode "Locked"; } - bind "8" { GoToTab 8; SwitchToMode "Locked"; } - bind "9" { GoToTab 9; SwitchToMode "Locked"; } - + bind "h" { + GoToPreviousTab + SwitchToMode "Locked" + } + bind "l" { + GoToNextTab + SwitchToMode "Locked" + } + bind "1" { + GoToTab 1 + SwitchToMode "Locked" + } + bind "2" { + GoToTab 2 + SwitchToMode "Locked" + } + bind "3" { + GoToTab 3 + SwitchToMode "Locked" + } + bind "4" { + GoToTab 4 + SwitchToMode "Locked" + } + bind "5" { + GoToTab 5 + SwitchToMode "Locked" + } + bind "6" { + GoToTab 6 + SwitchToMode "Locked" + } + bind "7" { + GoToTab 7 + SwitchToMode "Locked" + } + bind "8" { + GoToTab 8 + SwitchToMode "Locked" + } + bind "9" { + GoToTab 9 + SwitchToMode "Locked" + } // switch between panes - bind "Left" { MoveFocus "Left"; } - bind "Right" { MoveFocus "Right"; } - bind "Down" { MoveFocus "Down"; } - bind "Up" { MoveFocus "Up"; } - bind "Tab" { FocusNextPane; } - + bind "Left" { + MoveFocus "Left" + } + bind "Right" { + MoveFocus "Right" + } + bind "Down" { + MoveFocus "Down" + } + bind "Up" { + MoveFocus "Up" + } + bind "Tab" { + FocusNextPane + } // move panes - bind "H" { MovePane "Left"; } - bind "J" { MovePane "Down"; } - bind "K" { MovePane "Up"; } - bind "L" { MovePane "Right"; } - + bind "H" { + MovePane "Left" + } + bind "J" { + MovePane "Down" + } + bind "K" { + MovePane "Up" + } + bind "L" { + MovePane "Right" + } // manipulate panes - bind "W" { CloseFocus; SwitchToMode "Locked"; } - + bind "W" { + CloseFocus + SwitchToMode "Locked" + } // exit etc - bind "Enter" "Esc" { SwitchToMode "Locked"; } - bind "d" { Detach; SwitchToMode "Locked"; } - bind "Q" { Quit; } - + bind "Enter" "Esc" { + SwitchToMode "Locked" + } + bind "d" { + Detach + SwitchToMode "Locked" + } + bind "Q" { + Quit + } // resizing - bind "Ctrl h" { Resize "Increase Left"; } - bind "Ctrl j" { Resize "Increase Down"; } - bind "Ctrl k" { Resize "Increase Up"; } - bind "Ctrl l" { Resize "Increase Right"; } + bind "Ctrl h" { + Resize "Increase Left" + } + bind "Ctrl j" { + Resize "Increase Down" + } + bind "Ctrl k" { + Resize "Increase Up" + } + bind "Ctrl l" { + Resize "Increase Right" + } } - shared { - bind "Alt n" { NewPane; } - bind "Alt h" { MoveFocus "Left"; } - bind "Alt j" { MoveFocus "Down"; } - bind "Alt l" { MoveFocus "Right"; } - bind "Alt k" { MoveFocus "Up"; } - bind "Ctrl h" { MoveFocus "Left"; } - bind "Ctrl j" { MoveFocus "Down"; } - bind "Ctrl l" { MoveFocus "Right"; } - bind "Ctrl k" { MoveFocus "Up"; } - bind "Alt [" { PreviousSwapLayout; } - bind "Alt ]" { NextSwapLayout; } - bind "Alt =" "Alt +" { Resize "Increase"; } - bind "Alt -" "Alt _" { Resize "Decrease"; } + bind "Alt n" { + NewPane + } + bind "Alt Ctrl h" { + MoveFocus "Left" + } + bind "Alt Ctrl j" { + MoveFocus "Down" + } + bind "Alt Ctrl l" { + MoveFocus "Right" + } + bind "Alt Ctrl k" { + MoveFocus "Up" + } + bind "Alt [" { + PreviousSwapLayout + } + bind "Alt ]" { + NextSwapLayout + } + bind "Alt =" "Alt +" { + Resize "Increase" + } + bind "Alt -" "Alt _" { + Resize "Decrease" + } } - shared_except "tmux" { - bind "Ctrl Space" { SwitchToMode "Tmux"; } + bind "Ctrl Space" { + SwitchToMode "Tmux" + } } - } + diff --git a/modules/services/monitoring/loki/module.nix b/modules/services/monitoring/loki/module.nix index f2e046a..eda11a2 100644 --- a/modules/services/monitoring/loki/module.nix +++ b/modules/services/monitoring/loki/module.nix @@ -19,7 +19,6 @@ in { package = pkgs.loki; configuration = { - }; }; }; diff --git a/modules/services/stalwart/module.nix b/modules/services/stalwart/module.nix index efc38e3..67e3d96 100644 --- a/modules/services/stalwart/module.nix +++ b/modules/services/stalwart/module.nix @@ -55,32 +55,25 @@ in { # This is the standard port for SMTP, and is used by mail servers to send email to each other. smtp = { protocol = "smtp"; - bind = ["localhost::25" "[::]:25"]; + bind = ["[::]:25"]; tls.implicit = true; }; - # SMTP submissions with implicit TLS are received on port 465 by default. # This is the standard port for SMTP submissions with native implicit TLS, # and is used by mail clients to send email to mail servers. submissions = { - bind = ["localhost:465" "[::]:465"]; + bind = ["[::]:465"]; protocol = "smtp"; tls.implicit = true; }; imaps = { - bind = ["localhost:993" "[::]:993"]; + bind = ["[::]:993"]; protocol = "imap"; tls.implicit = true; }; - jmap = { - bind = ["localhost:8080" "[::]:8080"]; - url = "https://mail.${domain}"; - protocol = "jmap"; - tls.implicit = true; - }; management = { - bind = ["localhost:8080"]; + bind = ["127.0.0.1:8080"]; protocol = "http"; tls.implicit = true; }; @@ -90,40 +83,40 @@ in { inherit domain; }; }; - storage = { - data = "postgresql"; - blob = "postgresql"; - fts = "postgresql"; - lookup = "postgresql"; - full-text = { - default-language = "en"; - }; - }; - store = { - postgresql = { - # Specifies the database type, set to "postgresql" for PostgreSQL. - type = "postgresql"; + # storage = { + # data = "postgresql"; + # blob = "postgresql"; + # fts = "postgresql"; + # lookup = "postgresql"; + # full-text = { + # default-language = "en"; + # }; + # }; + # store = { + # postgresql = { + # # Specifies the database type, set to "postgresql" for PostgreSQL. + # type = "postgresql"; - # The hostname or IP address of the PostgreSQL server. - host = "localhost"; + # # The hostname or IP address of the PostgreSQL server. + # host = "localhost"; - # Port PostgreSQL runs on. Defaults to 5432. - port = "5432"; + # # Port PostgreSQL runs on. Defaults to 5432. + # port = "5432"; - # Name of the database to connect to. - # TODO: add this to PostgreSQL. - database = "stalwart"; + # # Name of the database to connect to. + # # TODO: add this to PostgreSQL. + # database = "stalwart"; - # The username used for authentication with the PostgreSQL server. - # TODO: add this to PostgreSQL. - user = "stalwart"; + # # The username used for authentication with the PostgreSQL server. + # # TODO: add this to PostgreSQL. + # user = "stalwart"; - password = ""; + # password = ""; - # Enable TLS - tls.enable = true; - }; - }; + # # Enable TLS + # tls.enable = true; + # }; + # }; }; }; services.nginx = { diff --git a/modules/system/hardware/power.nix b/modules/system/hardware/power.nix index 93d14ff..22507af 100644 --- a/modules/system/hardware/power.nix +++ b/modules/system/hardware/power.nix @@ -38,6 +38,16 @@ in { governor = "performance"; # Turbo boost setting: "always", "auto", or "never" turbo = "auto"; + + # Enable or disable automatic turbo management (when turbo = "auto") + enable_auto_turbo = true; + # Custom thresholds for auto turbo management + turbo_auto_settings = { + load_threshold_high = 70.0; + load_threshold_low = 30.0; + temp_threshold_high = 75.0; + initial_turbo_state = false; # whether turbo should be initially enabled (false = disabled) + }; # Energy Performance Preference epp = "performance"; # Energy Performance Bias (0-15 scale or named value) @@ -54,9 +64,24 @@ in { battery = { governor = "powersave"; turbo = "auto"; + + # More conservative auto turbo settings on battery + enable_auto_turbo = true; + turbo_auto_settings = { + load_threshold_high = 80.0; + load_threshold_low = 40.0; + temp_threshold_high = 70.0; + # start with turbo disabled on battery for power savings + initial_turbo_state = false; + }; epp = "power"; epb = "balance_power"; platform_profile = "low-power"; + + # Global battery charging thresholds (applied to both profiles unless overridden) + # Start charging at 40%, stop at 80% - extends battery lifespan + # take precedence over this global setting + battery_charge_thresholds = [40 90]; min_freq_mhz = 800; max_freq_mhz = 2500; }; diff --git a/modules/system/nix/module.nix b/modules/system/nix/module.nix index 8bae420..80e2b4c 100644 --- a/modules/system/nix/module.nix +++ b/modules/system/nix/module.nix @@ -51,6 +51,9 @@ in { dates = ["21:00"]; }; + # NOTE: + # Writes the settings to /etc/nix/nix.conf. + # See `man nix.conf` for more detailed descriptions of these settings. settings = { # Tell nix to use the xdg spec for base directories # while transitioning, any state must be carried over @@ -69,7 +72,14 @@ in { # Let the system decide the number of max jobs # based on available system specs. Usually this is # the same as the number of cores your CPU has. - max-jobs = 2; + max-jobs = "auto"; + + # This option defines the maximum number of concurrent tasks during one build. + # It affects, e.g., -j option for make. The special value 0 means that the builder + # should use all available CPU cores in the system. Some builds may become + # non-deterministic with this option; use with care! + # Packages will only be affected if enableParallelBuilding is set for them. + cores = 0; # If set, Nix will perform builds in a sandboxed environment # that it will set up automatically for each build. diff --git a/modules/system/nix/nixpkgs.nix b/modules/system/nix/nixpkgs.nix index f240b96..847546a 100644 --- a/modules/system/nix/nixpkgs.nix +++ b/modules/system/nix/nixpkgs.nix @@ -1,34 +1,39 @@ # taken from raf { - # Global nixpkgs configuration. This is ignored if nixpkgs.pkgs is set - # which is a case that should be avoided. Everything that is set to configure - # nixpkgs must go here. + # Global nixpkgs configuration. + # This is ignored if nixpkgs.pkgs is set, which should be avoided. nixpkgs = { # Configuration reference: # config = { - # Disallow broken packages to be built. allowBroken = false; + # Disallow broken packages to be built. + allowBroken = false; + allowUnsupportedSystem = true; + # Warn when config contains an unrecognized attribute. + # This might be useful for getting a better configuration. + warnUndeclaredOptions = true; + # Allow unfree packages allowUnfree = true; - # Default to none, add more as necessary. This is usually where - # electron packages go when they reach EOL. - permittedInsecurePackages = ["olm-3.2.16"]; + # Permitted insecure packages in a system. + # Default to none, add more as necessary. + # Matrix also likes using deprecated libraries, which tend to go into this list. + # permittedInsecurePackages = []; - # Nixpkgs sets internal package aliases to ease migration from other - # distributions easier, or for convenience's sake. Even though the manual - # and the description for this option recommends this to be true, I prefer - # explicit naming conventions, i.e., no aliases. + # Whether to set enableParallelBuilding to true by default while + # building nixpkgs packages. Changing the default causes a mass rebuild. + enableParallelBuildingByDefault = false; + + # Whether to expose old attribute names for compatibility. + # This improves backwards compatibility, + # which I could not care less about in my configuration. allowAliases = false; # List of derivation warnings to display while rebuilding. # See: - # NOTE: "maintainerless" can be added to emit warnings - # about packages without maintainers but it seems to me - # like there are more packages without maintainers than - # with maintainers, so it's disabled for the time being. showDerivationWarnings = []; }; }; diff --git a/modules/wms/wayland/hyprland/workspaces.nix b/modules/wms/wayland/hyprland/workspaces.nix index f526436..d04397d 100644 --- a/modules/wms/wayland/hyprland/workspaces.nix +++ b/modules/wms/wayland/hyprland/workspaces.nix @@ -16,10 +16,8 @@ in { # To be able to use this for a varying amount of monitors we do some nasty trickery. # This was inspired by jacekpoz, whose configuration is linked in this project's README.md. workspace = - # We're creating several lists of workspace assignments, one for each monitor, - # and have to merge them into one big list. - (flatten - # We then use imap0 insted of map because imap0 starts indexing at zero as oppsed to one with map. + ( + # We use imap0 insted of map because imap0 starts indexing at zero as oppsed to one with map. (imap0 (monitorIndex: monitorName: ( map ( i: let @@ -35,7 +33,11 @@ in { (genList (i: i + 1 + (10 * monitorIndex)) 10) )) # our attrSet of different monitors - (attrNames monitors))) + (attrNames monitors)) + # We're creating several lists of workspace assignments, one for each monitor, + # and have to merge them into one big list. + |> flatten + ) # These are my two special workspaces ++ [ "special:nixos, decorate:false" diff --git a/modules/wms/wayland/niri/config.kdl b/modules/wms/wayland/niri/config.kdl index 46bfbf4..d0c0c00 100644 --- a/modules/wms/wayland/niri/config.kdl +++ b/modules/wms/wayland/niri/config.kdl @@ -1,9 +1,9 @@ input { keyboard { xkb { - layout "us,de" - variant ",phonetic_winkeys,,dvorak" - options "grp:rctrl_rshift_toggle,caps:escape" + layout "us,ru" + variant "phonetic_winkeys," + options "grp:rctrl_rshift_toggle,compose:104" } repeat-rate 60 repeat-delay 200 @@ -68,8 +68,8 @@ layout { } } // xwayland stuff -spawn-at-startup ", xwayland-satellite" -spawn-at-startup ", avizo-service" +spawn-at-startup "xwayland-satellite" +spawn-at-startup "avizo-service" spawn-at-startup "keepassxc" spawn-at-startup "startxfce4" spawn-at-startup "quickshell" @@ -124,11 +124,14 @@ binds { Mod+Shift+Slash { show-hotkey-overlay } + // Mod+Return { + // spawn "foot" + // } Mod+Return { - spawn "foot" + spawn "ghostty" } Mod+D { - spawn "quickshell msg launcher open" + spawn "bash" "-c" "quickshell msg launcher open" } Mod+Alt+L { spawn "swaylock" diff --git a/modules/wms/wayland/niri/module.nix b/modules/wms/wayland/niri/module.nix index 5754e76..6c731d0 100644 --- a/modules/wms/wayland/niri/module.nix +++ b/modules/wms/wayland/niri/module.nix @@ -8,11 +8,6 @@ inherit (lib.options) mkEnableOption; cfg = config.modules.desktops.niri; - - niri-config = { - }; - - toKDL = import ./toKDL.nix lib; in { options.modules.desktops.niri.enable = mkEnableOption "Niri, a scolling tiling wayland compositor"; config = mkIf cfg.enable { @@ -26,5 +21,21 @@ in { # set niri's config location to /etc/niri/config.kdl. environment.etc."niri/config.kdl".source = ./config.kdl; + + environment.systemPackages = builtins.attrValues { + inherit (pkgs) xwayland-satellite avizo; + }; + + xdg.portal = { + enable = true; + xdgOpenUsePortal = true; + extraPortals = [ + pkgs.xdg-desktop-portal-gtk + ]; + config = { + common.default = ["*"]; + hyprland.default = ["gtk"]; + }; + }; }; } diff --git a/packages/default.nix b/packages/default.nix index 4ede96b..4d313ce 100644 --- a/packages/default.nix +++ b/packages/default.nix @@ -1,10 +1,9 @@ -{ - pkgs, - helix, -}: let - wrapped-helix = pkgs.callPackage ./helix {inherit helix;}; +{pkgs}: let + inherit (pkgs) lib; + wrapped-helix = pkgs.callPackage ./helix {}; kakoune = pkgs.callPackage ./kakoune.nix {}; - fish = pkgs.callPackage ./shell {}; + fish = pkgs.callPackage ./shell {inherit lib;}; in { - inherit wrapped-helix kakoune fish; + inherit kakoune fish; + helix = wrapped-helix; } diff --git a/packages/helix/default.nix b/packages/helix/default.nix index f10b663..e93d18d 100644 --- a/packages/helix/default.nix +++ b/packages/helix/default.nix @@ -2,6 +2,8 @@ symlinkJoin, makeWrapper, callPackage, + fetchzip, + rustPlatform, alejandra, basedpyright, bash-language-server, @@ -21,7 +23,6 @@ lazygit, lib, lldb_19, - nil, nixd, ruff, rust-analyzer, @@ -40,6 +41,21 @@ }: let inherit (lib.meta) getExe; + custom-helix = helix.overrideAttrs (_: rec { + version = "25.06.1"; + src = fetchzip { + url = "https://github.com/bloxx12/helix/releases/download/${version}/helix-${version}-source.tar.xz"; + hash = "sha256-941moaBUF+aGsbFapK1cp5+NFdecSfRCTdnVUtkDQps="; + stripRoot = false; + }; + + doInstallCheck = false; + cargoDeps = rustPlatform.fetchCargoVendor { + inherit (custom-helix) src; + hash = "sha256-w07ZV1tR3lzYz4N+hI9alvFp0AHCcsItPRhVt9Sluo8="; + }; + }); + toml = formats.toml {}; helix-languages = callPackage ./languages.nix {inherit lib;}; @@ -116,7 +132,7 @@ wrapped-helix = symlinkJoin { name = "helix-wrapped"; paths = [ - helix + custom-helix # Bash bash-language-server @@ -128,13 +144,15 @@ lldb_19 # Markdown taplo - # Nix - nil + nixd rust-analyzer rustfmt # Shell shellcheck + + kdlfmt + superhtml # toml taplo diff --git a/packages/helix/languages.nix b/packages/helix/languages.nix index 39fec6b..c71a6e0 100644 --- a/packages/helix/languages.nix +++ b/packages/helix/languages.nix @@ -1,22 +1,25 @@ { + fetchFromGitHub, + rustPlatform, alejandra, basedpyright, bash-language-server, clang-tools, cmake-format, cmake-language-server, + deadnix, deno, dprint, formats, gdb, + kdePackages, lib, nil, ruff, shfmt, - kdePackages, + simple-completion-language-server, typescript-language-server, vscode-langservers-extracted, - simple-completion-language-server, zls, ... }: let @@ -24,6 +27,22 @@ toml = formats.toml {}; + # a newer nil version, for pipes support. + newer-nil = nil.overrideAttrs (_: { + version = "unstable-02-06-2025"; + + src = fetchFromGitHub { + owner = "oxalica"; + repo = "nil"; + rev = "577d160da311cc7f5042038456a0713e9863d09e"; + hash = "sha256-ggXU3RHv6NgWw+vc+HO4/9n0GPufhTIUjVuLci8Za8c="; + }; + cargoDeps = rustPlatform.fetchCargoVendor { + inherit (newer-nil) src; + hash = "sha256-uZsLlFU9GKLvFllF7Kf5Q7HfN26KQojf4rvOb9p7Rjs="; + }; + }); + helix-languages = { language = let mark = lang: { @@ -186,10 +205,13 @@ }; nil = { - command = getExe nil; + command = getExe newer-nil; # alejandro config.nil.formatting.command = ["${getExe alejandra}" "-q"]; }; + deadnix = { + command = getExe deadnix; + }; scls = { command = getExe simple-completion-language-server; diff --git a/packages/shell/default.nix b/packages/shell/default.nix index c6dd285..6d0faa6 100644 --- a/packages/shell/default.nix +++ b/packages/shell/default.nix @@ -1,33 +1,42 @@ -# This shell setup was inspired by sioodmy. Check out his setup! +# This shell setup was originally inspired by sioodmy. +# Some further cool tricks, like using vendor_conf.d to avoid having +# to build fish myself, are taken from viperml's setup. {pkgs, ...}: let + inherit (pkgs) lib; + inherit (lib.strings) concatStringsSep; + inherit (lib.attrsets) mapAttrsToList; + toml = pkgs.formats.toml {}; starship-config = import ./starship.nix; aliases = import ./aliases.nix {inherit pkgs;}; + vendorConf = "share/fish/vendor_conf.d"; - fishinit = import ./fishinit.nix {inherit pkgs aliasesStr;}; + fishinit = import ./fishinit.nix { + inherit + pkgs + aliasesStr + vendorConf + ; + }; aliasesStr = - pkgs.lib.concatStringsSep "\n" - (pkgs.lib.mapAttrsToList (k: v: "alias ${k}=\"${v}\"") aliases); - packages = import ./packages.nix pkgs; + mapAttrsToList (k: v: "alias ${k}=\"${v}\"") aliases + |> concatStringsSep "\n"; - # this was taken from viperml, check out his config for this! - custom-fish = pkgs.fish.overrideAttrs (old: { - patches = [./fish-on-tmpfs.patch]; - doCheck = false; - postInstall = - old.postInstall - + '' - echo "source ${fishinit}" >> $out/etc/fish/config.fish - ''; - }); + packages = import ./packages.nix pkgs; in (pkgs.symlinkJoin { name = "fish"; - paths = [custom-fish] ++ packages; + paths = [pkgs.fish] ++ packages; nativeBuildInputs = [pkgs.makeWrapper]; postBuild = '' - wrapProgram $out/bin/fish --set STARSHIP_CONFIG "${toml.generate "starship.toml" starship-config}" \ + wrapProgram $out/bin/fish \ + --set STARSHIP_CONFIG "${toml.generate "starship.toml" starship-config}" \ + --prefix XDG_DATA_DIRS : "${ + lib.makeSearchPathOutput "out" "share" [ + fishinit + ] + }" ''; }) .overrideAttrs (_: { diff --git a/packages/shell/fish-on-tmpfs.patch b/packages/shell/fish-on-tmpfs.patch deleted file mode 100644 index 1ff7c1b..0000000 --- a/packages/shell/fish-on-tmpfs.patch +++ /dev/null @@ -1,10 +0,0 @@ ---- a/src/path.rs -+++ b/src/path.rs -@@ -781,7 +781,7 @@ fn get_cache_directory() -> &'static BaseDirectory { - - fn get_config_directory() -> &'static BaseDirectory { - static DIR: Lazy = -- Lazy::new(|| make_base_directory(L!("XDG_CONFIG_HOME"), L!("/.config/fish"))); -+ Lazy::new(|| make_base_directory(L!("XDG_RUNTIME_DIR"), L!("/.config/fish"))); - &DIR - } diff --git a/packages/shell/fishinit.nix b/packages/shell/fishinit.nix index 69c7c6c..b243b06 100644 --- a/packages/shell/fishinit.nix +++ b/packages/shell/fishinit.nix @@ -1,9 +1,11 @@ { pkgs, aliasesStr, + vendorConf, }: -pkgs.writeText "config.fish" '' - +pkgs.writeTextDir "${vendorConf}/blox_config.fish" +# fish +'' # source ${pkgs.fishPlugins.sponge}/share/zsh-defer/zsh-defer.plugin.zsh ${pkgs.atuin}/bin/atuin init fish | source ${pkgs.zoxide}/bin/zoxide init fish | source @@ -11,6 +13,10 @@ pkgs.writeText "config.fish" '' ${pkgs.direnv}/bin/direnv hook fish | source ${pkgs.pay-respects}/bin/pay-respects fish --alias f --nocnf | source + # I need to source /etc/profile using foreign-env, to get stuff set by nixos, e.g. environment.systemVariables. + # set -p fish_function_path ${pkgs.fishPlugins.foreign-env}/share/fish/vendor_functions.d + + # fenv source /etc/profile source ${./config.fish}