diff --git a/common/cli.nix b/common/cli.nix index 4ce328e..ffd91d9 100644 --- a/common/cli.nix +++ b/common/cli.nix @@ -1,25 +1,26 @@ { pkgs, + getPkgs, ... }: { - environment.systemPackages = builtins.attrValues { + environment.systemPackages = getPkgs { inherit (pkgs) curl eza git - ; - }; - home.packages = builtins.attrValues { - inherit (pkgs) btop bat ripgrep fd - lazygit - zoxide - zellij ouch ; }; + home.packages = getPkgs { + inherit (pkgs) + lazygit + zoxide + zellij + ; + }; } diff --git a/common/docs.nix b/common/docs.nix index beb3baf..1567bdc 100644 --- a/common/docs.nix +++ b/common/docs.nix @@ -1,6 +1,6 @@ -{ pkgs, ... }: +{ pkgs, getPkgs, ... }: { - environment.systemPackages = builtins.attrValues { + environment.systemPackages = getPkgs { inherit (pkgs) man-pages man-pages-posix diff --git a/common/editor.nix b/common/editor.nix index abd22ef..569b8e4 100644 --- a/common/editor.nix +++ b/common/editor.nix @@ -2,253 +2,252 @@ inputs, pkgs, config, + scope, ... }: let inherit (config) rice; pal = rice.palette.hex; in -{ - hm.programs.helix = { - enable = true; - package = inputs.helix.packages.${pkgs.system}.helix; - themes = with pal; { - nix-rice = { - "attribute" = bright.cyan; - "keyword" = { - fg = normal.red; - }; - "keyword.directive" = normal.red; - "namespace" = bright.cyan; - "punctuation" = bright.yellow; - "punctuation.delimiter" = bright.yellow; - "operator" = bright.magenta; - "special" = normal.magenta; - "variable.other.member" = bright.blue; - "variable" = util.fg; - "variable.builtin" = bright.yellow; - "variable.parameter" = bright.white; - "type" = normal.yellow; - "type.builtin" = normal.yellow; - "constructor" = { - fg = bright.magenta; - modifiers = [ "bold" ]; - }; - "function" = { - fg = normal.green; - modifiers = [ "bold" ]; - }; - "function.macro" = bright.cyan; - "function.builtin" = normal.yellow; - "tag" = normal.red; - "comment" = { - fg = normal.magenta; - modifiers = [ "italic" ]; - }; - "constant" = { - fg = bright.magenta; - }; - "constant.builtin" = { - fg = bright.magenta; - modifiers = [ "bold" ]; - }; - "string" = normal.green; - "constant.numeric" = bright.magenta; - "constant.character.escape" = { - fg = bright.white; - modifiers = [ "bold" ]; - }; - "label" = bright.cyan; - "module" = bright.cyan; - "diff.plus" = bright.green; - "diff.delta" = bright.yellow; - "diff.minus" = bright.red; - "warning" = bright.yellow; - "error" = bright.red; - "info" = bright.cyan; - "hint" = bright.blue; - "ui.background" = { - inherit (util) bg; - }; - "ui.linenr" = { - fg = normal.cyan; - }; - "ui.linenr.selected" = { - fg = normal.yellow; - modifiers = [ "bold" ]; - }; - "ui.cursorline" = { - bg = normal.black; - }; - "ui.statusline" = { - inherit (util) fg; - bg = bright.black; - }; - "ui.statusline.normal" = { - inherit (util) fg; - bg = bright.black; - }; - "ui.statusline.insert" = { - inherit (util) fg; - bg = normal.blue; - }; - "ui.statusline.select" = { - inherit (util) fg; - bg = bright.yellow; - }; - "ui.statusline.inactive" = { - fg = normal.white; - bg = normal.black; - }; - "ui.popup" = { - bg = normal.black; - }; - "ui.window" = { - bg = normal.black; - }; - "ui.help" = { - bg = normal.black; - inherit (util) fg; - }; - "ui.text" = { - inherit (util) fg; - }; - "ui.text.focus" = { - inherit (util) fg; - }; - "ui.selection" = { - # modifiers = ["reversed"]; - bg = bright.yellow; - }; - "ui.selection.primary" = { - modifiers = [ "reversed" ]; - }; - # "ui.selection.primary" = { bg = bright.cyan; }; - "ui.cursor.primary" = { - bg = normal.white; - fg = normal.black; - }; - "ui.cursor.match" = { - bg = bright.cyan; - }; - "ui.menu" = { - inherit (util) fg; - bg = bright.black; - }; - "ui.menu.selected" = { - fg = bright.black; - bg = bright.blue; - modifiers = [ "bold" ]; - }; - "ui.virtual.whitespace" = bright.black; - "ui.virtual.ruler" = { - bg = normal.black; - }; - "ui.virtual.inlay-hint" = { - fg = normal.magenta; - }; - "diagnostic.warning" = { - underline = { - color = bright.yellow; - style = "curl"; - }; - }; - "diagnostic.error" = { - underline = { - color = bright.red; - style = "curl"; - }; - }; - "diagnostic.info" = { - underline = { - color = bright.cyan; - style = "curl"; - }; - }; - "diagnostic.hint" = { - underline = { - color = bright.blue; - style = "curl"; - }; - }; - "markup.heading" = bright.cyan; - "markup.bold" = { - modifiers = [ "bold" ]; - }; - "markup.italic" = { - modifiers = [ "italic" ]; - }; - "markup.strikethrough" = { - modifiers = [ "crossed_out" ]; - }; - "markup.link.url" = { - fg = bright.green; - modifiers = [ "underlined" ]; - }; - "markup.link.text" = bright.red; - "markup.raw" = bright.red; +scope "hm.programs.helix" { + enable = true; + package = inputs.helix.packages.${pkgs.system}.helix; + themes = with pal; { + nix-rice = { + "attribute" = bright.cyan; + "keyword" = { + fg = normal.red; }; - }; - - # theme = "nix-rice" - - settings = { - theme = "nix-rice"; - editor = { - bufferline = "multiple"; - cursorline = true; - true-color = true; - cursor-shape = { - insert = "bar"; - normal = "block"; - select = "underline"; - }; - statusline.left = [ - "mode" - "spinner" - "version-control" - "file-name" - "file-modification-indicator" - ]; - lsp.display-messages = true; + "keyword.directive" = normal.red; + "namespace" = bright.cyan; + "punctuation" = bright.yellow; + "punctuation.delimiter" = bright.yellow; + "operator" = bright.magenta; + "special" = normal.magenta; + "variable.other.member" = bright.blue; + "variable" = util.fg; + "variable.builtin" = bright.yellow; + "variable.parameter" = bright.white; + "type" = normal.yellow; + "type.builtin" = normal.yellow; + "constructor" = { + fg = bright.magenta; + modifiers = [ "bold" ]; }; + "function" = { + fg = normal.green; + modifiers = [ "bold" ]; + }; + "function.macro" = bright.cyan; + "function.builtin" = normal.yellow; + "tag" = normal.red; + "comment" = { + fg = normal.magenta; + modifiers = [ "italic" ]; + }; + "constant" = { + fg = bright.magenta; + }; + "constant.builtin" = { + fg = bright.magenta; + modifiers = [ "bold" ]; + }; + "string" = normal.green; + "constant.numeric" = bright.magenta; + "constant.character.escape" = { + fg = bright.white; + modifiers = [ "bold" ]; + }; + "label" = bright.cyan; + "module" = bright.cyan; + "diff.plus" = bright.green; + "diff.delta" = bright.yellow; + "diff.minus" = bright.red; + "warning" = bright.yellow; + "error" = bright.red; + "info" = bright.cyan; + "hint" = bright.blue; + "ui.background" = { + inherit (util) bg; + }; + "ui.linenr" = { + fg = normal.cyan; + }; + "ui.linenr.selected" = { + fg = normal.yellow; + modifiers = [ "bold" ]; + }; + "ui.cursorline" = { + bg = normal.black; + }; + "ui.statusline" = { + inherit (util) fg; + bg = bright.black; + }; + "ui.statusline.normal" = { + inherit (util) fg; + bg = bright.black; + }; + "ui.statusline.insert" = { + inherit (util) fg; + bg = normal.blue; + }; + "ui.statusline.select" = { + inherit (util) fg; + bg = bright.yellow; + }; + "ui.statusline.inactive" = { + fg = normal.white; + bg = normal.black; + }; + "ui.popup" = { + bg = normal.black; + }; + "ui.window" = { + bg = normal.black; + }; + "ui.help" = { + bg = normal.black; + inherit (util) fg; + }; + "ui.text" = { + inherit (util) fg; + }; + "ui.text.focus" = { + inherit (util) fg; + }; + "ui.selection" = { + # modifiers = ["reversed"]; + bg = bright.yellow; + }; + "ui.selection.primary" = { + modifiers = [ "reversed" ]; + }; + # "ui.selection.primary" = { bg = bright.cyan; }; + "ui.cursor.primary" = { + bg = normal.white; + fg = normal.black; + }; + "ui.cursor.match" = { + bg = bright.cyan; + }; + "ui.menu" = { + inherit (util) fg; + bg = bright.black; + }; + "ui.menu.selected" = { + fg = bright.black; + bg = bright.blue; + modifiers = [ "bold" ]; + }; + "ui.virtual.whitespace" = bright.black; + "ui.virtual.ruler" = { + bg = normal.black; + }; + "ui.virtual.inlay-hint" = { + fg = normal.magenta; + }; + "diagnostic.warning" = { + underline = { + color = bright.yellow; + style = "curl"; + }; + }; + "diagnostic.error" = { + underline = { + color = bright.red; + style = "curl"; + }; + }; + "diagnostic.info" = { + underline = { + color = bright.cyan; + style = "curl"; + }; + }; + "diagnostic.hint" = { + underline = { + color = bright.blue; + style = "curl"; + }; + }; + "markup.heading" = bright.cyan; + "markup.bold" = { + modifiers = [ "bold" ]; + }; + "markup.italic" = { + modifiers = [ "italic" ]; + }; + "markup.strikethrough" = { + modifiers = [ "crossed_out" ]; + }; + "markup.link.url" = { + fg = bright.green; + modifiers = [ "underlined" ]; + }; + "markup.link.text" = bright.red; + "markup.raw" = bright.red; }; + }; - languages = { - language = [ - { - name = "rust"; - language-servers = [ "rust-analyzer" ]; - } - { - name = "nix"; - language-servers = [ "nil" ]; - file-types = [ "nix" ]; - auto-format = true; - formatter = { - command = "nixfmt"; - }; - } + # theme = "nix-rice" + + settings = { + theme = "nix-rice"; + editor = { + bufferline = "multiple"; + cursorline = true; + true-color = true; + cursor-shape = { + insert = "bar"; + normal = "block"; + select = "underline"; + }; + statusline.left = [ + "mode" + "spinner" + "version-control" + "file-name" + "file-modification-indicator" ]; + lsp.display-messages = true; + }; + }; - language-server = { - qmlls = { - command = "qmlls"; - args = [ "-E" ]; + languages = { + language = [ + { + name = "rust"; + language-servers = [ "rust-analyzer" ]; + } + { + name = "nix"; + language-servers = [ "nil" ]; + file-types = [ "nix" ]; + auto-format = true; + formatter = { + command = "nixfmt"; }; + } + ]; - nil = { - command = "nil"; - }; + language-server = { + qmlls = { + command = "qmlls"; + args = [ "-E" ]; + }; - rust-analyzer = { - config = { - cargo.buildScripts.enable = true; - procMacro.enable = true; - check.command = "clippy"; - }; + nil = { + command = "nil"; + }; + + rust-analyzer = { + config = { + cargo.buildScripts.enable = true; + procMacro.enable = true; + check.command = "clippy"; }; - }; # language-server - }; # languages - }; # helix config + }; + }; + }; } diff --git a/common/network.nix b/common/network.nix index 9bdb40e..ffb7274 100644 --- a/common/network.nix +++ b/common/network.nix @@ -1,4 +1 @@ -{ lib, ... }: -{ - networking.useDHCP = lib.mkDefault true; -} +{ lib, scope, ... }: scope "networking.useDHCP" <| lib.mkDefault true diff --git a/common/nix/nixpkgs.nix b/common/nix/nixpkgs.nix index 8a5abda..4506b9a 100644 --- a/common/nix/nixpkgs.nix +++ b/common/nix/nixpkgs.nix @@ -1,10 +1,13 @@ -{ inputs, lib, ... }: { - nixpkgs = { - config = { - allowUnfree = true; - allowUnfreePredicate = _: true; - }; + inputs, + lib, + scope, + ... +}: +scope "nixpkgs" { + config = { + allowUnfree = true; + allowUnfreePredicate = _: true; }; - nixpkgs.flake.source = lib.mkForce inputs.nixpkgs; + flake.source = lib.mkForce inputs.nixpkgs; } diff --git a/common/nix/substituters.nix b/common/nix/substituters.nix index a816340..4a9637c 100644 --- a/common/nix/substituters.nix +++ b/common/nix/substituters.nix @@ -1,23 +1,24 @@ { + scope, ... }: -{ - nix.settings = { - substituters = [ - "https://cache.nixos.org" - "https://nix-community.cachix.org" - "https://helix.cachix.org" - "https://walker-git.cachix.org" - "https://anmonteiro.nix-cache.workers.dev" - "https://cache.atagen.co" - ]; - trusted-public-keys = [ - "cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY=" - "nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs=" - "helix.cachix.org-1:ejp9KQpR1FBI2onstMQ34yogDm4OgU2ru6lIwPvuCVs=" - "walker-git.cachix.org-1:vmC0ocfPWh0S/vRAQGtChuiZBTAe4wiKDeyyXM0/7pM=" - "ocaml.nix-cache.com-1:/xI2h2+56rwFfKyyFVbkJSeGqSIYMC/Je+7XXqGKDIY=" - "cache.atagen.co:SOUkNQxuu/eQ7FcI8nlUe7FpV27e7YjQlDQdn8HTUnw=" - ]; - }; +scope "nix.settings" { + substituters = [ + "https://cache.nixos.org" + "https://nix-community.cachix.org" + "https://helix.cachix.org" + "https://walker-git.cachix.org" + "https://anmonteiro.nix-cache.workers.dev" + "https://cache.atagen.co" + "https://cache.privatevoid.net" + ]; + trusted-public-keys = [ + "cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY=" + "nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs=" + "helix.cachix.org-1:ejp9KQpR1FBI2onstMQ34yogDm4OgU2ru6lIwPvuCVs=" + "walker-git.cachix.org-1:vmC0ocfPWh0S/vRAQGtChuiZBTAe4wiKDeyyXM0/7pM=" + "ocaml.nix-cache.com-1:/xI2h2+56rwFfKyyFVbkJSeGqSIYMC/Je+7XXqGKDIY=" + "cache.atagen.co:SOUkNQxuu/eQ7FcI8nlUe7FpV27e7YjQlDQdn8HTUnw=" + "cache.privatevoid.net:SErQ8bvNWANeAvtsOESUwVYr2VJynfuc9JRwlzTTkVg=" + ]; } diff --git a/common/nix/tools.nix b/common/nix/tools.nix index e809dce..07b0c52 100644 --- a/common/nix/tools.nix +++ b/common/nix/tools.nix @@ -1,7 +1,12 @@ -{ pkgs, inputs, ... }: +{ + pkgs, + inputs, + getPkgs, + ... +}: { - environment.systemPackages = builtins.attrValues { + environment.systemPackages = getPkgs { inherit (pkgs) home-manager cachix @@ -9,13 +14,10 @@ ; inherit (inputs.nil.packages.${pkgs.system}) nil; }; - hm.imports = [ - inputs.nix-index-database.hmModules.nix-index - ]; imports = [ inputs.nix-index-database.nixosModules.nix-index ]; programs.nix-index-database.comma.enable = true; - programs.nix-index.enableZshIntegration = false; - programs.nix-index.enableBashIntegration = false; + # programs.nix-index.enableZshIntegration = false; + # programs.nix-index.enableBashIntegration = false; } diff --git a/entry.nix b/entry.nix index e1b309b..238320e 100644 --- a/entry.nix +++ b/entry.nix @@ -1,10 +1,11 @@ let - create = import ./util/create.nix; + create = import ./lib/create.nix; in { nixosConfigurations = create.systems { quiver = { - user = "bolt"; + username = "bolt"; + system = "x86_64-linux"; imports = [ ./common ./graphical @@ -12,7 +13,8 @@ in ]; }; adrift = { - user = "plank"; + username = "plank"; + system = "x86_64-linux"; imports = [ ./common ./graphical diff --git a/flake.lock b/flake.lock index 381694a..94d0ddd 100644 --- a/flake.lock +++ b/flake.lock @@ -157,6 +157,21 @@ "type": "github" } }, + "flake-compat_4": { + "locked": { + "lastModified": 1747046372, + "narHash": "sha256-CIVLLkVgvHYbgI2UpXvIIBJ12HWgX+fjA8Xf8PUmqCY=", + "owner": "edolstra", + "repo": "flake-compat", + "rev": "9100a0f413b0c601e0533d1d94ffd501ce2e7885", + "type": "github" + }, + "original": { + "owner": "edolstra", + "repo": "flake-compat", + "type": "github" + } + }, "flake-parts": { "inputs": { "nixpkgs-lib": [ @@ -485,11 +500,11 @@ "unf": "unf" }, "locked": { - "lastModified": 1753059450, - "narHash": "sha256-WsGRRQGNnPu0Bv5QPhbnouAWjdsmCuE9VzgZN7U+EQY=", + "lastModified": 1754885782, + "narHash": "sha256-S+D4ksyKsMRDOA2NyjiPqzUraR+ZAksDDOqKvmAtKbY=", "ref": "refs/heads/master", - "rev": "de951b227223ee924c37c7aa282bade34686bf83", - "revCount": 38, + "rev": "fafee12becfb49c2f77eb8fb6283050bd2fc04d9", + "revCount": 39, "type": "git", "url": "https://git.atagen.co/atagen/meat" }, @@ -1018,6 +1033,22 @@ "type": "github" } }, + "nixpkgs_18": { + "locked": { + "lastModified": 1754214453, + "narHash": "sha256-Q/I2xJn/j1wpkGhWkQnm20nShYnG7TI99foDBpXm1SY=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "5b09dc45f24cf32316283e62aec81ffee3c3e376", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, "nixpkgs_2": { "locked": { "lastModified": 1733935885, @@ -1210,7 +1241,8 @@ "nixpkgs": "nixpkgs_16", "nixpkgs-stable": "nixpkgs-stable_3", "nyx": "nyx", - "quickshell": "quickshell" + "quickshell": "quickshell", + "zedless": "zedless" } }, "rust-analyzer-src": { @@ -1497,6 +1529,25 @@ "repo": "xwayland-satellite", "type": "github" } + }, + "zedless": { + "inputs": { + "flake-compat": "flake-compat_4", + "nixpkgs": "nixpkgs_18" + }, + "locked": { + "lastModified": 1754831523, + "narHash": "sha256-tkdq7WR0AvIy/eof2L2ELXKh6b73P7dcWcgJC7ww3aM=", + "owner": "zedless-editor", + "repo": "zed", + "rev": "adb21022b5063757c035d851a0e458f8e4ae954b", + "type": "github" + }, + "original": { + "owner": "zedless-editor", + "repo": "zed", + "type": "github" + } } }, "root": "root", diff --git a/flake.nix b/flake.nix index 260ae0c..886b254 100644 --- a/flake.nix +++ b/flake.nix @@ -59,6 +59,8 @@ arbys.url = "git+https://git.atagen.co/atagen/arbys"; + zedless.url = "github:zedless-editor/zed"; + __flake-compat = { url = "git+https://git.lix.systems/lix-project/flake-compat.git"; flake = false; diff --git a/graphical/audio-control.nix b/graphical/audio-control.nix index 3c7111c..d567f08 100644 --- a/graphical/audio-control.nix +++ b/graphical/audio-control.nix @@ -1,10 +1,11 @@ { pkgs, lib, + getPkgs, ... }: { - home.packages = builtins.attrValues { + home.packages = getPkgs { inherit (pkgs) avizo playerctl diff --git a/graphical/binds.nix b/graphical/binds.nix index eec57ca..1e75a29 100644 --- a/graphical/binds.nix +++ b/graphical/binds.nix @@ -3,6 +3,7 @@ lib, config, inputs, + scope, ... }: let @@ -56,8 +57,8 @@ let }) (range 1 6) ); in -{ - hm.programs.niri.settings.binds = mergeAttrsList [ +scope "hm.programs.niri.settings" { + binds = mergeAttrsList [ { "Mod+D".action.spawn = [ "qs" @@ -68,7 +69,7 @@ in ]; "Mod+F".action.spawn = "firefox"; "Mod+E".action.spawn = "nautilus"; - "Mod+Return".action.spawn = "ghostty"; + "Mod+Return".action.spawn = "foot"; "Mod+Shift+E".action.spawn = "wlogout"; "Mod+Equal".action.spawn = "bitwarden"; "Mod+Shift+Q".action = actions.close-window; diff --git a/graphical/boot.nix b/graphical/boot.nix index 2554788..e18efcb 100644 --- a/graphical/boot.nix +++ b/graphical/boot.nix @@ -1,13 +1,13 @@ -{ config, ... }: +{ config, scope, ... }: let inherit (config) rice; in -{ - boot.tmp.useTmpfs = true; +scope "boot" { + tmp.useTmpfs = true; - boot.initrd.systemd.enable = true; + initrd.systemd.enable = true; - boot.loader.limine = { + loader.limine = { enable = true; style = let diff --git a/graphical/browser.nix b/graphical/browser.nix index 124cc95..b459d00 100644 --- a/graphical/browser.nix +++ b/graphical/browser.nix @@ -1,5 +1,6 @@ { lib, + scope, ... }: let @@ -20,74 +21,72 @@ let Status = "locked"; }; in -{ - hm.programs.firefox = { - enable = true; +scope "hm.programs.firefox" { + 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; + 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" + 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; - }; + 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"; }; - 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; - }; + 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; + }; + }; + + 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; }; }; } diff --git a/graphical/chat.nix b/graphical/chat.nix index 4b51919..27f748b 100644 --- a/graphical/chat.nix +++ b/graphical/chat.nix @@ -1,5 +1,6 @@ { config, pkgs, ... }: { + home.packages = [ pkgs.fluffychat ]; hm.programs.firefox.webapps = { "Microsoft-Teams" = { url = "https://teams.microsoft.com"; diff --git a/graphical/dev.nix b/graphical/dev.nix index 5c0d4d9..08cbec2 100644 --- a/graphical/dev.nix +++ b/graphical/dev.nix @@ -1,55 +1,13 @@ { pkgs, + localPkgs, ... }: { home.packages = [ pkgs.direnv - # from https://gist.github.com/mikeboiko/58ab730afd65bca0a125bc12b6f4670d - (pkgs.writeTextFile { - name = "rbw-helper"; - text = '' - declare -A params - - if [ "x$1" == "xget" ]; then - read line - while [ -n "$line" ]; do - key=$\{line%%=*} - value=$\{line#*=} - params[$key]=$value - read line - done - - if [ "x$\{params['protocol']}" != "xhttps" ]; then - exit - fi - - if [ -z "$\{params["host"]}" ]; then - exit - fi - - rbw ls > /dev/null 2>&1 - if [ $? -ne 0 ]; then - echo "Please login to rbw to use git credential helper" > /dev/stderr - exit - fi - - user=`rbw get --full $\{params["host"]} | grep "Username:" | cut -d' ' -f2-` - pass=`rbw get $\{params["host"]}` - - if [ "x$user" == "x" ] || [ "x$pass" == "x" ]; then - echo "Couldn't find host in rbw DB." > /dev/stderr - exit - fi - - echo username=$user - echo password=$pass - fi - ''; - executable = true; - destination = "/bin/git-credential-rw"; - }) + localPkgs.rbw-helper ]; hm.programs.direnv = { diff --git a/graphical/documents.nix b/graphical/documents.nix index 32a0d69..90fd644 100644 --- a/graphical/documents.nix +++ b/graphical/documents.nix @@ -1,12 +1,16 @@ -{ pkgs, ... }: { - home.packages = builtins.attrValues { - inherit (pkgs) - libreoffice - thunderbird - obsidian - foliate - ; - }; - + pkgs, + scope, + getPkgs, + ... +}: +scope "home.packages" +<| getPkgs { + inherit (pkgs) + libreoffice + thunderbird + obsidian + foliate + zathura + ; } diff --git a/graphical/editor.nix b/graphical/editor.nix new file mode 100644 index 0000000..94bf26d --- /dev/null +++ b/graphical/editor.nix @@ -0,0 +1,7 @@ +{ + pkgs, + inputs, + scope, + ... +}: +scope "home.packages" [ inputs.zedless.packages.${pkgs.system}.default ] diff --git a/graphical/fm.nix b/graphical/fm.nix index 9dc044f..9697db1 100644 --- a/graphical/fm.nix +++ b/graphical/fm.nix @@ -1,10 +1,13 @@ -{ pkgs, ... }: { - home.packages = builtins.attrValues { - inherit (pkgs) - file-roller - nautilus - ; - }; - + pkgs, + scope, + getPkgs, + ... +}: +scope "home.packages" +<| getPkgs { + inherit (pkgs) + file-roller + nautilus + ; } diff --git a/graphical/fonts.nix b/graphical/fonts.nix new file mode 100644 index 0000000..c626b2f --- /dev/null +++ b/graphical/fonts.nix @@ -0,0 +1,69 @@ +{ + config, + pkgs, + localPkgs, + ... +}: +{ + rice.fonts = + let + sans = { + name = "MS W98 UI"; + size = 12; + package = localPkgs.ms-w98-ui-font; + }; + serif = { + name = "Poly"; + size = 12; + package = pkgs.poly; + }; + monospace = { + name = "Mx437 DOS/V re. JPN24"; + size = 14; + package = localPkgs.oldschool-pc-fonts.override { style = "mixed"; }; + }; + emoji = { + name = "Twitter Color Emoji"; + size = 12; + package = pkgs.twemoji-color-font; + }; + in + { + inherit + sans + serif + monospace + emoji + ; + pkgs = [ + sans.package + serif.package + monospace.package + emoji.package + pkgs.meslo-lgs-nf + ]; + }; + fonts = + let + inherit (config.rice) fonts; + in + { + packages = fonts.pkgs; + fontconfig = { + enable = true; + useEmbeddedBitmaps = true; + hinting = { + enable = false; + # style = "full"; + }; + antialias = true; + defaultFonts = { + serif = [ fonts.serif.name ]; + sansSerif = [ fonts.sans.name ]; + monospace = [ fonts.monospace.name ]; + emoji = [ fonts.emoji.name ]; + }; + }; + }; + +} diff --git a/graphical/gfx-env.nix b/graphical/gfx-env.nix index ac514a0..bd278eb 100644 --- a/graphical/gfx-env.nix +++ b/graphical/gfx-env.nix @@ -1,14 +1,10 @@ -{ - ... -}: -{ - environment.sessionVariables = { - NIXOS_OZONE_WL = "1"; - GBM_BACKEND = "nvidia-drm"; - NVD_BACKEND = "direct"; - __GLX_VENDOR_LIBRARY_NAME = "nvidia"; - LIBVA_DRIVER_NAME = "nvidia"; - __GL_GSYNC_ALLOWED = "1"; - __GL_VRR_ALLOWED = "1"; - }; +{ scope, ... }: +scope "environment.sessionVariables" { + NIXOS_OZONE_WL = "1"; + GBM_BACKEND = "nvidia-drm"; + NVD_BACKEND = "direct"; + __GLX_VENDOR_LIBRARY_NAME = "nvidia"; + LIBVA_DRIVER_NAME = "nvidia"; + __GL_GSYNC_ALLOWED = "1"; + __GL_VRR_ALLOWED = "1"; } diff --git a/graphical/hw.nix b/graphical/hw.nix index 46cc98f..76b5b0f 100644 --- a/graphical/hw.nix +++ b/graphical/hw.nix @@ -1,5 +1,5 @@ -{ ... }: -{ - hardware.enableRedistributableFirmware = true; - hardware.enableAllFirmware = true; +{ scope, ... }: +scope "hardware" { + enableRedistributableFirmware = true; + enableAllFirmware = true; } diff --git a/graphical/input.nix b/graphical/input.nix index 7db5e0d..0b93d8c 100644 --- a/graphical/input.nix +++ b/graphical/input.nix @@ -1,5 +1,4 @@ -{ ... }: -{ +_: { services.libinput.enable = true; console.useXkbConfig = true; services.xserver.xkb.options = "caps:swapescape"; diff --git a/graphical/logout.nix b/graphical/logout.nix index 2078b70..a1b9cf4 100644 --- a/graphical/logout.nix +++ b/graphical/logout.nix @@ -1,6 +1,7 @@ { pkgs, config, + scope, ... }: let @@ -8,8 +9,8 @@ let pal = rice.palette.hex; pkg = pkgs.wlogout; in -{ - hm.programs.wlogout = { +scope "hm" { + programs.wlogout = { enable = true; package = pkg; layout = builtins.fromJSON (builtins.readFile ./logout/layout); @@ -42,5 +43,5 @@ in ); }; - hm.home.packages = [ pkg ]; + home.packages = [ pkg ]; } diff --git a/graphical/media.nix b/graphical/media.nix index dbe5930..4b330bc 100644 --- a/graphical/media.nix +++ b/graphical/media.nix @@ -1,13 +1,16 @@ -{ pkgs, ... }: { - home.packages = builtins.attrValues { - inherit (pkgs) - mpv - imv - resonance - zathura - feishin - nicotine-plus - ; - }; + pkgs, + scope, + getPkgs, + ... +}: +scope "home.packages" +<| getPkgs { + inherit (pkgs) + mpv + imv + resonance + feishin + nicotine-plus + ; } diff --git a/graphical/rice.nix b/graphical/rice.nix index 75e0fe6..0150cba 100644 --- a/graphical/rice.nix +++ b/graphical/rice.nix @@ -1,60 +1,22 @@ { pkgs, - userPkgs, + localPkgs, config, inputs, ... }: { + home.packages = let - inherit (config.rice) icons fonts cursor; + inherit (config.rice) icons cursor; in - fonts.pkgs - ++ icons.pkgs + icons.pkgs ++ [ cursor.package ]; rice = { - fonts = - let - sans = { - name = "Inria Sans"; - size = 12; - package = pkgs.inriafonts; - }; - serif = { - name = "Inria Serif"; - size = 12; - package = pkgs.inriafonts; - }; - monospace = { - name = "Fira Code"; - size = 11; - package = pkgs.fira-code; - }; - emoji = { - name = "Twitter Color Emoji"; - size = 12; - package = pkgs.twemoji-color-font; - }; - in - { - inherit - sans - serif - monospace - emoji - ; - pkgs = [ - sans.package - serif.package - monospace.package - emoji.package - pkgs.meslo-lgs-nf - ]; - }; icons = let @@ -70,14 +32,13 @@ gtk-theme = { name = "nix-rice"; - package = pkgs.callPackage userPkgs.gtk-theme { palette = config.rice.palette.shortHex; }; + package = localPkgs.gtk-theme.override { palette = config.rice.palette.shortHex; }; }; borders = { thickness = 6; rounding = 0; - gaps_in = 32; - gaps_out = 72; + gaps = 32; }; bg = { diff --git a/graphical/shell.nix b/graphical/shell.nix index ea7b186..7467d9e 100644 --- a/graphical/shell.nix +++ b/graphical/shell.nix @@ -4,6 +4,7 @@ inputs, mainUser, config, + getPkgs, ... }: let @@ -13,7 +14,7 @@ in { # quickshell stuff environment.systemPackages = - builtins.attrValues { + getPkgs { inherit (pkgs.kdePackages) qtbase qtdeclarative; inherit (pkgs) wl-clipboard; } diff --git a/graphical/terminal.nix b/graphical/terminal.nix index 443caab..a4f7094 100644 --- a/graphical/terminal.nix +++ b/graphical/terminal.nix @@ -1,112 +1,48 @@ { - pkgs, - lib, config, + scope, ... }: -{ - # hm.programs.kitty = - # let - # inherit (config) rice; - # in - # { - # enable = true; - # font = { - # inherit (rice.fonts.monospace) name size; - # }; - # settings = with rice.palette.hex; { - # foreground = util.fg; - # background = util.bg; - # inherit (util) cursor; - # cursor_text = util.bg; - # selection_foreground = util.fg_sel; - # selection_background = util.bg_sel; - # color0 = normal.black; - # color1 = normal.red; - # color2 = normal.green; - # color3 = normal.yellow; - # color4 = normal.blue; - # color5 = normal.magenta; - # color6 = normal.cyan; - # color7 = normal.white; - # color8 = bright.black; - # color9 = bright.red; - # color10 = bright.green; - # color11 = bright.yellow; - # color12 = bright.blue; - # color13 = bright.magenta; - # color14 = bright.cyan; - # color15 = bright.white; - # sync_to_monitor = "yes"; - # shell = "fish"; - # cursor_trail = 100; - # }; - # }; +scope "programs.foot" { + enable = true; + enableFishIntegration = true; + settings = { + main = + let + font = + config.rice.fonts.monospace.name + ":size=" + (builtins.toString config.rice.fonts.monospace.size); + in + { + inherit font; + font-bold = font; + font-italic = font; + }; + colors = + let + pal = config.rice.palette.shortHex; + in + { + background = pal.util.bg; + foreground = pal.util.fg; + regular0 = pal.normal.black; + regular1 = pal.normal.red; + regular2 = pal.normal.green; + regular3 = pal.normal.yellow; + regular4 = pal.normal.blue; + regular5 = pal.normal.magenta; + regular6 = pal.normal.cyan; + regular7 = pal.normal.white; + bright0 = pal.bright.black; + bright1 = pal.bright.red; + bright2 = pal.bright.green; + bright3 = pal.bright.yellow; + bright4 = pal.bright.blue; + bright5 = pal.bright.magenta; + bright6 = pal.bright.cyan; + bright7 = pal.bright.white; - home.packages = [ pkgs.ghostty ]; - home.xdg.config.files = { - "ghostty/themes/rice" = { - generator = - (pkgs.formats.keyValue { - listsAsDuplicateKeys = true; - mkKeyValue = lib.generators.mkKeyValueDefault { } " = "; - }).generate - "ghostty-theme"; - value = - let - inherit (config.rice.palette.shortHex) util; - inherit (config.rice.palette.hex) normal bright; - in - { - foreground = util.fg; - background = util.bg; - cursor-color = util.cursor; - palette = [ - "0=${normal.black}" - "1=${normal.red}" - "2=${normal.green}" - "3=${normal.yellow}" - "4=${normal.blue}" - "5=${normal.magenta}" - "6=${normal.cyan}" - "7=${normal.white}" - "8=${bright.black}" - "9=${bright.red}" - "10=${bright.green}" - "11=${bright.yellow}" - "12=${bright.blue}" - "13=${bright.magenta}" - "14=${bright.cyan}" - "15=${bright.white}" - ]; - selection-foreground = util.fg_sel; - selection-background = util.bg_sel; - }; - }; - - "ghostty/config" = { - generator = lib.generators.toKeyValue { }; - value = - let - inherit (config) rice; - in - { - theme = "rice"; - font-size = rice.fonts.monospace.size; - font-family = rice.fonts.monospace.name; - window-decoration = "server"; - gtk-titlebar = false; - gtk-single-instance = true; - linux-cgroup = "always"; - gtk-wide-tabs = false; - }; - }; + selection-foreground = pal.util.fg_sel; + selection-background = pal.util.bg_sel; + }; }; - # hm.programs.ghostty = { - # enable = true; - # package = null; - # installBatSyntax = true; - # enableFishIntegration = true; - # clearDefaultKeybinds = false; - # }; } diff --git a/graphical/wm.nix b/graphical/wm.nix index 7f85d14..cd0f641 100644 --- a/graphical/wm.nix +++ b/graphical/wm.nix @@ -26,7 +26,7 @@ in }; layout = { always-center-single-column = true; - gaps = 24; + gaps = config.rice.borders.gaps; default-column-width.proportion = 0.5; preset-column-widths = map (p: { proportion = p; }) [ (2.0 / 3.0) diff --git a/hosts/adrift/boot.nix b/hosts/adrift/boot.nix index c883502..1fb638a 100644 --- a/hosts/adrift/boot.nix +++ b/hosts/adrift/boot.nix @@ -1,6 +1,6 @@ -{ ... }: -{ - boot.kernelParams = [ +{ scope, ... }: +scope "boot" { + kernelParams = [ "mitigations=off" "quiet" "loglevel=3" @@ -8,18 +8,18 @@ "rd.udev.log_level=3" "vt.global_cursor_default=0" ]; - boot.initrd.availableKernelModules = [ + initrd.availableKernelModules = [ "xhci_pci" "nvme" "usb_storage" "sd_mod" "rtsx_pci_sdmmc" ]; - boot.initrd.kernelModules = [ "dm-snapshot" ]; - boot.kernelModules = [ + initrd.kernelModules = [ "dm-snapshot" ]; + kernelModules = [ "iwlwifi" "kvm-intel" ]; - boot.loader.systemd-boot.configurationLimit = 2; - boot.loader.efi.canTouchEfiVariables = true; + loader.systemd-boot.configurationLimit = 2; + loader.efi.canTouchEfiVariables = true; } diff --git a/hosts/adrift/fs.nix b/hosts/adrift/fs.nix index 70cf455..0dabfb1 100644 --- a/hosts/adrift/fs.nix +++ b/hosts/adrift/fs.nix @@ -1,18 +1,19 @@ -{ ... }: -{ +_: { - fileSystems."/boot" = { - device = "/dev/disk/by-uuid/1C5C-8FF4"; - fsType = "vfat"; - }; + fileSystems = { + "/boot" = { + device = "/dev/disk/by-uuid/1C5C-8FF4"; + fsType = "vfat"; + }; - fileSystems."/" = { - device = "/dev/disk/by-uuid/26389642-cf51-4c58-98e9-1fe491a11bb9"; - fsType = "ext4"; + "/" = { + device = "/dev/disk/by-uuid/26389642-cf51-4c58-98e9-1fe491a11bb9"; + fsType = "ext4"; + }; }; swapDevices = [ { device = "/dev/disk/by-uuid/a732641d-1233-45a7-8614-53caed60f11b"; } ]; - + } diff --git a/hosts/quiver/boot.nix b/hosts/quiver/boot.nix index 710becc..7c3243b 100644 --- a/hosts/quiver/boot.nix +++ b/hosts/quiver/boot.nix @@ -1,19 +1,19 @@ -{ config, ... }: -{ - boot.initrd.availableKernelModules = [ +{ scope, ... }: +scope "boot" { + initrd.availableKernelModules = [ "xhci_pci" "ahci" "usbcore" "sd_mod" ]; - boot.initrd.kernelModules = [ ]; - boot.initrd.verbose = false; - boot.kernelModules = [ + initrd.kernelModules = [ ]; + initrd.verbose = false; + kernelModules = [ "kvm-amd" "i2c-dev" ]; - boot.consoleLogLevel = 0; - boot.kernelParams = [ + consoleLogLevel = 0; + kernelParams = [ "mitigations=off" "preempt=full" "quiet" @@ -22,18 +22,18 @@ "rd.udev.log_level=3" "vt.global_cursor_default=0" ]; - boot.supportedFilesystems = { + supportedFilesystems = { ntfs = true; btrfs = true; }; - boot.loader.efi.canTouchEfiVariables = true; - boot.plymouth = { + loader.efi.canTouchEfiVariables = true; + plymouth = { enable = true; # theme needs fixing # inherit (config.rice.plymouth) theme themePackages font; }; - boot.loader.limine.extraEntries = '' + loader.limine.extraEntries = '' /Windows protocol: efi path: boot():/EFI/Microsoft/Boot/bootmgfw.efi diff --git a/hosts/quiver/fs.nix b/hosts/quiver/fs.nix index 2b41dbc..d988f66 100644 --- a/hosts/quiver/fs.nix +++ b/hosts/quiver/fs.nix @@ -1,5 +1,4 @@ -{ ... }: -{ +_: { fileSystems = { "/" = { diff --git a/hosts/quiver/llm.nix b/hosts/quiver/llm.nix index ff90f78..e38ff11 100644 --- a/hosts/quiver/llm.nix +++ b/hosts/quiver/llm.nix @@ -1,11 +1,16 @@ -{ inputs, config, ... }: { - services.ollama = { + inputs, + config, + scope, + ... +}: +scope "services" { + ollama = { enable = true; user = "ollama"; }; - services.open-webui = { + open-webui = { package = inputs.nixpkgs-stable.legacyPackages.x86_64-linux.open-webui; enable = true; port = 8088; diff --git a/hosts/quiver/outputs.nix b/hosts/quiver/outputs.nix index 421e9b5..90e7e17 100644 --- a/hosts/quiver/outputs.nix +++ b/hosts/quiver/outputs.nix @@ -1,14 +1,11 @@ -{ ... }: -{ - hm.programs.niri.settings.outputs = { - "DP-1" = { - transform.rotation = 90; - scale = 1; - }; - "DP-2" = { - variable-refresh-rate = true; - scale = 1; - }; +{ scope, ... }: +scope "hm.programs.niri.settings.outputs" { + "DP-1" = { + transform.rotation = 90; + scale = 1; + }; + "DP-2" = { + variable-refresh-rate = true; + scale = 1; }; - } diff --git a/util/create.nix b/lib/create.nix similarity index 62% rename from util/create.nix rename to lib/create.nix index e09ca96..ffc7a5f 100644 --- a/util/create.nix +++ b/lib/create.nix @@ -3,7 +3,6 @@ let inherit (inputs) nixpkgs; inherit (nixpkgs) lib; recursivelyImport = import ./recursively-import.nix { inherit lib; }; - recursivePkgs = import ./recursive-pkgs.nix { inherit lib; }; in { systems = @@ -13,14 +12,20 @@ in lib.nixosSystem { specialArgs = { inherit inputs; - userPkgs = recursivePkgs ../pkg; - mainUser = info.user; + inherit (info) system; + localPkgs = lib.packagesFromDirectoryRecursive { + inherit (inputs.nixpkgs.legacyPackages.${info.system}) callPackage; + directory = ../pkgs; + }; + scope = import ./scope.nix { inherit lib; }; + mainUser = info.username; + getPkgs = builtins.attrValues; }; modules = [ inputs.home-manager.nixosModules.home-manager inputs.hjem.nixosModules.hjem - (lib.mkAliasOptionModule [ "hm" ] [ "home-manager" "users" info.user ]) - (lib.mkAliasOptionModule [ "home" ] [ "hjem" "users" info.user ]) + (lib.mkAliasOptionModule [ "hm" ] [ "home-manager" "users" info.username ]) + (lib.mkAliasOptionModule [ "home" ] [ "hjem" "users" info.username ]) ] ++ (recursivelyImport info.imports); } diff --git a/util/inputs.nix b/lib/inputs.nix similarity index 78% rename from util/inputs.nix rename to lib/inputs.nix index c547536..5f5acc3 100644 --- a/util/inputs.nix +++ b/lib/inputs.nix @@ -1,5 +1,6 @@ let lock = builtins.fromJSON (builtins.readFile ../flake.lock); + # we use lix's flake-compat fork here to "lazify" the flake inputs node = lock.nodes.root.inputs.__flake-compat; inherit (lock.nodes.${node}.locked) narHash rev url; flake-compat = builtins.fetchTarball { @@ -8,6 +9,7 @@ let }; flake = import flake-compat { src = ../.; + # these options prevent eager store copies copySourceTreeToStore = false; useBuiltinsFetchTree = true; }; diff --git a/util/recursively-import.nix b/lib/recursively-import.nix similarity index 100% rename from util/recursively-import.nix rename to lib/recursively-import.nix diff --git a/lib/scope.nix b/lib/scope.nix new file mode 100644 index 0000000..8690bbe --- /dev/null +++ b/lib/scope.nix @@ -0,0 +1 @@ +{ lib }: sc: mod: lib.strings.splitString "." sc |> (lib.flip lib.setAttrByPath) mod diff --git a/pkg/fr-yazi.nix b/pkg/fr-yazi.nix deleted file mode 100644 index 7a72a91..0000000 --- a/pkg/fr-yazi.nix +++ /dev/null @@ -1,14 +0,0 @@ -{ - pkgs, - ... -}: -pkgs.yaziPlugins.mkYaziPlugin { - pname = "fr.yazi"; - version = "dirty-15-07-2025"; - src = pkgs.fetchFromGitHub { - owner = "lpnh"; - repo = "fr.yazi"; - rev = "3d32e55b7367334abaa91f36798ef723098d0a6b"; - hash = "sha256-CrKwFMaiEK+TNW6GRZzyt9MfOmjIb3vw0hBpBXyn16k="; - }; -} diff --git a/pkg/gtk-theme.nix b/pkgs/gtk-theme.nix similarity index 98% rename from pkg/gtk-theme.nix rename to pkgs/gtk-theme.nix index 1ab5d47..f492dcd 100644 --- a/pkg/gtk-theme.nix +++ b/pkgs/gtk-theme.nix @@ -1,4 +1,7 @@ -{ pkgs, palette }: +{ + pkgs, + palette ? { }, +}: let rendersvg = pkgs.runCommand "rendersvg" { } '' mkdir -p $out/bin diff --git a/pkgs/metropolis-font.nix b/pkgs/metropolis-font.nix new file mode 100644 index 0000000..881e9c6 --- /dev/null +++ b/pkgs/metropolis-font.nix @@ -0,0 +1,23 @@ +{ + stdenvNoCC, + fetchzip, +}: +stdenvNoCC.mkDerivation { + pname = "metropolis-font"; + version = "5.2.5"; + src = fetchzip { + name = "metropolis-font-base"; + url = "https://api.fontsource.org/v1/download/metropolis"; + extension = "zip"; + hash = "sha256-BH8iiJE7One2HXxVE9/VgQaxi+hWKujTNErELMvT4mw="; + stripRoot = false; + }; + + installPhase = '' + runHook preInstall + + install -m644 --target $out/share/fonts/truetype/ -D $src/ttf/*.ttf + + runHook postInstall + ''; +} diff --git a/pkgs/ms-w98-ui-font.nix b/pkgs/ms-w98-ui-font.nix new file mode 100644 index 0000000..6c0da5a --- /dev/null +++ b/pkgs/ms-w98-ui-font.nix @@ -0,0 +1,21 @@ +{ + stdenvNoCC, + fetchFromGitHub, +}: +stdenvNoCC.mkDerivation { + pname = "ms-w98-ui-font"; + version = "1.0"; + src = fetchFromGitHub { + owner = "MARTYR-X-LTD"; + repo = "ms-w98-ui"; + rev = "1333c17aa54f547025679ea05a37eee5a2a26429"; + hash = "sha256-yEbq8Hef4odL3pjGHxjDVE9lRCeiw7eekvUL5SbJ1Zw="; + }; + installPhase = '' + runHook preInstall + + install -m644 --target $out/share/fonts/truetype/ -D $src/TTF/*.ttf + + runHook postInstall + ''; +} diff --git a/pkgs/oldschool-pc-fonts.nix b/pkgs/oldschool-pc-fonts.nix new file mode 100644 index 0000000..3b18555 --- /dev/null +++ b/pkgs/oldschool-pc-fonts.nix @@ -0,0 +1,44 @@ +{ + lib, + stdenvNoCC, + fetchzip, + style ? "mixed", + baseVersion ? "2.2", +}: +let + styles = builtins.mapAttrs (_: v: lib.escape [ " " "(" ")" ] v) { + "bitmap" = "otb - Bm (linux bitmap)"; + "aspect" = "ttf - Ac (aspect-corrected)"; + "mixed" = "ttf - Mx (mixed outline+bitmap)"; + "pixel" = "ttf - Px (pixel outline)"; + }; + selectedStyle = styles.${style}; +in +stdenvNoCC.mkDerivation (finalAttrs: { + pname = "oldschool-pc-font-pack"; + version = "${baseVersion}-${style}"; + src = fetchzip { + name = "oldschool-pc-font-pack-base"; + url = "https://int10h.org/oldschool-pc-fonts/download/oldschool_pc_font_pack_v${baseVersion}_linux.zip"; + hash = "sha256-54U8tZzvivTSOgmGesj9QbIgkSTm9w4quMhsuEc0Xy4="; + stripRoot = false; + }; + + installPhase = '' + runHook preInstall + '' + + ( + if (style == "bitmap") then + '' + install -m644 --target $out/share/fonts/ -D $src/${selectedStyle}/*.otb + '' + else + '' + install -m644 --target $out/share/fonts/truetype/ -D $src/${selectedStyle}/*.ttf + '' + ) + + '' + runHook postInstall + ''; + +}) diff --git a/pkgs/rbw-helper.nix b/pkgs/rbw-helper.nix new file mode 100644 index 0000000..025d3eb --- /dev/null +++ b/pkgs/rbw-helper.nix @@ -0,0 +1,44 @@ +{ pkgs, ... }: +pkgs.writeTextFile { + name = "rbw-helper"; + text = '' + declare -A params + + if [ "x$1" == "xget" ]; then + read line + while [ -n "$line" ]; do + key=$\{line%%=*} + value=$\{line#*=} + params[$key]=$value + read line + done + + if [ "x$\{params['protocol']}" != "xhttps" ]; then + exit + fi + + if [ -z "$\{params["host"]}" ]; then + exit + fi + + rbw ls > /dev/null 2>&1 + if [ $? -ne 0 ]; then + echo "Please login to rbw to use git credential helper" > /dev/stderr + exit + fi + + user=`rbw get --full $\{params["host"]} | grep "Username:" | cut -d' ' -f2-` + pass=`rbw get $\{params["host"]}` + + if [ "x$user" == "x" ] || [ "x$pass" == "x" ]; then + echo "Couldn't find host in rbw DB." > /dev/stderr + exit + fi + + echo username=$user + echo password=$pass + fi + ''; + executable = true; + destination = "/bin/git-credential-rw"; +} diff --git a/util/recursive-pkgs.nix b/util/recursive-pkgs.nix deleted file mode 100644 index 1b907ac..0000000 --- a/util/recursive-pkgs.nix +++ /dev/null @@ -1,28 +0,0 @@ -{ lib }: -let - getFiles = - path: - builtins.filter (i: lib.hasSuffix ".nix" (builtins.toString i)) ( - lib.filesystem.listFilesRecursive path - ); - getPkgsAttrs = - path: - let - prefix = builtins.toString path; - in - map ( - file: - let - name = lib.pipe file [ - builtins.toString - (lib.removePrefix (prefix + "/")) - (lib.removeSuffix ".nix") - ]; - in - { - "${name}" = file; - } - ) (getFiles path); - getAllPkgs = path: lib.mergeAttrsList (getPkgsAttrs path); -in -getAllPkgs