diff --git a/common/auth.nix b/common/auth.nix deleted file mode 100644 index db97c36..0000000 --- a/common/auth.nix +++ /dev/null @@ -1,41 +0,0 @@ -{ - lib, - inputs, - getFlakePkg, - ... -}: -{ - environment.shellAliases = { - #make run0 use aliases - run0 = "run0 --background='' "; - s = "run0"; - }; - services.dbus.implementation = "broker"; - security = { - sudo.enable = false; - polkit = { - enable = true; - extraConfig = '' - polkit.addRule(function(action, subject) { - if (action.id == "org.freedesktop.policykit.exec") { - return polkit.Result.AUTH_ADMIN_KEEP; - } - }); - - polkit.addRule(function(action, subject) { - if (action.id.indexOf("org.freedesktop.systemd1.") == 0) { - return polkit.Result.AUTH_ADMIN_KEEP; - } - }); - ''; - }; - }; - environment.etc."polkit-1/polkitd.conf".text = '' - [Polkitd] - ExpirationSeconds=60 - ''; - imports = [ inputs.run0-shim.nixosModules.default ]; - environment.systemPackages = [ (getFlakePkg inputs.run0-shim) ]; - security.soteria.enable = true; - systemd.user.services.niri-flake-polkit = lib.mkForce { }; -} diff --git a/common/binfmts.nix b/common/binfmts.nix index 116225e..640b65e 100644 --- a/common/binfmts.nix +++ b/common/binfmts.nix @@ -1 +1 @@ -{ inputs, scope, ... }: scope "imports" <| [ inputs.qstn.nixosModules.default ] +{ inputs, ... }: scope "imports" <| [ inputs.qstn.nixosModules.default ] diff --git a/common/editor-theme.nix b/common/editor-theme.nix index e6f4c8e..8377070 100644 --- a/common/editor-theme.nix +++ b/common/editor-theme.nix @@ -1,6 +1,5 @@ { config, - scope, ... }: with config.rice.palette.hex; diff --git a/common/editor.nix b/common/editor.nix index 3119aa3..5bb42dc 100644 --- a/common/editor.nix +++ b/common/editor.nix @@ -1,12 +1,11 @@ { - inputs, - scope, - getFlakePkg, + pkgs, + lib, ... }: -scope "user.programs.helix" { +(scope "apps.editor" <| pkgs.helix) +// scope "user.programs.helix" { enable = true; - # package = getFlakePkg inputs.helix; settings = { theme = "nix-rice"; editor = { @@ -14,9 +13,9 @@ scope "user.programs.helix" { cursorline = true; true-color = true; cursor-shape = { - insert = "bar"; + insert = "block"; normal = "block"; - select = "underline"; + select = "block"; }; statusline.left = [ "mode" diff --git a/common/nix/nixpkgs.nix b/common/nix/nixpkgs.nix index 4506b9a..6fecf22 100644 --- a/common/nix/nixpkgs.nix +++ b/common/nix/nixpkgs.nix @@ -1,7 +1,6 @@ { inputs, lib, - scope, ... }: scope "nixpkgs" { diff --git a/common/nix/plugins.nix b/common/nix/plugins.nix new file mode 100644 index 0000000..b1d91c5 --- /dev/null +++ b/common/nix/plugins.nix @@ -0,0 +1,18 @@ +{ + inputs, + getFlakePkg, + ... +}: +{ + nix.settings.plugin-files = [ + "${getFlakePkg inputs.nix-scope-plugin}/lib/nix/plugins/libnix-scope-plugin.so" + ]; + imports = [ inputs.nix-shorturl-plugin.nixosModules.default ]; + nix.shorturls = { + enable = true; + schemes = { + atagen = "git+https://git.lobotomise.me/atagen/{path}"; + amaan = "github:amaanq/{path}"; + }; + }; +} diff --git a/common/nix/settings.nix b/common/nix/settings.nix index 5b1902d..ec23e6e 100644 --- a/common/nix/settings.nix +++ b/common/nix/settings.nix @@ -17,7 +17,6 @@ extraOptions = '' keep-outputs = true keep-derivations = true - allow-import-from-derivation = false ''; optimise.automatic = true; }; diff --git a/common/nix/substituters.nix b/common/nix/substituters.nix index 28b2139..9ccde0e 100644 --- a/common/nix/substituters.nix +++ b/common/nix/substituters.nix @@ -1,5 +1,4 @@ { - scope, ... }: scope "nix.settings" { @@ -11,6 +10,7 @@ scope "nix.settings" { # "https://cache.privatevoid.net" "https://cache.flox.dev" "https://cache.amaanq.com" + "https://cache.nixos-cuda.org" ]; trusted-public-keys = [ "nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs=" @@ -19,6 +19,7 @@ scope "nix.settings" { # "cache.atagen.co:SOUkNQxuu/eQ7FcI8nlUe7FpV27e7YjQlDQdn8HTUnw=" # "cache.privatevoid.net:SErQ8bvNWANeAvtsOESUwVYr2VJynfuc9JRwlzTTkVg=" "flox-cache-public-1:7F4OyH7ZCnFhcze3fJdfyXYLQw/aV7GEed86nQ7IsOs=" - "cache.amaanq.com:3qm0ZOxlHr7UQqj0G3MKlAn1votV9/3KjHGU2GQ9rEM=" + "cache.amaanq.com:H0iXsEEFsvUNtWb5v9V8Kss+L4F/tnXwDHXcY+xbmKk=" + "cache.nixos-cuda.org:74DUi4Ye579gUqzH4ziL9IyiJBlDpMRn9MBN8oNan9M=" ]; } diff --git a/common/nix/tools.nix b/common/nix/tools.nix index e9c269c..776148a 100644 --- a/common/nix/tools.nix +++ b/common/nix/tools.nix @@ -1,19 +1,15 @@ { pkgs, inputs, - getPkgs, getFlakePkg, ... }: { - environment.systemPackages = - getPkgs { - inherit (pkgs) - nixfmt - nil - ; - } - ++ [ (getFlakePkg inputs.yoke) ]; + environment.systemPackages = [ + pkgs.nixfmt + (getFlakePkg inputs.yoke) + (getFlakePkg inputs.nil) + ]; imports = [ inputs.nix-index-database.nixosModules.nix-index ]; diff --git a/common/security.nix b/common/security.nix new file mode 100644 index 0000000..ea76c0d --- /dev/null +++ b/common/security.nix @@ -0,0 +1,51 @@ +{ + lib, + inputs, + getFlakePkg, + ... +}: +{ + imports = [ + inputs.run0-shim.nixosModules.default + inputs.yoke.nixosModules.default + ]; + environment.shellAliases = { + #make run0 use aliases + run0 = "run0 --background='' "; + s = "run0"; + }; + services.dbus.implementation = "broker"; + security = { + sudo.enable = false; + polkit = { + enable = true; + extraConfig = '' + polkit.addRule(function(action, subject) { + if (action.id == "org.freedesktop.policykit.exec" || + action.id.indexOf("org.freedesktop.systemd1.") == 0) { + return polkit.Result.AUTH_ADMIN_KEEP; + } + }); + ''; + }; + }; + environment.systemPackages = [ (getFlakePkg inputs.run0-shim) ]; + security.soteria.enable = true; + systemd.user.services.polkit-soteria = { + after = [ "dbus.socket" ]; + requires = [ "dbus.socket" ]; + serviceConfig = { + Environment = [ + "DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%U/bus" + ]; + # RestartSec = 3; + }; + unitConfig = { + StartLimitIntervalSec = 30; + StartLimitBurst = 5; + }; + }; + # niri-flake is death + systemd.user.services.niri-flake-polkit = lib.mkForce { }; + services.gnome.gnome-keyring.enable = lib.mkForce false; +} diff --git a/common/systemd.nix b/common/systemd.nix index eeb770e..67a768a 100644 --- a/common/systemd.nix +++ b/common/systemd.nix @@ -1,4 +1,4 @@ -{ scope, ... }: +{ ... }: scope "systemd" { services."user@".serviceConfig.Delegate = "memory pids cpu cpuset"; user.extraConfig = "LogLevel=debug"; diff --git a/common/terminal.nix b/common/terminal.nix index 80c68fb..ce1c828 100644 --- a/common/terminal.nix +++ b/common/terminal.nix @@ -1,78 +1,298 @@ { lib, pkgs, - inputs, - getFlakePkg', + # inputs, + # getFlakePkg', + config, ... }: let - inherit (pkgs) fish nushell; + inherit (pkgs) nushell; + # init = + # let + # comma = lib.getExe' (getFlakePkg' inputs.nix-index-database "comma-with-db") "comma"; + # in + # '' + # function fish_greeting + # ${./rice/header.sh} + # echo "" + # end + # function fish_title + # set -q argv[1]; or set argv fish + # echo (fish_prompt_pwd_dir_length=100 prompt_pwd): $argv; + # end + # function fish_command_not_found + # ${comma} $argv + # end + # ''; + prompt = '' + do --env { + def prompt-header [ + --left-char: string + ]: nothing -> string { + let code = $env.LAST_EXIT_CODE + + let jj_workspace_root = try { + jj workspace root err>| ignore + } catch { + "" + } + + let hostname = if ($env.SSH_CONNECTION? | is-not-empty) { + let hostname = try { + hostname + } catch { + "remote" + } + + $"(ansi light_green_bold)@($hostname)(ansi reset) " + } else { + "" + } + + # https://github.com/nushell/nushell/issues/16205 + # + # Case insensitive filesystems strike again! + let pwd = pwd | path expand + + let body = if ($jj_workspace_root | is-not-empty) { + let subpath = $pwd | path relative-to $jj_workspace_root + let subpath = if ($subpath | is-not-empty) { + $"(ansi magenta_bold) → (ansi reset)(ansi blue)($subpath)" + } + + $"($hostname)(ansi light_yellow_bold)($jj_workspace_root | path basename)($subpath)(ansi reset)" + } else { + let pwd = if ($pwd | str starts-with $env.HOME) { + "~" | path join ($pwd | path relative-to $env.HOME) + } else { + $pwd + } + + $"($hostname)(ansi cyan)($pwd)(ansi reset)" + } + + let command_duration = ($env.CMD_DURATION_MS | into int) * 1ms + let command_duration = if $command_duration <= 2sec { + "" + } else { + $"┫(ansi light_magenta_bold)($command_duration)(ansi light_yellow_bold)┣━" + } + + let exit_code = if $code == 0 { + "" + } else { + $"┫(ansi light_red_bold)($code)(ansi light_yellow_bold)┣━" + } + + let middle = if $command_duration == "" and $exit_code == "" { + "━" + } else { + "" + } + + $"(ansi light_yellow_bold)($left_char)($exit_code)($middle)($command_duration)(ansi reset) ($body)(char newline)" + } + + $env.PROMPT_INDICATOR = $"(ansi light_yellow_bold)┃(ansi reset) " + $env.PROMPT_INDICATOR_VI_NORMAL = $env.PROMPT_INDICATOR + $env.PROMPT_INDICATOR_VI_INSERT = $env.PROMPT_INDICATOR + $env.PROMPT_MULTILINE_INDICATOR = $env.PROMPT_INDICATOR + $env.PROMPT_COMMAND = {|| + prompt-header --left-char "┏" + } + $env.PROMPT_COMMAND_RIGHT = {|| + let jj_status = try { + jj --quiet --color always --ignore-working-copy log --no-graph --revisions @ --template ' + separate( + " ", + if(empty, label("empty", "(empty)")), + coalesce( + surround( + "\"", + "\"", + if( + description.first_line().substr(0, 24).starts_with(description.first_line()), + description.first_line().substr(0, 24), + description.first_line().substr(0, 23) ++ "…" + ) + ), + label(if(empty, "empty"), description_placeholder) + ), + bookmarks.join(", "), + change_id.shortest(), + commit_id.shortest(), + if(conflict, label("conflict", "(conflict)")), + if(divergent, label("divergent prefix", "(divergent)")), + if(hidden, label("hidden prefix", "(hidden)")), + ) + ' err>| ignore + } catch { + "" + } + + $jj_status + } + } + ''; + aliases = { + "l" = "ls"; + "la" = "ls -a"; + "gco" = "git checkout"; + "gcb" = "git checkout -b"; + "gp" = "git push"; + "gpf" = "git push --force"; + "gl" = "git pull"; + "ga" = "git add"; + "gcam" = "git commit -am"; + "gcl" = "git clone"; + "gcd" = "git clone --depth 1"; + "lg" = "lazygit"; + ":q" = "exit"; + "fg" = "job unfreeze"; + "jobs" = "job list"; + }; + nuScriptsPath = "${pkgs.nu_scripts}/share/nu_scripts"; + nuConfig = pkgs.writeText "config.nu" '' + use std/config * + + ${lib.mapAttrsToList (n: v: "alias ${n} = ${v}") aliases |> lib.concatStringsSep "\n"} + $env.NU_LIB_DIRS = ( $env.NU_LIB_DIRS | append "${nuScriptsPath}") + + use ${nuScriptsPath}/modules/capture-foreign-env + source ${nuScriptsPath}/modules/formats/from-env.nu + + let nixos_env = ('source /etc/set-environment' | capture-foreign-env --shell bash) + if ($nixos_env | describe | str starts-with "record") { $nixos_env | load-env } + + source ${(pkgs.runCommand "zoxide.nu" { } ''${pkgs.zoxide}/bin/zoxide init nushell >> "$out"'')} + + + $env.config.buffer_editor = "${lib.getExe config.apps.editor}" + + def fresh [] { + clear + ${./rice/header.sh} + echo + } + + def gap [] { + git commit -a --amend --no-edit + git push --force + } + + # direnv + + # Initialize the PWD hook as an empty list if it doesn't exist + $env.config.hooks.env_change.PWD = $env.config.hooks.env_change.PWD? | default [] + + $env.config.hooks.env_change.PWD ++= [{|| + if (which direnv | is-empty) { + # If direnv isn't installed, do nothing + return + } + + direnv export json | from json | default {} | load-env + # If direnv changes the PATH, it will become a string and we need to re-convert it to a list + $env.PATH = do (env-conversions).path.from_string $env.PATH + }] + + # $cmd doesn't carry its args ? + # $env.config.hooks.command_not_found = { |cmd| , $cmd; echo } + + $env.config.table.mode = "none"; + $env.config.edit_mode = "vi"; + $env.config.completions.algorithm = "fuzzy"; + + # TODO + $env.config.color_config = { + # separator default + # header green_bold + # empty blue + # bool light_cyan + # int default + # filesize cyan + # duration default + # datetime purple + # range default + # float default + # string default + # nothing default + # binary default + # cell-path default + # row_index green_bold + # record default + # list default + # block default + # hints dark_gray + # search_result bg red + # fg white + # shape_binary purple_bold + # shape_block blue_bold + # shape_bool light_cyan + # shape_closure green_bold + # shape_custom green + # shape_datetime cyan_bold + # shape_directory cyan + # shape_external cyan + # shape_externalarg green_bold + # shape_external_resolved light_yellow_bold + # shape_filepath cyan + # shape_flag blue_bold + # shape_float purple_bold + # shape_garbage fg white + # bg red + # attr b + # shape_glob_interpolation cyan_bold + # shape_globpattern cyan_bold + # shape_int purple_bold + # shape_internalcall cyan_bold + # shape_keyword cyan_bold + # shape_list cyan_bold + # shape_literal blue + # shape_match_pattern green + # shape_matching_brackets attr u + # shape_nothing light_cyan + # shape_operator yellow + # shape_pipe purple_bold + # shape_range yellow_bold + # shape_record cyan_bold + # shape_redirection purple_bold + # shape_signature green_bold + # shape_string green + # shape_string_interpolation cyan_bold + # shape_table blue_bold + # shape_variable purple + # shape_vardecl purple + # shape_raw_string light_purple + } + + ${prompt} + + $env.config.show_banner = false + + fresh + + ''; in { - imports = [ - inputs.culr.nixosModules.culr - ]; - programs.culr = { - enable = true; - pattern = "rainbow-split"; - }; - programs.fish = { - enable = true; - shellAbbrs = { - "gco" = "git checkout"; - "gcb" = "git checkout -b"; - "gp" = "git push"; - "gpf" = "git push --force"; - "gap" = "git commit -a --amend --no-edit && git push --force"; - "gl" = "git pull"; - "ga" = "git add"; - "gcam" = "git commit -am"; - "gcl" = "git clone"; - "gcd" = "git clone --depth 1"; - ":q" = "exit"; - }; - shellAliases = { - "l" = "eza -lg --icons=always --colour=always $argv | culr"; - "la" = "eza -lg --icons=always --colour=always $argv | culr"; - "p" = "ps $argv | culr"; - "mnt" = "mount | culr"; - "fresh" = "clear; ${./rice/header.sh}; echo"; - }; - interactiveShellInit = - let - comma = lib.getExe' (getFlakePkg' inputs.nix-index-database "comma-with-db") "comma"; - in - '' - function fish_greeting - ${./rice/header.sh} - echo "" - end - function fish_title - set -q argv[1]; or set argv fish - echo (fish_prompt_pwd_dir_length=100 prompt_pwd): $argv; - end - function fish_command_not_found - ${comma} $argv - end - ''; - }; + + user.xdg.config.files."nushell/config.nu".source = nuConfig; programs.command-not-found.enable = false; - programs.zoxide = { - enable = true; - enableFishIntegration = true; + programs.zoxide.enable = true; + + environment.shellAliases = { }; environment.systemPackages = [ - fish nushell ]; environment.shells = [ - fish nushell ]; - users.defaultUserShell = fish; + users.defaultUserShell = nushell; console.font = "Lat2-Terminus16"; - environment.sessionVariables = { + environment.variables = { EDITOR = "hx"; }; diff --git a/flake.lock b/flake.lock index df06467..31101de 100644 --- a/flake.lock +++ b/flake.lock @@ -25,11 +25,11 @@ "treefmt-nix": "treefmt-nix" }, "locked": { - "lastModified": 1771000778, - "narHash": "sha256-Co3VdFeXl7abbNGEHEkjS9raX6P3yhigu162Mg6DV14=", + "lastModified": 1771605131, + "narHash": "sha256-9K3F2PSorw7cvqotXRLzz9wE29XfioMCtliFclkL/hM=", "owner": "linyinfeng", "repo": "angrr", - "rev": "6bea47aa18c2fb33aa9a363e452c037228893453", + "rev": "11fee1e3089bdbc0fb144366bc62ee8a95d4628f", "type": "github" }, "original": { @@ -55,11 +55,11 @@ }, "bunker": { "locked": { - "lastModified": 1771074280, - "narHash": "sha256-rLxr0/0BpGzVUxdnieSMicdDq6gUy013cxr+f7Y6xGc=", + "lastModified": 1772004723, + "narHash": "sha256-sTAQT6QejSY5PSJuoCRtPBAGo/wgWzglgaFqtHvv9KQ=", "owner": "amaanq", "repo": "bunker-patches", - "rev": "f6d6745428c97a4ab4ae4055619c8bb1efffd12e", + "rev": "4f77ba4e6b2579290514dcdcbbb5577b64b027cb", "type": "github" }, "original": { @@ -68,9 +68,26 @@ "type": "github" } }, + "crane": { + "locked": { + "lastModified": 1766194365, + "narHash": "sha256-4AFsUZ0kl6MXSm4BaQgItD0VGlEKR3iq7gIaL7TjBvc=", + "owner": "ipetkov", + "repo": "crane", + "rev": "7d8ec2c71771937ab99790b45e6d9b93d15d9379", + "type": "github" + }, + "original": { + "owner": "ipetkov", + "repo": "crane", + "type": "github" + } + }, "culr": { "inputs": { - "nixpkgs": "nixpkgs_2", + "nixpkgs": [ + "nixpkgs" + ], "systems": "systems" }, "locked": { @@ -298,22 +315,21 @@ "type": "github" } }, - "helix": { + "helium": { "inputs": { - "nixpkgs": "nixpkgs_3", - "rust-overlay": "rust-overlay" + "nixpkgs": "nixpkgs_2" }, "locked": { - "lastModified": 1771001199, - "narHash": "sha256-q/ZyGZIfALlPW3AxZMjfsT01daTU232JGNVkQ/eiFsE=", - "owner": "helix-editor", - "repo": "helix", - "rev": "d12a48a51e2409e876a18baf3cae1e838a9dddc3", + "lastModified": 1771320802, + "narHash": "sha256-fVwjjcxivStYGSLOYJxtEISKXv/8/TxZI4EB+wqPBpc=", + "owner": "amaanq", + "repo": "helium-flake", + "rev": "e8c651bc6b16925b1f5ede3ca2e206f22d0eb96c", "type": "github" }, "original": { - "owner": "helix-editor", - "repo": "helix", + "owner": "amaanq", + "repo": "helium-flake", "type": "github" } }, @@ -326,11 +342,11 @@ "smfh": "smfh" }, "locked": { - "lastModified": 1769053318, - "narHash": "sha256-cKETEBrseo7Iz+bOzflwy1xTpDuUj3QaLA+P49yJw8k=", + "lastModified": 1771212460, + "narHash": "sha256-1RfmXbDIxgwP2/SrYSYd9zdArUaJEm6C3FXpdRlmeso=", "owner": "feel-co", "repo": "hjem", - "rev": "9d0c8d4b44f661910595b07e6480557644c1431c", + "rev": "7f2880d705edf541955d98f56cb78f9507384423", "type": "github" }, "original": { @@ -349,11 +365,11 @@ "treefmt-nix": "treefmt-nix_2" }, "locked": { - "lastModified": 1766394058, - "narHash": "sha256-P+59TbVusYqdx2Jt2liwvQ+hslUzU6M1ezRDy6c66Tc=", + "lastModified": 1771501078, + "narHash": "sha256-Z2bux6QPs4lBzdiw5NdgPqk+BPF1H4lEu3C68ID7bYg=", "owner": "snugnug", "repo": "hjem-rum", - "rev": "edac54b7d57ad72cc4b124da2f44e7b2e584f3c6", + "rev": "57175e2f6ab7caf212dd985ef810ec1cd9abf755", "type": "github" }, "original": { @@ -384,6 +400,25 @@ "type": "github" } }, + "hudcore": { + "inputs": { + "nix-systems": "nix-systems", + "nixpkgs": "nixpkgs_4" + }, + "locked": { + "lastModified": 1771203193, + "narHash": "sha256-4x61Pk3b78cifs5CA3M2VHJRpUEgktI8DeKuQ1ybbsw=", + "ref": "refs/heads/main", + "rev": "588ff16cb8855e02c84fdbe32b577c6421f704d1", + "revCount": 2, + "type": "git", + "url": "https://git.lobotomise.me/atagen/hudcore-plymouth" + }, + "original": { + "type": "git", + "url": "https://git.lobotomise.me/atagen/hudcore-plymouth" + } + }, "kitty-themes-src": { "flake": false, "locked": { @@ -402,8 +437,10 @@ }, "meat": { "inputs": { - "nix-systems": "nix-systems", - "nixpkgs": "nixpkgs_5", + "nix-systems": "nix-systems_2", + "nixpkgs": [ + "nixpkgs" + ], "unf": "unf" }, "locked": { @@ -423,7 +460,7 @@ "naersk": { "inputs": { "fenix": "fenix", - "nixpkgs": "nixpkgs_9" + "nixpkgs": "nixpkgs_8" }, "locked": { "lastModified": 1768908532, @@ -441,7 +478,7 @@ }, "ndg": { "inputs": { - "nixpkgs": "nixpkgs_4" + "nixpkgs": "nixpkgs_3" }, "locked": { "lastModified": 1766342086, @@ -462,7 +499,7 @@ "inputs": { "flake-compat": "flake-compat_2", "flake-parts": "flake-parts_2", - "nixpkgs": "nixpkgs_6" + "nixpkgs": "nixpkgs_5" }, "locked": { "lastModified": 1748103964, @@ -478,21 +515,41 @@ "type": "github" } }, + "nil": { + "inputs": { + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1772014815, + "narHash": "sha256-er96DK9KxsSU2RE3jCvZNquvby8YzMBEygPuznZvnn8=", + "owner": "atagen", + "repo": "nil", + "rev": "f5dc3f3239f64904d901a537bd88bafe5735aa0a", + "type": "github" + }, + "original": { + "owner": "atagen", + "repo": "nil", + "type": "github" + } + }, "niri": { "inputs": { "niri-stable": "niri-stable", "niri-unstable": "niri-unstable", - "nixpkgs": "nixpkgs_8", + "nixpkgs": "nixpkgs_7", "nixpkgs-stable": "nixpkgs-stable", "xwayland-satellite-stable": "xwayland-satellite-stable", "xwayland-satellite-unstable": "xwayland-satellite-unstable" }, "locked": { - "lastModified": 1771099995, - "narHash": "sha256-d9jSUIJa5MX+Y7+OMB6FgeHxS2YHT88IUl7HA5hK8FU=", + "lastModified": 1771940378, + "narHash": "sha256-qe5t8E8uK5eSgPTxtfcde3VO8fnIr/Tu+hn72FDry/E=", "owner": "sodiboo", "repo": "niri-flake", - "rev": "3f765c47870861fafe4c6ed2e631c052aa1e1660", + "rev": "f8899e60a1425d21a03a05ac2c069a85398039b5", "type": "github" }, "original": { @@ -537,15 +594,17 @@ "inputs": { "naersk": "naersk", "niri": "niri_2", - "nixpkgs": "nixpkgs_10", + "nixpkgs": [ + "nixpkgs" + ], "systems": "systems_4" }, "locked": { - "lastModified": 1769059921, - "narHash": "sha256-/crneSsO81LVDzRMRDezpxu55a9Wxjl2HUlofB9HzKs=", + "lastModified": 1772457471, + "narHash": "sha256-y5KsYbzC3MLKr+2M1792jxs3//uV8x9kG+G0LA7cycg=", "ref": "refs/heads/main", - "rev": "30662edfe8bac80b356324e642a188f505429d80", - "revCount": 41, + "rev": "785619920b8ae1dd147da795cc7e703c3367c34a", + "revCount": 44, "type": "git", "url": "https://git.lobotomise.me/atagen/niri-tag" }, @@ -557,11 +616,11 @@ "niri-unstable": { "flake": false, "locked": { - "lastModified": 1771048216, - "narHash": "sha256-g7HP0MMezWKT3R+3uQzUe3BJ68YMRZjmhNMzKTR3Sus=", + "lastModified": 1771849386, + "narHash": "sha256-CFvjBjS2LxbBMR3Lu6wZhME6ck3CXyKUufRoJA5tlmw=", "owner": "YaLTeR", "repo": "niri", - "rev": "8e3e93b6240dc9dbc702f0b44f20177c2ce737cf", + "rev": "2dc6f4482c4eeed75ea8b133d89cad8658d38429", "type": "github" }, "original": { @@ -594,11 +653,11 @@ ] }, "locked": { - "lastModified": 1770922915, - "narHash": "sha256-6J/JoK9iL7sHvKJcGW2KId2agaKv1OGypsa7kN+ZBD4=", + "lastModified": 1771520882, + "narHash": "sha256-9SeTZ4Pwr730YfT7V8Azb8GFbwk1ZwiQDAwft3qAD+o=", "owner": "nix-darwin", "repo": "nix-darwin", - "rev": "6c5a56295d2a24e43bcd8af838def1b9a95746b2", + "rev": "6a7fdcd5839ec8b135821179eea3b58092171bcf", "type": "github" }, "original": { @@ -615,11 +674,11 @@ ] }, "locked": { - "lastModified": 1765065051, - "narHash": "sha256-b7W9WsvyMOkUScNxbzS45KEJp0iiqRPyJ1I3JBE+oEE=", + "lastModified": 1770922915, + "narHash": "sha256-6J/JoK9iL7sHvKJcGW2KId2agaKv1OGypsa7kN+ZBD4=", "owner": "nix-darwin", "repo": "nix-darwin", - "rev": "7e22bf538aa3e0937effcb1cee73d5f1bcc26f79", + "rev": "6c5a56295d2a24e43bcd8af838def1b9a95746b2", "type": "github" }, "original": { @@ -651,14 +710,14 @@ }, "nix-index-database": { "inputs": { - "nixpkgs": "nixpkgs_11" + "nixpkgs": "nixpkgs_9" }, "locked": { - "lastModified": 1770315571, - "narHash": "sha256-hy0gcAgAcxrnSWKGuNO+Ob0x6jQ2xkR6hoaR0qJBHYs=", + "lastModified": 1771734689, + "narHash": "sha256-/phvMgr1yutyAMjKnZlxkVplzxHiz60i4rc+gKzpwhg=", "owner": "Mic92", "repo": "nix-index-database", - "rev": "2684bb8080a6f2ca5f9d494de5ef875bc1c4ecdb", + "rev": "8f590b832326ab9699444f3a48240595954a4b10", "type": "github" }, "original": { @@ -672,7 +731,7 @@ "flake-parts": "flake-parts_3", "git-hooks-nix": "git-hooks-nix", "kitty-themes-src": "kitty-themes-src", - "nixpkgs": "nixpkgs_12", + "nixpkgs": "nixpkgs_10", "nixpkgs-lib": "nixpkgs-lib_2", "systems": "systems_5" }, @@ -690,6 +749,46 @@ "type": "github" } }, + "nix-scope-plugin": { + "inputs": { + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1772011628, + "narHash": "sha256-rhpsfs+/9zVr3HVqniwHyRSr92ga4J4mczFdHr1PN4s=", + "ref": "refs/heads/main", + "rev": "0e5218513ec92ee751e7a0dc854082106b77473c", + "revCount": 1, + "type": "git", + "url": "https://git.lobotomise.me/atagen/nix-scope-plugin" + }, + "original": { + "type": "git", + "url": "https://git.lobotomise.me/atagen/nix-scope-plugin" + } + }, + "nix-shorturl-plugin": { + "inputs": { + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1771986085, + "narHash": "sha256-M7koECMnoi+7eI0yGj+Rxiu9gC/hdbJtwUR0AyTuFsY=", + "ref": "refs/heads/main", + "rev": "807c3b0094963bb78198643b62b78e2a0c916230", + "revCount": 1, + "type": "git", + "url": "https://git.lobotomise.me/atagen/nix-shorturl-plugin" + }, + "original": { + "type": "git", + "url": "https://git.lobotomise.me/atagen/nix-shorturl-plugin" + } + }, "nix-systems": { "locked": { "lastModified": 1689347949, @@ -705,13 +804,28 @@ "type": "github" } }, + "nix-systems_2": { + "locked": { + "lastModified": 1689347949, + "narHash": "sha256-12tWmuL2zgBgZkdoB6qXZsgJEH9LR3oUgpaQq2RbI80=", + "owner": "nix-systems", + "repo": "default-linux", + "rev": "31732fcf5e8fea42e59c2488ad31a0e651500f68", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default-linux", + "type": "github" + } + }, "nixpkgs": { "locked": { - "lastModified": 1770841267, - "narHash": "sha256-9xejG0KoqsoKEGp2kVbXRlEYtFFcDTHjidiuX8hGO44=", + "lastModified": 1771369470, + "narHash": "sha256-0NBlEBKkN3lufyvFegY4TYv5mCNHbi5OmBDrzihbBMQ=", "owner": "nixos", "repo": "nixpkgs", - "rev": "ec7c70d12ce2fc37cb92aff673dcdca89d187bae", + "rev": "0182a361324364ae3f436a63005877674cf45efb", "type": "github" }, "original": { @@ -768,11 +882,11 @@ }, "nixpkgs-stable": { "locked": { - "lastModified": 1771043024, - "narHash": "sha256-O1XDr7EWbRp+kHrNNgLWgIrB0/US5wvw9K6RERWAj6I=", + "lastModified": 1771903837, + "narHash": "sha256-sdaqdnsQCv3iifzxwB22tUwN/fSHoN7j2myFW5EIkGk=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "3aadb7ca9eac2891d52a9dec199d9580a6e2bf44", + "rev": "e764fc9a405871f1f6ca3d1394fb422e0a0c3951", "type": "github" }, "original": { @@ -784,11 +898,11 @@ }, "nixpkgs-stable_2": { "locked": { - "lastModified": 1771043024, - "narHash": "sha256-O1XDr7EWbRp+kHrNNgLWgIrB0/US5wvw9K6RERWAj6I=", + "lastModified": 1771903837, + "narHash": "sha256-sdaqdnsQCv3iifzxwB22tUwN/fSHoN7j2myFW5EIkGk=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "3aadb7ca9eac2891d52a9dec199d9580a6e2bf44", + "rev": "e764fc9a405871f1f6ca3d1394fb422e0a0c3951", "type": "github" }, "original": { @@ -799,38 +913,6 @@ } }, "nixpkgs_10": { - "locked": { - "lastModified": 1768875095, - "narHash": "sha256-dYP3DjiL7oIiiq3H65tGIXXIT1Waiadmv93JS0sS+8A=", - "owner": "nixos", - "repo": "nixpkgs", - "rev": "ed142ab1b3a092c4d149245d0c4126a5d7ea00b0", - "type": "github" - }, - "original": { - "owner": "nixos", - "ref": "nixpkgs-unstable", - "repo": "nixpkgs", - "type": "github" - } - }, - "nixpkgs_11": { - "locked": { - "lastModified": 1770197578, - "narHash": "sha256-AYqlWrX09+HvGs8zM6ebZ1pwUqjkfpnv8mewYwAo+iM=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "00c21e4c93d963c50d4c0c89bfa84ed6e0694df2", - "type": "github" - }, - "original": { - "owner": "NixOS", - "ref": "nixos-unstable", - "repo": "nixpkgs", - "type": "github" - } - }, - "nixpkgs_12": { "locked": { "lastModified": 1768810879, "narHash": "sha256-6RrqzfHu3e4vvRaDRY0muyl/BkFzCEPfwXmYY8iRjSw=", @@ -845,13 +927,28 @@ "type": "github" } }, - "nixpkgs_13": { + "nixpkgs_11": { "locked": { - "lastModified": 1771008912, - "narHash": "sha256-gf2AmWVTs8lEq7z/3ZAsgnZDhWIckkb+ZnAo5RzSxJg=", + "lastModified": 1772016756, + "narHash": "sha256-noRPhcPF6zI2Wc3khn2Uo01AMmLO7CLFRcgSN1CQXSg=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "a82ccc39b39b621151d6732718e3e250109076fa", + "rev": "154d55d78649878684bc797cec119e66cceed8b5", + "type": "github" + }, + "original": { + "owner": "NixOS", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_12": { + "locked": { + "lastModified": 1766309749, + "narHash": "sha256-3xY8CZ4rSnQ0NqGhMKAy5vgC+2IVK0NoVEzDoOh4DA4=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "a6531044f6d0bef691ea18d4d4ce44d0daa6e816", "type": "github" }, "original": { @@ -861,7 +958,7 @@ "type": "github" } }, - "nixpkgs_14": { + "nixpkgs_13": { "locked": { "lastModified": 1769018530, "narHash": "sha256-MJ27Cy2NtBEV5tsK+YraYr2g851f3Fl1LpNHDzDX15c=", @@ -877,45 +974,13 @@ "type": "github" } }, - "nixpkgs_15": { - "locked": { - "lastModified": 1761656231, - "narHash": "sha256-EiED5k6gXTWoAIS8yQqi5mAX6ojnzpHwAQTS3ykeYMg=", - "owner": "nixos", - "repo": "nixpkgs", - "rev": "e99366c665bdd53b7b500ccdc5226675cfc51f45", - "type": "github" - }, - "original": { - "owner": "nixos", - "ref": "nixpkgs-unstable", - "repo": "nixpkgs", - "type": "github" - } - }, "nixpkgs_2": { "locked": { - "lastModified": 1733935885, - "narHash": "sha256-xyiHLs6KJ1fxeGmcCxKjJE4yJknVJxbC8Y/ZRYyC8WE=", + "lastModified": 1770562336, + "narHash": "sha256-ub1gpAONMFsT/GU2hV6ZWJjur8rJ6kKxdm9IlCT0j84=", "owner": "nixos", "repo": "nixpkgs", - "rev": "5a48e3c2e435e95103d56590188cfed7b70e108c", - "type": "github" - }, - "original": { - "owner": "nixos", - "ref": "nixpkgs-unstable", - "repo": "nixpkgs", - "type": "github" - } - }, - "nixpkgs_3": { - "locked": { - "lastModified": 1759381078, - "narHash": "sha256-gTrEEp5gEspIcCOx9PD8kMaF1iEmfBcTbO0Jag2QhQs=", - "owner": "nixos", - "repo": "nixpkgs", - "rev": "7df7ff7d8e00218376575f0acdcc5d66741351ee", + "rev": "d6c71932130818840fc8fe9509cf50be8c64634f", "type": "github" }, "original": { @@ -925,7 +990,7 @@ "type": "github" } }, - "nixpkgs_4": { + "nixpkgs_3": { "locked": { "lastModified": 1766070988, "narHash": "sha256-G/WVghka6c4bAzMhTwT2vjLccg/awmHkdKSd2JrycLc=", @@ -941,13 +1006,13 @@ "type": "github" } }, - "nixpkgs_5": { + "nixpkgs_4": { "locked": { - "lastModified": 1748217807, - "narHash": "sha256-P3u2PXxMlo49PutQLnk2PhI/imC69hFl1yY4aT5Nax8=", + "lastModified": 1746397377, + "narHash": "sha256-5oLdRa3vWSRbuqPIFFmQBGGUqaYZBxX+GGtN9f/n4lU=", "owner": "nixos", "repo": "nixpkgs", - "rev": "3108eaa516ae22c2360928589731a4f1581526ef", + "rev": "ed30f8aba41605e3ab46421e3dcb4510ec560ff8", "type": "github" }, "original": { @@ -957,7 +1022,7 @@ "type": "github" } }, - "nixpkgs_6": { + "nixpkgs_5": { "locked": { "lastModified": 1745930157, "narHash": "sha256-y3h3NLnzRSiUkYpnfvnS669zWZLoqqI6NprtLQ+5dck=", @@ -973,7 +1038,7 @@ "type": "github" } }, - "nixpkgs_7": { + "nixpkgs_6": { "locked": { "lastModified": 1748217807, "narHash": "sha256-P3u2PXxMlo49PutQLnk2PhI/imC69hFl1yY4aT5Nax8=", @@ -989,13 +1054,13 @@ "type": "github" } }, - "nixpkgs_8": { + "nixpkgs_7": { "locked": { - "lastModified": 1771008912, - "narHash": "sha256-gf2AmWVTs8lEq7z/3ZAsgnZDhWIckkb+ZnAo5RzSxJg=", + "lastModified": 1771848320, + "narHash": "sha256-0MAd+0mun3K/Ns8JATeHT1sX28faLII5hVLq0L3BdZU=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "a82ccc39b39b621151d6732718e3e250109076fa", + "rev": "2fc6539b481e1d2569f25f8799236694180c0993", "type": "github" }, "original": { @@ -1005,7 +1070,7 @@ "type": "github" } }, - "nixpkgs_9": { + "nixpkgs_8": { "locked": { "lastModified": 1752077645, "narHash": "sha256-HM791ZQtXV93xtCY+ZxG1REzhQenSQO020cu6rHtAPk=", @@ -1021,6 +1086,22 @@ "type": "github" } }, + "nixpkgs_9": { + "locked": { + "lastModified": 1771369470, + "narHash": "sha256-0NBlEBKkN3lufyvFegY4TYv5mCNHbi5OmBDrzihbBMQ=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "0182a361324364ae3f436a63005877674cf45efb", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, "qstn": { "inputs": { "nixpkgs": [ @@ -1048,19 +1129,24 @@ "arbys": "arbys", "bunker": "bunker", "culr": "culr", - "helix": "helix", + "helium": "helium", "hjem": "hjem", "hjem-rum": "hjem-rum", + "hudcore": "hudcore", "meat": "meat", + "nil": "nil", "niri": "niri", "niri-s76": "niri-s76", "niri-tag": "niri-tag", "nix-index-database": "nix-index-database", "nix-rice": "nix-rice", - "nixpkgs": "nixpkgs_13", + "nix-scope-plugin": "nix-scope-plugin", + "nix-shorturl-plugin": "nix-shorturl-plugin", + "nixpkgs": "nixpkgs_11", "nixpkgs-stable": "nixpkgs-stable_2", "qstn": "qstn", "run0-shim": "run0-shim", + "stash": "stash", "stasis": "stasis", "yoke": "yoke" } @@ -1072,7 +1158,7 @@ "nixpkgs": [ "nixpkgs" ], - "rust-overlay": "rust-overlay_4", + "rust-overlay": "rust-overlay_3", "treefmt-nix": "treefmt-nix_3" }, "locked": { @@ -1109,16 +1195,17 @@ "rust-overlay": { "inputs": { "nixpkgs": [ - "helix", + "hjem", + "smfh", "nixpkgs" ] }, "locked": { - "lastModified": 1759631821, - "narHash": "sha256-V8A1L0FaU/aSXZ1QNJScxC12uP4hANeRBgI4YdhHeRM=", + "lastModified": 1771125043, + "narHash": "sha256-ldf/s49n6rOAxl7pYLJGGS1N/assoHkCOWdEdLyNZkc=", "owner": "oxalica", "repo": "rust-overlay", - "rev": "1d7cbdaad90f8a5255a89a6eddd8af24dc89cafe", + "rev": "4912f951a26dc8142b176be2c2ad834319dc06e8", "type": "github" }, "original": { @@ -1128,28 +1215,6 @@ } }, "rust-overlay_2": { - "inputs": { - "nixpkgs": [ - "hjem", - "smfh", - "nixpkgs" - ] - }, - "locked": { - "lastModified": 1763347184, - "narHash": "sha256-6QH8hpCYJxifvyHEYg+Da0BotUn03BwLIvYo3JAxuqQ=", - "owner": "oxalica", - "repo": "rust-overlay", - "rev": "08895cce80433978d5bfd668efa41c5e24578cbd", - "type": "github" - }, - "original": { - "owner": "oxalica", - "repo": "rust-overlay", - "type": "github" - } - }, - "rust-overlay_3": { "inputs": { "nixpkgs": [ "hjem-rum", @@ -1172,7 +1237,7 @@ "type": "github" } }, - "rust-overlay_4": { + "rust-overlay_3": { "inputs": { "nixpkgs": [ "run0-shim", @@ -1199,15 +1264,15 @@ "hjem", "nixpkgs" ], - "rust-overlay": "rust-overlay_2", + "rust-overlay": "rust-overlay", "systems": "systems_2" }, "locked": { - "lastModified": 1763430012, - "narHash": "sha256-06G7pXUdpMnUqR0JWWvV7sA8oNGOZU1cSLqQS1GMf7Y=", + "lastModified": 1771208268, + "narHash": "sha256-6zMgOPzBbTSm8jzPqmGcotjvkN3HzxcnMM8pW64JpZQ=", "owner": "feel-co", "repo": "smfh", - "rev": "eddda76e3dd4c6deaea5f819f174fc16dbe70f90", + "rev": "dd0a33fc9d1fe7c29da86225af4b4a47b1714839", "type": "github" }, "original": { @@ -1223,7 +1288,7 @@ "hjem", "nixpkgs" ], - "rust-overlay": "rust-overlay_3", + "rust-overlay": "rust-overlay_2", "systems": "systems_3" }, "locked": { @@ -1240,17 +1305,36 @@ "type": "github" } }, + "stash": { + "inputs": { + "crane": "crane", + "nixpkgs": "nixpkgs_12" + }, + "locked": { + "lastModified": 1772183710, + "narHash": "sha256-ojaPFnfWFRUi4Nc69T+ObdZ3Bxf62T3bv49qqV+wgHw=", + "owner": "notashelf", + "repo": "stash", + "rev": "181edcefb1fb38bbd1ca306e91ba493bcf4014d9", + "type": "github" + }, + "original": { + "owner": "notashelf", + "repo": "stash", + "type": "github" + } + }, "stasis": { "inputs": { "flake-parts": "flake-parts_4", - "nixpkgs": "nixpkgs_14" + "nixpkgs": "nixpkgs_13" }, "locked": { - "lastModified": 1770955222, - "narHash": "sha256-XK7e2x1Q5xxyofswmrqc7pz7WA0EmrT5aWnaHaFy5hg=", + "lastModified": 1772174212, + "narHash": "sha256-Rq3JnZAYzysIPdcVVM/ctKBARPGxKzzae2owVwqNPt8=", "owner": "saltnpepper97", "repo": "stasis", - "rev": "02086d0f96871e75444a0f202703380a46aa5b61", + "rev": "6ce1a1391e1157457a588701b8ca21e3d72fd7f1", "type": "github" }, "original": { @@ -1430,7 +1514,7 @@ "unf": { "inputs": { "ndg": "ndg_2", - "nixpkgs": "nixpkgs_7" + "nixpkgs": "nixpkgs_6" }, "locked": { "lastModified": 1748163740, @@ -1466,11 +1550,11 @@ "xwayland-satellite-unstable": { "flake": false, "locked": { - "lastModified": 1770583271, - "narHash": "sha256-Q75S8cEqJoZ92s1y4zArvk2U1ayAy2E4SaF7gbNXkYQ=", + "lastModified": 1771787042, + "narHash": "sha256-7bM6Y4KldhKnfopSALF8XALxcX7ehkomXH9sPl4MXp0=", "owner": "Supreeeme", "repo": "xwayland-satellite", - "rev": "86f5bd5d867ad6e120935dfe825f6b903ebbeddd", + "rev": "33c344fee50504089a447a8fef5878cf4f6215fc", "type": "github" }, "original": { @@ -1481,15 +1565,17 @@ }, "yoke": { "inputs": { - "nixpkgs": "nixpkgs_15", + "nixpkgs": [ + "nixpkgs" + ], "systems": "systems_7" }, "locked": { - "lastModified": 1769664021, - "narHash": "sha256-6B99PvFbUW5ca0ucvpI6eWF2wSAUts/5LPZUQvErEkg=", + "lastModified": 1772106982, + "narHash": "sha256-XyHN0Wl9dxknzsAR8c/Ce3BjtqbNhv11xIRG0KeEvm4=", "ref": "refs/heads/main", - "rev": "c53377a5046f70493ac268aedb5824add94c4ba1", - "revCount": 11, + "rev": "bf06ab5fe821bfa033c290f49949b8adffbef56e", + "revCount": 12, "type": "git", "url": "https://git.lobotomise.me/atagen/yoke" }, diff --git a/flake.nix b/flake.nix index 90d9cf9..e306cc3 100644 --- a/flake.nix +++ b/flake.nix @@ -4,18 +4,22 @@ outputs = _: { }; inputs = { - nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; + nixpkgs.url = "github:NixOS/nixpkgs"; nixpkgs-stable.url = "github:NixOS/nixpkgs/nixos-25.11"; - helix.url = "github:helix-editor/helix"; - nix-index-database.url = "github:Mic92/nix-index-database"; nix-rice.url = "github:bertof/nix-rice"; - meat.url = "git+https://git.lobotomise.me/atagen/meat"; + meat = { + url = "atagen:meat"; + inputs.nixpkgs.follows = "nixpkgs"; + }; - culr.url = "git+https://git.lobotomise.me/atagen/culr"; + culr = { + url = "atagen:culr"; + inputs.nixpkgs.follows = "nixpkgs"; + }; niri.url = "github:sodiboo/niri-flake"; @@ -29,15 +33,18 @@ inputs.nixpkgs.follows = "nixpkgs"; }; - # hudcore.url = "git+https://git.lobotomise.me/atagen/hudcore-plymouth.git"; - - niri-tag.url = "git+https://git.lobotomise.me/atagen/niri-tag"; + hudcore.url = "atagen:hudcore-plymouth"; + niri-tag = { + url = "atagen:niri-tag"; + inputs.nixpkgs.follows = "nixpkgs"; + }; angrr.url = "github:linyinfeng/angrr"; - arbys.url = "git+https://git.lobotomise.me/atagen/arbys"; + arbys.url = "atagen:arbys"; + qstn = { - url = "git+https://git.lobotomise.me/atagen/qstn"; + url = "atagen:qstn"; inputs.nixpkgs.follows = "nixpkgs"; }; @@ -46,18 +53,40 @@ flake = false; }; - yoke.url = "git+https://git.lobotomise.me/atagen/yoke"; + yoke = { + url = "atagen:yoke"; + inputs.nixpkgs.follows = "nixpkgs"; + }; run0-shim = { url = "github:lordgrimmauld/run0-sudo-shim"; inputs.nixpkgs.follows = "nixpkgs"; }; - bunker.url = "github:amaanq/bunker-patches"; + bunker.url = "amaan:bunker-patches"; stasis.url = "github:saltnpepper97/stasis"; - niri-s76.url = "git+https://git.lobotomise.me/atagen/niri-s76-bridge"; + niri-s76.url = "atagen:niri-s76-bridge"; + + helium.url = "amaan:helium-flake"; + + nil = { + url = "github:atagen/nil"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + + nix-scope-plugin = { + url = "atagen:nix-scope-plugin"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + + nix-shorturl-plugin = { + url = "atagen:nix-shorturl-plugin"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + + stash.url = "github:notashelf/stash"; }; diff --git a/graphical/binds.nix b/graphical/binds.nix index 6d41925..bcf478b 100644 --- a/graphical/binds.nix +++ b/graphical/binds.nix @@ -1,7 +1,6 @@ { lib, config, - scope, ... }: let @@ -54,21 +53,11 @@ scope "user.desktops.niri.binds" "toggle-tag" "99" ]; - "Mod+Shift+Minus".spawn = [ - "tagctl" - "toggle" - "99" - ]; "Mod+Equal".spawn = [ "tagctl" "toggle-tag" "101" ]; - "Mod+Shift+Equal".spawn = [ - "tagctl" - "toggle" - "101" - ]; "Mod+D".spawn = [ "qs" "ipc" @@ -86,7 +75,6 @@ scope "user.desktops.niri.binds" "logout" "toggle" ]; - # "Mod+Equal".spawn = (getAppName "passwordManager"); # niri-tag needs proper scratchpads smh "Mod+Shift+Q".action = "close-window"; "Mod+Shift+S".action = "screenshot"; "Mod+R".action = "switch-preset-column-width"; diff --git a/graphical/boot.nix b/graphical/boot.nix index 0571183..05048c8 100644 --- a/graphical/boot.nix +++ b/graphical/boot.nix @@ -1,6 +1,5 @@ { config, - scope, machineName, mainUser, ... diff --git a/graphical/browser.nix b/graphical/browser.nix index 47ecff6..c8d0e7f 100644 --- a/graphical/browser.nix +++ b/graphical/browser.nix @@ -1,94 +1,60 @@ { lib, pkgs, - scope, + inputs, + getFlakePkg, ... }: let - officialAddon = name: { - install_url = lib.strings.concatStrings [ - "https://addons.mozilla.org/firefox/downloads/latest/" - name - "/latest.xpi" - ]; - installation_mode = "force_installed"; - }; - lock-false = { - Value = false; - Status = "locked"; - }; - lock-true = { - Value = true; - Status = "locked"; + extensions = { + adnauseam = { + id = "dlkmkipjfgcmnfckfdflcemkhlfbeiak"; + updateUrl = "https://gist.githubusercontent.com/amaanq/791db15b547cf00d27c99e784bbe0459/raw/adnauseam-updates.xml"; + }; + bypass-paywalls = { + id = "lkbebcjgcmobigpeffafkodonchffocl"; + updateUrl = "https://gitflic.ru/project/magnolia1234/bpc_updates/blob/raw?file=updates.xml"; + }; + vencord = { + id = "jfcaohdhgnfchhifdffmldmodkmndfjp"; + updateUrl = "https://github.com/amaanq/Vencord/releases/latest/download/updates.xml"; + }; + bitwarden.id = "nngceckbapebfimnlniiiahkandclblb"; + clearurls.id = "lckanjgmijmafbedllaakclkaicjfmnk"; + dark-reader.id = "eimadpbcbfnmbkopoojfekhnkhdbieeh"; + i-still-dont-care-about-cookies.id = "edibdbjcniadpccecjdfdjjppcpchdlm"; + fastforward.id = "icallnadddjmdinamnolclfjanhfoafe"; + refined-github.id = "hlepfoohegkhhmjieoechaddaejaokhf"; + sponsorblock.id = "mnjggcdmjocbbbhaepdhchncahnbgone"; + vimium-c.id = "hfjbmagddngcpeloejdejnfgbamkjaeg"; + web-archives.id = "hkligngkgcpcolhcnkgccglchdafcnao"; + # webrtc-leak-shield.id = "bppamachkoflopbagkdoflbgfjflfnfl"; }; + extensionStrings = map ( + key: + let + ext = extensions.${key}; + url = ext.updateUrl or "https://services.helium.imput.net/ext"; + in + "${ext.id};${url}" + ) (builtins.attrNames extensions); in -scope "programs.firefox" { +(scope "apps.browser" <| getFlakePkg inputs.helium) +// scope "programs.chromium" { enable = true; - - policies = { - DisableTelemetry = true; - DisableFirefoxStudies = true; - EnableTrackingProtection = { - Value = true; - Locked = true; - Cryptomining = true; - Fingerprinting = true; - }; - DisablePocket = true; - DisableFirefoxAccounts = true; - DisableAccounts = true; - DisableFirefoxScreenshots = true; - DisableAppUpdate = true; - DisablePrivateBrowsing = true; - DontCheckDefaultBrowser = true; - - OverrideFirstRunPage = ""; - OverridePostUpdatePage = ""; - DisplayBookmarksToolbar = "newtab"; # alternatives: "always" or "newtab" - DisplayMenuBar = "default-off"; # alternatives: "always", "never" or "default-on" - SearchBar = "unified"; # alternative: "separate" - - ExtensionSettings = { - "*".installation_mode = "blocked"; # blocks all addons except the ones specified below - "uBlock0@raymondhill.net" = officialAddon "ublock-origin"; - "addon@darkreader.org" = officialAddon "darkreader"; - "vimium-c@gdh1995.cn" = officialAddon "vimium-c"; - "{b86e4813-687a-43e6-ab65-0bde4ab75758}" = officialAddon "localcdn-fork-of-decentraleyes"; - "jid1-5Fs7iTLscUaZBgwr@jetpack" = officialAddon "happy-bonobo-disable-webrtc"; - "{446900e4-71c2-419f-a6a7-df9c091e268b}" = officialAddon "bitwarden-password-mananger"; - }; - - Preferences = { - "extensions.pocket.enabled" = lock-false; - "extensions.screenshots.disabled" = lock-true; - "browser.topsites.contile.enabled" = lock-false; - "browser.formfill.enable" = lock-false; - "browser.search.suggest.enabled" = lock-false; - "browser.search.suggest.enabled.private" = lock-false; - "browser.urlbar.suggest.searches" = lock-false; - "browser.urlbar.showSearchSuggestionsFirst" = lock-false; - "browser.newtabpage.activity-stream.feeds.section.topstories" = lock-false; - "browser.newtabpage.activity-stream.feeds.snippets" = lock-false; - "browser.newtabpage.activity-stream.section.highlights.includePocket" = lock-false; - "browser.newtabpage.activity-stream.section.highlights.includeBookmarks" = lock-false; - "browser.newtabpage.activity-stream.section.highlights.includeDownloads" = lock-false; - "browser.newtabpage.activity-stream.section.highlights.includeVisited" = lock-false; - "browser.newtabpage.activity-stream.showSponsored" = lock-false; - "browser.newtabpage.activity-stream.system.showSponsored" = lock-false; - "browser.newtabpage.activity-stream.showSponsoredTopSites" = lock-false; - }; + extensions = extensionStrings; + extraOpts = { + PrivacySandboxFingerprintingProtectionEnabled = true; + PrivacySandboxIpProtectionEnabled = true; + # Explicitly allow our extensions + ExtensionInstallAllowlist = map (entry: entry.value.id) (lib.attrsToList extensions); + # Allow extensions from Helium proxy and self-hosted sources + ExtensionInstallSources = [ + "https://services.helium.imput.net/*" # Helium proxy + "https://rednoise.org/*" # AdNauseam manifest + "https://github.com/*" # AdNauseam CRX host + "https://*.githubusercontent.com/*" # GitHub release assets + "https://gitflic.ru/*" # Bypass Paywalls + ]; }; - - # profiles.default = { - # id = 0; - # name = "Default"; - # settings = { - # "browser.startup.homepage" = "about:blank"; - # "browser.shell.didSkipDefaultBrowserCheckOnFirstRun" = true; - # "browser.policies.applied" = true; - # "widget.use-xdg-desktop-portal.file-picker" = 1; - # "widget.use-xdg-desktop-portal.mime-handler" = 1; - # }; - # }; } -// (scope "apps.browser" <| pkgs.firefox) diff --git a/graphical/chat.nix b/graphical/chat.nix index bac991c..bcabadd 100644 --- a/graphical/chat.nix +++ b/graphical/chat.nix @@ -1,18 +1,30 @@ -{ config, pkgs, ... }: +{ pkgs, ... }: { - user.packages = [ pkgs.element-desktop ]; - # hm.programs.firefox.webapps = { - # "Microsoft-Teams" = { - # url = "https://teams.microsoft.com"; - # extraSettings = config.hm.programs.firefox.profiles.default.settings; - # name = "Microsoft Teams"; - # icon = ../assets/ms_teams.png; - # }; - # "Facebook-Messenger" = { - # url = "https://www.messenger.com"; - # extraSettings = config.hm.programs.firefox.profiles.default.settings; - # name = "Facebook Messenger"; - # icon = ../assets/fb_msg.png; - # }; - # }; + programs.pwas = + let + papirusIcon = app: "${pkgs.papirus-icon-theme}/share/icons/Papirus-Dark/16x16/apps/${app}.svg"; + in + { + cinny = { + name = "Cinny"; + url = "https://chat.lobotomise.me"; + icon = papirusIcon "in.cinny.Cinny"; + description = "Cinny, a Matrix client"; + }; + discord = { + name = "Discord"; + url = "https://discord.com/app"; + icon = papirusIcon "discord"; + description = "Discord Web"; + }; + fb-messenger = { + name = "FB Messenger"; + url = "https://m.me"; + icon = papirusIcon "facebook-facebook.com.svg"; + description = "Facebook Messenger"; + }; + }; + xdg.mime.defaultApplications = { + "x-scheme-handler/matrix" = "Cinny-webapp.desktop"; + }; } diff --git a/graphical/desktop/niri.kdl b/graphical/desktop/niri.kdl index 1a3f066..ae7d653 100644 --- a/graphical/desktop/niri.kdl +++ b/graphical/desktop/niri.kdl @@ -53,3 +53,14 @@ window-rule { clip-to-geometry true } xwayland-satellite { path "%SATELLITE%"; } +spawn-at-startup "systemctl" "--user" "start" "startup-sound.service" +window-rule { + match app-id="Bitwarden" + open-floating true + default-column-width { proportion 0.2; } +} +window-rule { + match app-id="chrome-listen.lobotomise.me__-Default" + open-floating true + default-column-width { proportion 0.2; } +} diff --git a/graphical/desktop/quickshell/shell.qml b/graphical/desktop/quickshell/shell.qml index f70eda6..3410a0f 100644 --- a/graphical/desktop/quickshell/shell.qml +++ b/graphical/desktop/quickshell/shell.qml @@ -4,13 +4,12 @@ import "launcher" as Launcher import "logout" as Logout // singletons import "title" -import "tags" +import "tags" import "rice" import Quickshell import Quickshell.Wayland import QtQuick -import QtQuick.Controls ShellRoot { @@ -18,9 +17,10 @@ ShellRoot { Variants { model: Quickshell.screens Scope { + id: screenScope property var modelData PanelWindow { - screen: modelData + screen: screenScope.modelData id: bg anchors { top: true @@ -163,7 +163,6 @@ ShellRoot { implicitHeight: 22 implicitWidth: (Tags.keys.length !== undefined) ? Tags.keys.length * 13 + 24 : 37; - // implicitWidth:.width + 24 color: "transparent" Rectangle { diff --git a/graphical/desktop/quickshell/tags/Tags.qml b/graphical/desktop/quickshell/tags/Tags.qml index e90da61..73aecbc 100644 --- a/graphical/desktop/quickshell/tags/Tags.qml +++ b/graphical/desktop/quickshell/tags/Tags.qml @@ -8,7 +8,8 @@ Singleton { id: data property var tags: ({}) property var keys: [] - Timer { + +Timer { id: reconnectTimer running: false repeat: true @@ -43,37 +44,41 @@ Singleton { return d; }; + let t = {}; + for (const k of Object.keys(data.tags)) { + t[k] = Object.assign({}, data.tags[k]); + } + if (event.TagEmpty) { - data.tags = ensure(data.tags, event.TagEmpty); - data.tags[event.TagEmpty].occupied = false; + t = ensure(t, event.TagEmpty); + t[event.TagEmpty].occupied = false; } else if (event.TagOccupied) { - data.tags = ensure(data.tags, event.TagOccupied); - data.tags[event.TagOccupied].occupied = true; + t = ensure(t, event.TagOccupied); + t[event.TagOccupied].occupied = true; } else if (event.TagUrgent) { - data.tags = ensure(data.tags, event.TagUrgent); - data.tags[event.TagUrgent].urgent = true; + t = ensure(t, event.TagUrgent); + t[event.TagUrgent].urgent = true; } else if (event.TagEnabled) { - data.tags = ensure(data.tags, event.TagEnabled); - data.tags[event.TagEnabled].enabled = true; + t = ensure(t, event.TagEnabled); + t[event.TagEnabled].enabled = true; } else if (event.TagDisabled) { - data.tags = ensure(data.tags, event.TagDisabled); - data.tags[event.TagDisabled].enabled = false; + t = ensure(t, event.TagDisabled); + t[event.TagDisabled].enabled = false; } else if (event.TagExclusive) { - data.tags = ensure(data.tags, event.TagExclusive); - for (const [k] of Object.keys(data.tags)) { - data.tags[k].enabled = false; + t = ensure(t, event.TagExclusive); + for (const k of Object.keys(t)) { + t[k].enabled = false; } - data.tags[event.TagExclusive].enabled = true; + t[event.TagExclusive].enabled = true; } else if (event.TagFullState) { - data["tags"] = event.TagFullState; - for (const [k, v] of Object.entries(data.tags)) { - data.tags[k].id = k; + t = event.TagFullState; + for (const k of Object.keys(t)) { + t[k].id = k; } } - data.keys = Object.keys(data.tags); - data.tagsChanged(); - data.keysChanged(); + data.tags = t; + data.keys = Object.keys(t); } } } diff --git a/graphical/desktop/shell.nix b/graphical/desktop/shell.nix index 87c6696..7b3941d 100644 --- a/graphical/desktop/shell.nix +++ b/graphical/desktop/shell.nix @@ -4,6 +4,7 @@ inputs, mainUser, getPkgs, + config, ... }: let @@ -16,12 +17,58 @@ in inherit (pkgs) wl-clipboard quickshell; }; - imports = [ inputs.stasis.nixosModules.default ]; - services.stasis.enable = true; + imports = [ + inputs.stasis.nixosModules.default + inputs.stash.nixosModules.default + ]; + services.stasis = { + enable = true; + extraPathPackages = [ (config.programs.niri.package) ]; + extraConfig = '' + default: + dpms_off: + timeout 300 + command "niri msg action power-off-monitors" + end + suspend: + timeout 600 + command "systemctl suspend" + end + end + ''; + }; + + services.stash-clipboard = { + enable = true; + excludedApps = [ "Bitwarden" ]; + }; quick.services = { - swaync = "${getExe pkgs.swaynotificationcenter}"; - quickshell = "${getExe pkgs.quickshell}"; + noti = "${getExe pkgs.swaynotificationcenter}"; + shell = "${getExe pkgs.quickshell}"; + pwManager = "${getExe config.apps.passwordManager}"; + # music = "${getExe config.apps.streamPlayer}"; + }; + + user.systemd.services.music = { + environment.PATH = lib.mkForce "/run/current-system/sw/bin:/run/current-system/sw/sbin:/etc/profiles/per-user/${mainUser}/bin:/etc/profiles/per-user/${mainUser}/sbin"; + unitConfig = { + Description = "airdrome"; + Requires = [ + "graphical-session.target" + ]; + After = [ + "graphical-session.target" + "niri.target" + ]; + PartOf = [ "graphical-session.target" ]; + }; + serviceConfig = { + ExecStart = "${getExe config.apps.streamPlayer}"; + Type = "forking"; + }; + wantedBy = [ "graphical-session.target" ]; + }; environment.files."/home/${mainUser}/.config/quickshell" = { diff --git a/graphical/desktop/wm.nix b/graphical/desktop/wm.nix index bdf85af..30a9231 100644 --- a/graphical/desktop/wm.nix +++ b/graphical/desktop/wm.nix @@ -3,6 +3,7 @@ inputs, getFlakePkg', lib, + pkgs, config, ... }: @@ -12,6 +13,7 @@ let inherit (config) rice; in { + imports = [ inputs.niri.nixosModules.niri inputs.niri-tag.nixosModules.niri-tag @@ -41,24 +43,34 @@ in (toString borders.gaps) (toString borders.thickness) palette.shortHex.bright.yellow - palette.shortHex.normal.yellow + palette.shortHex.normal.white (lib.getExe xwayland-satellite) ] template; in baseConfig; }; + user.packages = [ niri xwayland-satellite ]; + services.greetd = { enable = true; restart = false; settings = let session = { - command = "niri-session"; + command = + let + niri-session-direct = pkgs.writeShellScript "niri-session-direct" '' + systemctl --user import-environment + dbus-update-activation-environment --all + exec ${lib.getExe niri} --session + ''; + in + "${niri-session-direct}"; user = "${mainUser}"; }; in @@ -67,11 +79,26 @@ in initial_session = session; }; }; + programs.niri = { enable = true; package = niri; }; - services.niri-tag.enable = true; + + services.niri-tag = { + enable = true; + prepopulate = 10; + strict = true; + scratchpads = { + "chrome-listen.lobotomise.me__-Default" = 99; + "Bitwarden" = 101; + }; + }; + services.niri-s76-bridge.enable = true; + # niri runs directly from greetd (session-1.scope), not as a user service + systemd.user.services.niri.wantedBy = lib.mkForce [ ]; + systemd.user.services.niri.enable = lib.mkForce false; + } diff --git a/graphical/dev.nix b/graphical/dev.nix index 0f12b7c..d2e7101 100644 --- a/graphical/dev.nix +++ b/graphical/dev.nix @@ -1,7 +1,6 @@ { inputs, localPkgs, - scope, getFlakePkg', ... }: diff --git a/graphical/documents.nix b/graphical/documents.nix index 31f2f88..0a50ede 100644 --- a/graphical/documents.nix +++ b/graphical/documents.nix @@ -1,6 +1,5 @@ { pkgs, - scope, ... }: with pkgs; @@ -10,5 +9,5 @@ scope "apps" { noteTaking = obsidian; ebookReader = foliate; pdfReader = zathura; - calculator = mate.mate-calc; + calculator = mate-calc; } diff --git a/graphical/fm.nix b/graphical/fm.nix index f3aa4b7..0500103 100644 --- a/graphical/fm.nix +++ b/graphical/fm.nix @@ -1,9 +1,8 @@ { pkgs, - scope, ... }: -with pkgs.mate; +with pkgs; scope "apps" { fm = caja; archive = engrampa; diff --git a/graphical/gfx-env.nix b/graphical/gfx-env.nix index bd278eb..a70e6cf 100644 --- a/graphical/gfx-env.nix +++ b/graphical/gfx-env.nix @@ -1,4 +1,4 @@ -{ scope, ... }: +{ ... }: scope "environment.sessionVariables" { NIXOS_OZONE_WL = "1"; GBM_BACKEND = "nvidia-drm"; diff --git a/graphical/hw.nix b/graphical/hw.nix index 76b5b0f..bff93ca 100644 --- a/graphical/hw.nix +++ b/graphical/hw.nix @@ -1,4 +1,4 @@ -{ scope, ... }: +{ ... }: scope "hardware" { enableRedistributableFirmware = true; enableAllFirmware = true; diff --git a/graphical/integrations.nix b/graphical/integrations.nix index e2b0520..49b634a 100644 --- a/graphical/integrations.nix +++ b/graphical/integrations.nix @@ -15,7 +15,6 @@ }; }; extraPortals = [ - pkgs.xdg-desktop-portal-gtk pkgs.xdg-desktop-portal-gnome ]; }; diff --git a/graphical/kernel.nix b/graphical/kernel.nix index 0f1d863..8e631b6 100644 --- a/graphical/kernel.nix +++ b/graphical/kernel.nix @@ -9,11 +9,10 @@ bunker.kernel = { enable = true; - hardened = false; cpuArch = "MZEN3"; version = "6.18"; + hardened = false; lto = "none"; - trimmed = true; }; services.scx = { @@ -21,17 +20,4 @@ scheduler = "scx_bpfland"; }; - # nixpkgs.overlays = [ - # (final: prev: { - # nvidia-open = prev.nvidia-open.override { - # patches = [ - # (pkgs.fetchpatch { - # url = "https://github.com/CachyOS/CachyOS-PKGBUILDS/raw/refs/heads/master/nvidia/nvidia-utils/kernel-6.19.patch"; - # hash = ""; - # }) - # ]; - # }; - # }) - # ]; - } diff --git a/graphical/llm.nix b/graphical/llm.nix new file mode 100644 index 0000000..2dfe01c --- /dev/null +++ b/graphical/llm.nix @@ -0,0 +1,182 @@ +{ + pkgs, + lib, + mainUser, + ... +}: +let + clodTools = with pkgs; [ + bash + procps + ripgrep + socat + bubblewrap + ]; + mkClod = + { + confDir ? null, + suffix ? null, + }: + let + version = "2.1.62"; + runtimeDeps = lib.makeBinPath clodTools; + + patchScript = pkgs.writeScript "patch-claude-src" '' + #!${pkgs.python3}/bin/python3 + import re, sys + W = rb"[\w$]+" + data = open(sys.argv[1], "rb").read() + + pat = (rb"let (" + W + rb")=(" + W + rb")\((" + W + rb'),"CLAUDE\.md"\);' + rb"(" + W + rb")\.push\(\.\.\.(" + W + rb')\(\1,"Project",([^)]+)\)\)') + def agents(m): + v, pj, d, a, lf, rest = [m.group(i) for i in range(1, 7)] + return (b'for(let _f of["CLAUDE.md","AGENTS.md"]){let ' + v + b"=" + pj + + b"(" + d + b",_f);" + a + b".push(..." + lf + b"(" + v + + b',"Project",' + rest + b"))}") + data, n = re.subn(pat, agents, data) + sys.stderr.write(f"AGENTS.md: {n} site(s)\n") + + data = data.replace( + b'case"macos":return"/Library/Application Support/ClaudeCode"', + b'case"macos":return"/etc/claude-code"', + ) + + # Enable hard-disabled slash commands: /btw, /files, /tag + for anchor, label in [ + (b'name:"btw",description:"Ask a quick side question', b"/btw"), + (b'name:"files",description:"List all files currently in context"', b"/files"), + (b'name:"tag",userFacingName', b"/tag"), + ]: + pos = data.find(anchor) + if pos < 0: + sys.stderr.write(f"{label.decode()}: NOT FOUND\n"); continue + window = data[pos:pos+500] + patched = window.replace(b"isEnabled:()=>!1", b"isEnabled:()=>!0", 1) + data = data[:pos] + patched + data[pos+500:] + sys.stderr.write(f"{label.decode()}: enabled\n") + + # Bypass e2() for thinkback (e2 returns false when DISABLE_TELEMETRY is set) + data = data.replace( + b'e2("tengu_thinkback")', + b'!0||"tengu_thinkback"', + ) + sys.stderr.write("thinkback: force-enabled\n") + + # Enable custom keybindings (qA default is false, flip to true) + data = data.replace( + b'qA("tengu_keybinding_customization_release",!1)', + b'qA("tengu_keybinding_customization_release",!0)', + ) + sys.stderr.write("keybindings: force-enabled\n") + + # Force-enable remote control / bridge feature gate + data = data.replace( + b'function ek(){return qA("tengu_ccr_bridge",!1)}', + b'function ek(){return!0} ', + ) + sys.stderr.write("remote-control: force-enabled\n") + + # Fix Deno-compile bridge spawn: Deno compiled binaries intercept --flags + # as V8 flags. Rewrite spawn to go through env(1) which breaks the Deno + # runtime's flag parsing. + data = data.replace( + b'let O=iHz(A.execPath,$,', + b'let O=iHz("env",["--",A.execPath,...$],', + ) + sys.stderr.write("bridge-spawn: patched via env(1)\n") + + # Kill claude-developer-platform bundled skill (~400 tokens/turn dead weight) + data = data.replace( + b'name:"claude-developer-platform",description:`', + b'name:"claude-developer-platform",isEnabled:()=>!1,description:`', + ) + sys.stderr.write("claude-developer-platform: killed\n") + + pat = (rb"context_window:\{total_input_tokens:(" + W + rb"\(\))," + rb"total_output_tokens:(" + W + rb"\(\))," + rb"context_window_size:(" + W + rb")," + rb"current_usage:(" + W + rb")," + rb"used_percentage:(" + W + rb")\.used," + rb"remaining_percentage:\5\.remaining\}") + rl = re.search(rb"(" + W + rb')=\{status:"allowed",unifiedRateLimitFallbackAvailable:!1,isUsingOverage:!1\}', data) + m = re.search(pat, data) + if m and rl: + ci, co, sz, u, p, r = *[m.group(i) for i in range(1, 6)], rl.group(1) + data = data.replace(m[0], + b"context_window:{...(" + u + b"||{})," + b"context_window_size:" + sz + b",current_usage:" + u + b"," + b"used_percentage:" + p + b".used,remaining_percentage:" + p + b".remaining," + b"rate_limit:" + r + b",s_in:" + ci + b",s_out:" + co + b"}") + + open(sys.argv[1], "wb").write(data) + ''; + in + pkgs.writeShellScriptBin "claude${lib.optionalString (suffix != null) "-${suffix}"}" '' + set -euo pipefail + export DISABLE_AUTOUPDATER=1 + export DISABLE_INSTALLATION_CHECKS=1 + export USE_BUILTIN_RIPGREP=0 + export PATH="${runtimeDeps}:${pkgs.deno}/bin:$PATH" + + CACHE="''${XDG_CACHE_HOME:-$HOME/.cache}/claude-code" + BIN="$CACHE/claude-${version}" + ${lib.optionalString (confDir != null) "export CLAUDE_CONFIG_DIR=\"$HOME/${confDir}\""} + + if [ ! -x "$BIN" ]; then + mkdir -p "$CACHE" + DENO_DIR="$CACHE/.deno" + export DENO_DIR + deno cache "npm:@anthropic-ai/claude-code@${version}" + ${patchScript} "$DENO_DIR/npm/registry.npmjs.org/@anthropic-ai/claude-code/${version}/cli.js" + deno compile --allow-all --output "$BIN" "npm:@anthropic-ai/claude-code@${version}" 2>&1 + rm -rf "$DENO_DIR" + fi + + exec "$BIN" "$@" + ''; + claude-code = mkClod { }; + claude-koss = mkClod { + suffix = "koss"; + confDir = ".clod-koss"; + }; +in +(scope "apps" { + "slop" = claude-code; + "temp-slop" = claude-koss; +}) +// { + # required for loader + programs.nix-ld = { + enable = true; + libraries = [ pkgs.stdenv.cc.cc.lib ]; + }; + # experiment with our own sandboxing + # security.yoke.wrappers = + # let + # basePaths = [ + # "wrx=/home/${mainUser}/.claude.json:/home/${mainUser}/.claude-code:/home/${mainUser}/.cache/claude-code:$PWD/.claude" + # "rx=/" + # ]; + # base = { + # package = claude-code; + # executable = "claude"; + # retainEnv = true; + # unrestrictTcp = true; + # extraPackages = clodTools; + # }; + # in + # { + # clod-cuck = base // { + # pathRules = basePaths + [ "rx=$PWD" ]; + # }; + # clod = base // { + # pathRules = basePaths ++ [ + # "wrx=/home/${mainUser}" + # ]; + # addPwd = true; + # unrestrictSockets = true; + # unrestrictSignals = true; + # }; + # }; +} diff --git a/graphical/media.nix b/graphical/media.nix index 8fc2d40..1bdb213 100644 --- a/graphical/media.nix +++ b/graphical/media.nix @@ -1,13 +1,27 @@ { + config, pkgs, - scope, ... }: with pkgs; -scope "apps" { +(scope "apps" { videoPlayer = mpv; imageViewer = imv; musicPlayer = resonance; - streamPlayer = feishin; + streamPlayer = config.programs.pwas.airdrome.package; soulSeek = nicotine-plus; -} +}) +// (scope "programs.pwas.airdrome" { + name = "Airdrome"; + url = "https://listen.lobotomise.me"; + icon = builtins.fetchurl { + name = "airdrome.svg"; + url = "https://raw.githubusercontent.com/JPGuillemin/Airdrome/refs/heads/master/public/icon.svg"; + sha256 = "sha256:1chmza1cbfg028ilz4dqg583s3121iw4fhc136v9f0zf44h76y7m"; + }; + description = "Airdrome, a Navidrome client"; + categories = [ + "Music" + "Network" + ]; +}) diff --git a/graphical/password-manager.nix b/graphical/password-manager.nix index 80c2763..5b3d10e 100644 --- a/graphical/password-manager.nix +++ b/graphical/password-manager.nix @@ -4,15 +4,14 @@ generator = lib.generators.toJSON { }; value = { email = "boss@atagen.co"; - pinentry = lib.getExe pkgs.pinentry-qt; # TODO this is fugly + pinentry = lib.getExe pkgs.pinentry-gtk2; # TODO this is fugly base_url = "https://vault.lobotomise.me"; }; }; - # bitwarden ? element ? - nixpkgs.config.permittedInsecurePackages = [ - "electron-36.9.5" - ]; + # nixpkgs.config.permittedInsecurePackages = [ + # "electron-36.9.5" + # ]; apps = with pkgs; { passwordManager = bitwarden-desktop; passwordCli = rbw; diff --git a/graphical/quick-services.nix b/graphical/quick-services.nix index 4342095..d696f36 100644 --- a/graphical/quick-services.nix +++ b/graphical/quick-services.nix @@ -2,7 +2,6 @@ config, lib, mainUser, - scope, ... }: scope "options.quick" { @@ -37,6 +36,7 @@ scope "options.quick" { }; serviceConfig = { ExecStart = cmd; + Restart = "always"; }; wantedBy = [ "graphical-session.target" ]; }) config.quick.services diff --git a/graphical/rice.nix b/graphical/rice.nix index 60a9108..6ed8bce 100644 --- a/graphical/rice.nix +++ b/graphical/rice.nix @@ -59,11 +59,10 @@ }; plymouth = { - theme = "colorful_loop"; + theme = "starship"; font = "${config.rice.fonts.sans.package}/share/fonts/truetype/MSW98UI-Regular.ttf"; themePackages = [ - pkgs.adi1090x-plymouth-themes - # (getFlakePkg inputs.hudcore) + (getFlakePkg inputs.hudcore) ]; }; }; diff --git a/graphical/startup.nix b/graphical/startup.nix index ea0c310..ba196d9 100644 --- a/graphical/startup.nix +++ b/graphical/startup.nix @@ -1,5 +1,26 @@ -{ pkgs, lib, ... }: { - quick.services.startup-sound = "${lib.getExe' pkgs.alsa-utils "aplay"} " + ../assets/startup.wav; - # FIXME broken , maybe use niri exec-once .. + pkgs, + lib, + ... +}: +scope "user.systemd.services.startup-sound" +<| { + unitConfig = { + Description = "startup sound"; + Requires = [ + "graphical-session.target" + ]; + After = [ + "graphical-session.target" + "niri.target" + "sound.target" + "shell.service" + ]; + PartOf = [ "graphical-session.target" ]; + }; + serviceConfig = { + ExecStart = "${lib.getExe' pkgs.alsa-utils "aplay"} " + ../assets/startup.wav; + Type = "oneshot"; + }; + wantedBy = [ "graphical-session.target" ]; } diff --git a/graphical/sync.nix b/graphical/sync.nix index a1e2ece..403e6be 100644 --- a/graphical/sync.nix +++ b/graphical/sync.nix @@ -1 +1 @@ -{ scope, ... }: scope "services.syncthing.enable" <| true +{ ... }: scope "services.syncthing.enable" <| true diff --git a/graphical/terminal.nix b/graphical/terminal.nix index 50bb5d5..dccdd61 100644 --- a/graphical/terminal.nix +++ b/graphical/terminal.nix @@ -1,7 +1,6 @@ { pkgs, config, - scope, ... }: (scope "apps.terminal" <| pkgs.foot) diff --git a/graphical/webapps.nix b/graphical/webapps.nix new file mode 100644 index 0000000..7a5533c --- /dev/null +++ b/graphical/webapps.nix @@ -0,0 +1,179 @@ +{ + config, + lib, + pkgs, + ... +}: +let + inherit (lib) + mkOption + mkAliasOptionModule + types + mapAttrsToList + attrNames + filterAttrs + replaceStrings + getExe + toLower + ; + inherit (types) + str + strMatching + package + path + nullOr + listOf + attrsOf + submodule + either + ; + + browser = getExe config.apps.browser; + + webAppLauncher = pkgs.writeShellScript "web-app-launcher" '' + browser="${browser}" + + browser_exec="" + for path in ~/.local ~/.nix-profile /usr /nix/var/nix/profiles/system/etc/profiles/per-user/$USER; do + if [ -f "$path/share/applications/$browser.desktop" ]; then + browser_exec=$(sed -n 's/^Exec=\([^ ]*\).*/\1/p' "$path/share/applications/$browser.desktop" 2>/dev/null | head -1) + break + fi + done + + if [ -z "$browser_exec" ]; then + browser_exec="${browser}" + fi + + url="$1" + app_name="''${2:-$(basename "$0")}" + shift 2 + + exec setsid "$browser_exec" \ + --app="$url" \ + --user-data-dir="$HOME/.local/share/web-apps/$app_name" \ + --no-first-run \ + --no-default-browser-check \ + --disable-background-timer-throttling \ + --disable-backgrounding-occluded-windows \ + --disable-renderer-backgrounding \ + --enable-quic \ + --quic-version=h3-29 \ + --enable-features=UseOzonePlatform,WaylandWindowDecorations,WaylandPerWindowScaling,WaylandTextInputV3,WebRTCPipeWireCapturer \ + --disable-features=WebRtcAllowInputVolumeAdjustment \ + --ozone-platform=wayland \ + --gtk-version=4 \ + --enable-experimental-web-platform-features \ + "$@" + ''; + + # Create web app package + mkWebApp = + { + name, + url, + icon, + description, + categories, + }: + let + cleanName = replaceStrings [ " " "\n" "\t" ] [ "-" "-" "-" ] name |> toLower; + pname = "${cleanName}-webapp"; + in + pkgs.stdenv.mkDerivation { + inherit pname; + version = "1.0"; + dontUnpack = true; + + nativeBuildInputs = [ + pkgs.copyDesktopItems + pkgs.makeWrapper + ]; + + installPhase = '' + runHook preInstall + makeWrapper ${webAppLauncher} $out/bin/${pname} \ + --add-flags "${url}" \ + --add-flags "${pname}" + runHook postInstall + ''; + + desktopItems = [ + (pkgs.makeDesktopItem ( + { + name = pname; + exec = "${pname} %U"; + desktopName = name; + startupNotify = true; + startupWMClass = pname; + } + // filterAttrs (_: v: v != null) { + inherit icon categories; + comment = description; + } + )) + ]; + + meta.mainProgram = pname; + + }; + + innerOpts = { + options = { + name = mkOption { + type = str; + }; + url = mkOption { + type = strMatching "[hH][tT][tT][pP][sS]?://[^\n\r[:space:]]+"; + }; + icon = mkOption { + type = nullOr (either str path); + default = null; + }; + description = mkOption { + type = nullOr str; + default = null; + }; + categories = mkOption { + type = nullOr (listOf str); + default = null; + }; + }; + }; + + pwaModule = submodule ( + { config, ... }: + { + imports = + let + names = innerOpts.options |> attrNames; + in + map (optName: mkAliasOptionModule [ optName ] [ "settings" optName ]) names; + options = { + settings = mkOption { + type = submodule innerOpts; + default = { }; + }; + package = mkOption { + type = package; + readOnly = true; + default = mkWebApp config.settings; + }; + }; + } + ); + +in +{ + options = { + programs.pwas = mkOption { + description = "PWA Applications"; + type = attrsOf pwaModule; + default = { }; + }; + }; + + config = { + environment.systemPackages = mapAttrsToList (_: v: v.package) config.programs.pwas; + }; +} diff --git a/hosts/adrift/boot.nix b/hosts/adrift/boot.nix index 2e3210d..b6a8412 100644 --- a/hosts/adrift/boot.nix +++ b/hosts/adrift/boot.nix @@ -1,4 +1,4 @@ -{ scope, ... }: +{ ... }: scope "boot" { kernelParams = [ "mitigations=off" diff --git a/hosts/quiver/boot.nix b/hosts/quiver/boot.nix index 9280201..59bcc29 100644 --- a/hosts/quiver/boot.nix +++ b/hosts/quiver/boot.nix @@ -1,5 +1,4 @@ { - scope, ... }: scope "boot" { diff --git a/hosts/quiver/hw.nix b/hosts/quiver/hw.nix index c582078..20e7c01 100644 --- a/hosts/quiver/hw.nix +++ b/hosts/quiver/hw.nix @@ -1,7 +1,5 @@ { config, - lib, - pkgs, ... }: { @@ -12,8 +10,7 @@ hardware.graphics.enable = true; services.xserver.videoDrivers = [ "nvidia" ]; - # temporarily disabled bc firefox - nixpkgs.config.cudaSupport = false; + nixpkgs.config.cudaSupport = true; hardware.nvidia = { package = config.boot.kernelPackages.nvidiaPackages.beta; @@ -24,12 +21,12 @@ # openrgb no longer recognises the device? # systemd.services.no-rgb = { - # wantedBy = ["multi-user.target"]; + # wantedBy = [ "multi-user.target" ]; # description = "rgb led turn-off-er"; # serviceConfig = { # Type = "oneshot"; - # ExecStart = ''${pkgs.openrgb}/bin/openrgb -d "HyperX DRAM" -m static -c 000000''; - # After = ["openrgb"]; + # ExecStart = ''${lib.getExe pkgs.openrgb} -d "HyperX DRAM" -m static -c 000000''; + # After = [ "openrgb" ]; # }; # }; diff --git a/hosts/quiver/llm.nix b/hosts/quiver/llm.nix deleted file mode 100644 index 2f101f5..0000000 --- a/hosts/quiver/llm.nix +++ /dev/null @@ -1,25 +0,0 @@ -{ - # inputs, - config, - scope, - ... -}: -scope "services" { - ollama = { - enable = false; - user = "ollama"; - }; - - open-webui = { - # package = inputs.nixpkgs-stable.legacyPackages.x86_64-linux.open-webui; - enable = false; - port = 8088; - environment = { - DO_NOT_TRACK = "True"; - SCARF_NO_ANALYTICS = "True"; - ANONYMIZED_TELEMETRY = "False"; - WEBUI_AUTH = "False"; - DATABASE_URL = "sqlite:///${config.services.open-webui.stateDir}/newdb.db"; - }; - }; -} diff --git a/lib/create.nix b/lib/create.nix index 7f77d3c..73880dc 100644 --- a/lib/create.nix +++ b/lib/create.nix @@ -16,7 +16,7 @@ in inherit (inputs.nixpkgs.legacyPackages.${info.system}) callPackage; directory = ../pkgs; }; - scope = import ./scope.nix { inherit lib; }; + # scope = import ./scope.nix { inherit lib; }; mainUser = info.username; machineName = name; getPkgs = builtins.attrValues; @@ -29,7 +29,7 @@ in inputs.arbys.nixosModules.arbys inputs.hjem.nixosModules.hjem ( - { scope, ... }: + { ... }: scope "hjem" { users.${info.username}.enable = true; extraModules = [ diff --git a/pkgs/gtk-theme.nix b/pkgs/gtk-theme.nix index f492dcd..91fd551 100644 --- a/pkgs/gtk-theme.nix +++ b/pkgs/gtk-theme.nix @@ -24,10 +24,11 @@ pkgs.stdenv.mkDerivation { meson optipng ninja + dart-sass ; - inherit (pkgs.nodePackages) - sass - ; + # inherit (pkgs.nodePackages) + # sass + # ; inherit (pkgs.gtk4) dev; inherit rendersvg; }; diff --git a/pkgs/hush.nix b/pkgs/hush.nix deleted file mode 100644 index c80e81f..0000000 --- a/pkgs/hush.nix +++ /dev/null @@ -1,18 +0,0 @@ -{ - rustPlatform, - fetchFromGitHub, - ... -}: -rustPlatform.buildRustPackage (finalAttrs: { - pname = "hush"; - version = "0.1.4-git"; - src = fetchFromGitHub { - owner = "hush-shell"; - repo = "hush"; - rev = "560c33a2dc8bf967b4fb0c80e3f18ca8934615ff"; - hash = "sha256-kJ1o236xvNTPiLPWPgpQLLfEAXCGT419UgVWmwVHBYA="; - }; - - doCheck = false; - cargoLock.lockFile = "${finalAttrs.src}/Cargo.lock"; -})