From 39ee6aa2524b3e4753a049eea1285a79fd1ef218 Mon Sep 17 00:00:00 2001 From: atagen Date: Fri, 22 Aug 2025 13:44:33 +1000 Subject: [PATCH] apps scope, pollute specialargs more, switch back to firefox --- common/terminal.nix | 32 +++-- flake.lock | 183 ++++++--------------------- graphical/apps-meta.nix | 13 ++ graphical/audio-control.nix | 10 +- graphical/browser.nix | 204 +++++++++++++----------------- graphical/desktop/niri-config.kdl | 4 +- graphical/dev.nix | 63 ++++----- graphical/documents.nix | 18 ++- graphical/editor.nix | 4 +- graphical/fm.nix | 11 +- graphical/media.nix | 17 +-- graphical/password-manager.nix | 8 +- graphical/shell.nix | 5 +- graphical/terminal.nix | 4 +- graphical/wm.nix | 14 +- lib/create.nix | 29 +++-- 16 files changed, 253 insertions(+), 366 deletions(-) create mode 100644 graphical/apps-meta.nix diff --git a/common/terminal.nix b/common/terminal.nix index 72ecf45..6bff4af 100644 --- a/common/terminal.nix +++ b/common/terminal.nix @@ -2,6 +2,7 @@ lib, pkgs, inputs, + getFlakePkg', ... }: let @@ -36,18 +37,25 @@ in "p" = "ps $argv | culr"; "mnt" = "mount | culr"; }; - interactiveShellInit = '' - 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 - ${ - lib.getExe inputs.nix-index-database.packages.${pkgs.system}.comma-with-db - } "$argv[1]" "$argv[2..]" - end - ${./rice/header.sh} - ''; + interactiveShellInit = + let + comma = lib.getExe' (getFlakePkg' inputs.nix-index-database "comma-with-db") "comma"; + in + '' + 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 + set args (count $argv) + if [ $args -gt 1 ] + ${comma} "$argv[1]" "$argv[2..]" + else + ${comma} "$argv[1]" + end + end + ${./rice/header.sh} + ''; }; programs.command-not-found.enable = false; programs.zoxide = { diff --git a/flake.lock b/flake.lock index f0320ef..9cb1024 100644 --- a/flake.lock +++ b/flake.lock @@ -313,7 +313,7 @@ "inputs": { "flake-compat": "flake-compat_4", "gitignore": "gitignore", - "nixpkgs": "nixpkgs_14" + "nixpkgs": "nixpkgs_13" }, "locked": { "lastModified": 1747372754, @@ -695,29 +695,6 @@ "type": "github" } }, - "niri-flake": { - "inputs": { - "niri-stable": "niri-stable_2", - "niri-unstable": "niri-unstable_2", - "nixpkgs": "nixpkgs_11", - "nixpkgs-stable": "nixpkgs-stable_2", - "xwayland-satellite-stable": "xwayland-satellite-stable_2", - "xwayland-satellite-unstable": "xwayland-satellite-unstable_2" - }, - "locked": { - "lastModified": 1753374784, - "narHash": "sha256-R6vHaUJiehdXSnzZqCOxmtmAnHA4GBOpS/UKydzAI38=", - "owner": "sodiboo", - "repo": "niri-flake", - "rev": "da95771a65821bc98118cf3478eb2fc6fbfe035a", - "type": "github" - }, - "original": { - "owner": "sodiboo", - "repo": "niri-flake", - "type": "github" - } - }, "niri-stable": { "flake": false, "locked": { @@ -735,36 +712,19 @@ "type": "github" } }, - "niri-stable_2": { - "flake": false, - "locked": { - "lastModified": 1748151941, - "narHash": "sha256-z4viQZLgC2bIJ3VrzQnR+q2F3gAOEQpU1H5xHtX/2fs=", - "owner": "YaLTeR", - "repo": "niri", - "rev": "8ba57fcf25d2fc9565131684a839d58703f1dae7", - "type": "github" - }, - "original": { - "owner": "YaLTeR", - "ref": "v25.05.1", - "repo": "niri", - "type": "github" - } - }, "niri-tag": { "inputs": { "naersk": "naersk", - "niri-flake": "niri-flake", - "nixpkgs": "nixpkgs_12", + "niri": "niri_2", + "nixpkgs": "nixpkgs_11", "systems": "systems_5" }, "locked": { - "lastModified": 1753421223, - "narHash": "sha256-SfZZvJCH1pGkhwMPxLjo+D0C6TWhrZzkgkyngxlk4os=", + "lastModified": 1755582059, + "narHash": "sha256-fDyhFfRazK2SvPQVGi6tcMTpOAu6CoUhZSyaaE2edtE=", "ref": "refs/heads/main", - "rev": "51c0486748face3d31784f92b2ee330e78740b32", - "revCount": 36, + "rev": "0c1a104cea3de07c3416edb0d16db324daf5f61f", + "revCount": 37, "type": "git", "url": "https://git.atagen.co/atagen/niri-tag" }, @@ -789,14 +749,14 @@ "type": "github" } }, - "niri-unstable_2": { + "niri_2": { "flake": false, "locked": { - "lastModified": 1752870529, - "narHash": "sha256-23DJk5EfEDCq7Xy1QELcayG0VxbbWpdQ6t7jbhae1Ok=", + "lastModified": 1755539138, + "narHash": "sha256-8LoWAwBqHFOM1Je3b+XCs6gM5LbJlMfZtSpJvTe3sQk=", "owner": "YaLTeR", "repo": "niri", - "rev": "fefc0bc0a71556eb75352e2b611e50eb5d3bf9c2", + "rev": "43a2648e579fc81366fc81b15f834c9c9dff119b", "type": "github" }, "original": { @@ -830,7 +790,7 @@ }, "nix-index-database": { "inputs": { - "nixpkgs": "nixpkgs_13" + "nixpkgs": "nixpkgs_12" }, "locked": { "lastModified": 1755404379, @@ -851,7 +811,7 @@ "flake-parts": "flake-parts_4", "git-hooks-nix": "git-hooks-nix", "kitty-themes-src": "kitty-themes-src", - "nixpkgs": "nixpkgs_15", + "nixpkgs": "nixpkgs_14", "nixpkgs-lib": "nixpkgs-lib_4", "systems": "systems_6" }, @@ -992,22 +952,6 @@ } }, "nixpkgs-stable_2": { - "locked": { - "lastModified": 1753345091, - "narHash": "sha256-CdX2Rtvp5I8HGu9swBmYuq+ILwRxpXdJwlpg8jvN4tU=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "3ff0e34b1383648053bba8ed03f201d3466f90c9", - "type": "github" - }, - "original": { - "owner": "NixOS", - "ref": "nixos-25.05", - "repo": "nixpkgs", - "type": "github" - } - }, - "nixpkgs-stable_3": { "locked": { "lastModified": 1751274312, "narHash": "sha256-/bVBlRpECLVzjV19t5KMdMFWSwKLtb5RyXdjz3LJT+g=", @@ -1041,27 +985,11 @@ }, "nixpkgs_11": { "locked": { - "lastModified": 1753250450, - "narHash": "sha256-i+CQV2rPmP8wHxj0aq4siYyohHwVlsh40kV89f3nw1s=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "fc02ee70efb805d3b2865908a13ddd4474557ecf", - "type": "github" - }, - "original": { - "owner": "NixOS", - "ref": "nixos-unstable", - "repo": "nixpkgs", - "type": "github" - } - }, - "nixpkgs_12": { - "locked": { - "lastModified": 1753369216, - "narHash": "sha256-Jx2i6loWL755GD+GlCXESMhIiO0aFc/pDo82N16fEiw=", + "lastModified": 1755268003, + "narHash": "sha256-nNaeJjo861wFR0tjHDyCnHs1rbRtrMgxAKMoig9Sj/w=", "owner": "nixos", "repo": "nixpkgs", - "rev": "b74a30dbc0a72e20df07d43109339f780b439291", + "rev": "32f313e49e42f715491e1ea7b306a87c16fe0388", "type": "github" }, "original": { @@ -1071,7 +999,7 @@ "type": "github" } }, - "nixpkgs_13": { + "nixpkgs_12": { "locked": { "lastModified": 1755186698, "narHash": "sha256-wNO3+Ks2jZJ4nTHMuks+cxAiVBGNuEBXsT29Bz6HASo=", @@ -1087,7 +1015,7 @@ "type": "github" } }, - "nixpkgs_14": { + "nixpkgs_13": { "locked": { "lastModified": 1730768919, "narHash": "sha256-8AKquNnnSaJRXZxc5YmF/WfmxiHX6MMZZasRP6RRQkE=", @@ -1103,7 +1031,7 @@ "type": "github" } }, - "nixpkgs_15": { + "nixpkgs_14": { "locked": { "lastModified": 1748538152, "narHash": "sha256-lqAVR6FhqjdY9XpBs+cpIbHJpHxQaEFTeJMu/nkA9s0=", @@ -1118,6 +1046,22 @@ "type": "github" } }, + "nixpkgs_15": { + "locked": { + "lastModified": 1755186698, + "narHash": "sha256-wNO3+Ks2jZJ4nTHMuks+cxAiVBGNuEBXsT29Bz6HASo=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "fbcf476f790d8a217c3eab4e12033dc4a0f6d23c", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, "nixpkgs_16": { "locked": { "lastModified": 1755186698, @@ -1135,22 +1079,6 @@ } }, "nixpkgs_17": { - "locked": { - "lastModified": 1755186698, - "narHash": "sha256-wNO3+Ks2jZJ4nTHMuks+cxAiVBGNuEBXsT29Bz6HASo=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "fbcf476f790d8a217c3eab4e12033dc4a0f6d23c", - "type": "github" - }, - "original": { - "owner": "NixOS", - "ref": "nixos-unstable", - "repo": "nixpkgs", - "type": "github" - } - }, - "nixpkgs_18": { "locked": { "lastModified": 1754214453, "narHash": "sha256-Q/I2xJn/j1wpkGhWkQnm20nShYnG7TI99foDBpXm1SY=", @@ -1299,7 +1227,7 @@ "flake-schemas": "flake-schemas", "home-manager": "home-manager_2", "jovian": "jovian", - "nixpkgs": "nixpkgs_17", + "nixpkgs": "nixpkgs_16", "rust-overlay": "rust-overlay_4" }, "locked": { @@ -1356,8 +1284,8 @@ "niri-tag": "niri-tag", "nix-index-database": "nix-index-database", "nix-rice": "nix-rice", - "nixpkgs": "nixpkgs_16", - "nixpkgs-stable": "nixpkgs-stable_3", + "nixpkgs": "nixpkgs_15", + "nixpkgs-stable": "nixpkgs-stable_2", "nyx": "nyx", "quickshell": "quickshell", "zedless": "zedless" @@ -1682,23 +1610,6 @@ "type": "github" } }, - "xwayland-satellite-stable_2": { - "flake": false, - "locked": { - "lastModified": 1748488455, - "narHash": "sha256-IiLr1alzKFIy5tGGpDlabQbe6LV1c9ABvkH6T5WmyRI=", - "owner": "Supreeeme", - "repo": "xwayland-satellite", - "rev": "3ba30b149f9eb2bbf42cf4758d2158ca8cceef73", - "type": "github" - }, - "original": { - "owner": "Supreeeme", - "ref": "v0.6", - "repo": "xwayland-satellite", - "type": "github" - } - }, "xwayland-satellite-unstable": { "flake": false, "locked": { @@ -1715,26 +1626,10 @@ "type": "github" } }, - "xwayland-satellite-unstable_2": { - "flake": false, - "locked": { - "lastModified": 1752338000, - "narHash": "sha256-Fxlp/yKtynug0jyuauAmvZU2SzHCfwlwWf85j+IvQ0U=", - "owner": "Supreeeme", - "repo": "xwayland-satellite", - "rev": "ba78881a68182ce338041846164cbfed0d70935c", - "type": "github" - }, - "original": { - "owner": "Supreeeme", - "repo": "xwayland-satellite", - "type": "github" - } - }, "zedless": { "inputs": { "flake-compat": "flake-compat_5", - "nixpkgs": "nixpkgs_18" + "nixpkgs": "nixpkgs_17" }, "locked": { "lastModified": 1754831523, diff --git a/graphical/apps-meta.nix b/graphical/apps-meta.nix new file mode 100644 index 0000000..9ee0599 --- /dev/null +++ b/graphical/apps-meta.nix @@ -0,0 +1,13 @@ +{ + lib, + config, + getPkgs, + ... +}: +{ + options.apps = lib.mkOption { + type = lib.types.attrsOf lib.types.package; + default = { }; + }; + config.user.packages = getPkgs config.apps; +} diff --git a/graphical/audio-control.nix b/graphical/audio-control.nix index b196b0a..870503c 100644 --- a/graphical/audio-control.nix +++ b/graphical/audio-control.nix @@ -1,16 +1,12 @@ { pkgs, lib, - getPkgs, ... }: { - user.packages = getPkgs { - inherit (pkgs) - avizo - playerctl - ; + apps = { + volumeOSD = pkgs.avizo; + inherit (pkgs) playerctl; }; - quick.services."avizo-service" = "${lib.getExe' pkgs.avizo "avizo-service"}"; } diff --git a/graphical/browser.nix b/graphical/browser.nix index 8bb6da4..f91d12b 100644 --- a/graphical/browser.nix +++ b/graphical/browser.nix @@ -1,123 +1,95 @@ { + lib, pkgs, + scope, ... }: -{ - user.packages = [ pkgs.chromium ]; - programs.chromium = { - enable = true; - homepageLocation = "about:blank"; - extraOpts = { - "BrowserSignin" = 0; - "SyncDisabled" = true; - "DriveDisabled" = true; - "AIModeSettings" = 1; - "GenAiDefaultSettings" = 1; - "SafeBrowsingProtectionLevel" = 0; - "DeviceAutoUpdateDisabled" = true; - "PasswordManagerEnabled" = false; - "SpellcheckEnabled" = true; - "SpellcheckLanguage" = [ - "en-AU" - ]; - "CloudReportingEnabled" = false; - "GoogleWorkspaceCloudUpload" = "disallowed"; - "MicrosoftOfficeCloudUpload" = "disallowed"; - }; - extensions = [ - "ddkjiahejlhfcafbddmgiahcphecmpfh" # ublock origin lite - "eimadpbcbfnmbkopoojfekhnkhdbieeh" # dark reader - "hfjbmagddngcpeloejdejnfgbamkjaeg" # vimium c - "bkmmlbllpjdpgcgdohbaghfaecnddhni" # webrtc protect - "nngceckbapebfimnlniiiahkandclblb" # bitwarden - "dhdgffkkebhmkfjojejmpbldmpobfkfo" +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"; + }; +in +scope "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; + + 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; + }; + }; + + # 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; + # }; + # }; } -# 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"; -# }; -# in -# 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; - -# 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; -# }; -# }; - -# 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/desktop/niri-config.kdl b/graphical/desktop/niri-config.kdl index 80d8d16..96b46b0 100755 --- a/graphical/desktop/niri-config.kdl +++ b/graphical/desktop/niri-config.kdl @@ -71,9 +71,9 @@ binds { Mod+Ctrl+K { move-window-up; } Mod+Ctrl+L { move-column-right-or-to-monitor-right; } Mod+D { spawn "qs" "ipc" "call" "launch" "toggle"; } - Mod+E { spawn "nautilus"; } + Mod+E { spawn "pcmanfm"; } Mod+Equal { spawn "bitwarden"; } - Mod+F { spawn "chromium"; } + Mod+F { spawn "firefox"; } Mod+H { focus-column-left; } Mod+J { focus-window-down; } Mod+K { focus-window-up; } diff --git a/graphical/dev.nix b/graphical/dev.nix index 2a9a995..9cbf4fb 100644 --- a/graphical/dev.nix +++ b/graphical/dev.nix @@ -1,41 +1,44 @@ { + pkgs, localPkgs, scope, ... }: scope "user" { + programs = { + direnv = { + enable = true; + integrations.fish.enable = true; + }; + + git = { + enable = true; + settings = { + user = { + name = "atagen"; + email = "boss@atagen.co"; + }; + # merge = { + # conflictstyle = "diff3"; + # }; + init = { + defaultBranch = "main"; + }; + url = { + "https://github.com/".insteadOf = "github:"; + "https://git.atagen.co/".insteadOf = "atagen:"; + "https://codeberg.org/".insteadOf = "codeberg:"; + }; + credential.helper = "rbw"; + }; + integrations = { + difftastic.enable = true; + }; + }; + }; packages = [ localPkgs.rbw-helper + pkgs.direnv ]; - - programs.direnv = { - enable = true; - integrations.fish.enable = true; - }; - - programs.git = { - enable = true; - settings = { - user = { - name = "atagen"; - email = "boss@atagen.co"; - }; - merge = { - conflictstyle = "diff3"; - }; - init = { - defaultBranch = "main"; - }; - url = { - "https://github.com/".insteadOf = "github:"; - "https://git.atagen.co/".insteadOf = "atagen:"; - }; - credential.helper = "rbw"; - }; - integrations = { - difftastic.enable = true; - }; - }; - } diff --git a/graphical/documents.nix b/graphical/documents.nix index 8e6b270..31f2f88 100644 --- a/graphical/documents.nix +++ b/graphical/documents.nix @@ -1,16 +1,14 @@ { pkgs, scope, - getPkgs, ... }: -scope "user.packages" -<| getPkgs { - inherit (pkgs) - libreoffice - thunderbird - obsidian - foliate - zathura - ; +with pkgs; +scope "apps" { + officeSuite = libreoffice; + mailClient = thunderbird; + noteTaking = obsidian; + ebookReader = foliate; + pdfReader = zathura; + calculator = mate.mate-calc; } diff --git a/graphical/editor.nix b/graphical/editor.nix index 884867f..64ccbe1 100644 --- a/graphical/editor.nix +++ b/graphical/editor.nix @@ -1,7 +1,7 @@ { - pkgs, inputs, scope, + getFlakePkg, ... }: -scope "user.packages" [ inputs.zedless.packages.${pkgs.system}.default ] +scope "apps.ide" <| getFlakePkg inputs.zedless diff --git a/graphical/fm.nix b/graphical/fm.nix index dd8da05..29bf09d 100644 --- a/graphical/fm.nix +++ b/graphical/fm.nix @@ -1,13 +1,10 @@ { pkgs, scope, - getPkgs, ... }: -scope "user.packages" -<| getPkgs { - inherit (pkgs) - file-roller - nautilus - ; +with pkgs; +scope "apps" { + fm = pcmanfm; + archive = mate.engrampa; } diff --git a/graphical/media.nix b/graphical/media.nix index c2d0c4f..8fc2d40 100644 --- a/graphical/media.nix +++ b/graphical/media.nix @@ -1,16 +1,13 @@ { pkgs, scope, - getPkgs, ... }: -scope "user.packages" -<| getPkgs { - inherit (pkgs) - mpv - imv - resonance - feishin - nicotine-plus - ; +with pkgs; +scope "apps" { + videoPlayer = mpv; + imageViewer = imv; + musicPlayer = resonance; + streamPlayer = feishin; + soulSeek = nicotine-plus; } diff --git a/graphical/password-manager.nix b/graphical/password-manager.nix index e71095c..a3061ea 100644 --- a/graphical/password-manager.nix +++ b/graphical/password-manager.nix @@ -9,8 +9,8 @@ }; }; - user.packages = [ - pkgs.rbw - pkgs.bitwarden - ]; + apps = with pkgs; { + passwordManager = bitwarden; + passwordCli = rbw; + }; } diff --git a/graphical/shell.nix b/graphical/shell.nix index 1c1aac8..04d9510 100644 --- a/graphical/shell.nix +++ b/graphical/shell.nix @@ -4,6 +4,7 @@ inputs, mainUser, getPkgs, + getFlakePkg', ... }: let @@ -11,7 +12,7 @@ let in { # quickshell stuff - environment.systemPackages = + user.packages = getPkgs { inherit (pkgs.kdePackages) qtbase qtdeclarative; inherit (pkgs) wl-clipboard; @@ -46,7 +47,7 @@ in swaync = "${getExe pkgs.swaynotificationcenter}"; swayidle = let - niri = inputs.niri.packages.${pkgs.system}.niri-unstable; + niri = getFlakePkg' inputs.niri "niri-unstable"; systemctl = getExe' pkgs.systemd "systemctl"; in '' diff --git a/graphical/terminal.nix b/graphical/terminal.nix index a4f7094..50bb5d5 100644 --- a/graphical/terminal.nix +++ b/graphical/terminal.nix @@ -1,9 +1,11 @@ { + pkgs, config, scope, ... }: -scope "programs.foot" { +(scope "apps.terminal" <| pkgs.foot) +// scope "programs.foot" { enable = true; enableFishIntegration = true; settings = { diff --git a/graphical/wm.nix b/graphical/wm.nix index c13f221..358f2d9 100644 --- a/graphical/wm.nix +++ b/graphical/wm.nix @@ -1,14 +1,14 @@ { - pkgs, - # lib, mainUser, inputs, + getFlakePkg', # config, ... }: -# let -# inherit (config) rice; -# in +let + # inherit (config) rice; + niri = (getFlakePkg' inputs.niri "niri-unstable"); +in { imports = [ inputs.niri.nixosModules.niri @@ -24,7 +24,7 @@ source = "/home/${mainUser}/.nix/graphical/desktop/niri-config.kdl"; }; # user.xdg.config.files."niri/config.kdl".source = ./desktop/niri-config.kdl; - user.packages = [ inputs.niri.packages.${pkgs.system}.niri-unstable ]; + user.packages = [ niri ]; services.greetd = { enable = true; restart = false; @@ -42,7 +42,7 @@ }; programs.niri = { enable = true; - package = inputs.niri.packages.${pkgs.system}.niri-unstable; + package = niri; }; services.niri-tag.enable = true; diff --git a/lib/create.nix b/lib/create.nix index dc85f97..65d1e70 100644 --- a/lib/create.nix +++ b/lib/create.nix @@ -21,22 +21,27 @@ in scope = import ./scope.nix { inherit lib; }; mainUser = info.username; getPkgs = builtins.attrValues; + getFlakePkg = p: p.packages.${info.system}.default; + getFlakePkg' = p: n: p.packages.${info.system}.${n}; }; modules = [ inputs.arbys.nixosModules.arbys inputs.hjem.nixosModules.hjem - ({ scope, ... }: scope "hjem" { - users.${info.username}.enable = true; - extraModules = [ - inputs.hjem-rum.hjemModules.hjem-rum - ] - # alias base hjem options to `rum` so we can alias them all together after - ++ (map (f: lib.mkAliasOptionModule [ "rum" f ] [ f ]) [ - "packages" - "files" - "xdg" - ]); - }) + ( + { scope, ... }: + scope "hjem" { + users.${info.username}.enable = true; + extraModules = [ + inputs.hjem-rum.hjemModules.hjem-rum + ] + # alias base hjem options to `rum` so we can alias them all together after + ++ (map (f: lib.mkAliasOptionModule [ "rum" f ] [ f ]) [ + "packages" + "files" + "xdg" + ]); + } + ) # alias hjem-rum options to `user` (lib.mkAliasOptionModule [ "user" ] [ "hjem" "users" info.username "rum" ]) ]