diff --git a/flake.lock b/flake.lock index d8bc002..e434794 100644 --- a/flake.lock +++ b/flake.lock @@ -45,6 +45,27 @@ "type": "github" } }, + "flake-parts": { + "inputs": { + "nixpkgs-lib": [ + "nur", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1733312601, + "narHash": "sha256-4pDvzqnegAfRkPwO3wmwBhVi/Sye1mzps0zHWYnP88c=", + "owner": "hercules-ci", + "repo": "flake-parts", + "rev": "205b12d8b7cd4802fbcb8e8ef6a0f1408781a4f9", + "type": "github" + }, + "original": { + "owner": "hercules-ci", + "repo": "flake-parts", + "type": "github" + } + }, "home-manager": { "inputs": { "nixpkgs": [ @@ -73,11 +94,11 @@ ] }, "locked": { - "lastModified": 1739757849, - "narHash": "sha256-Gs076ot1YuAAsYVcyidLKUMIc4ooOaRGO0PqTY7sBzA=", + "lastModified": 1743808813, + "narHash": "sha256-2lDQBOmlz9ggPxcS7/GvcVdzXMIiT+PpMao6FbLJSr0=", "owner": "nix-community", "repo": "home-manager", - "rev": "9d3d080aec2a35e05a15cedd281c2384767c2cfe", + "rev": "a9f8b3db211b4609ddd83683f9db89796c7f6ac6", "type": "github" }, "original": { @@ -94,11 +115,11 @@ ] }, "locked": { - "lastModified": 1741126078, - "narHash": "sha256-ng0a4cIq3c9E3iGKomlwqKzVYs2RLOzQho2U1Mc2sqU=", + "lastModified": 1743127615, + "narHash": "sha256-+sMGqywrSr50BGMLMeY789mSrzjkoxZiu61eWjYS/8o=", "owner": "LnL7", "repo": "nix-darwin", - "rev": "c172f50b55b087f8e7801631de977461603bb976", + "rev": "fc843893cecc1838a59713ee3e50e9e7edc6207c", "type": "github" }, "original": { @@ -110,11 +131,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1741838297, - "narHash": "sha256-0etyrY6jOzFwVILODzMc43MTtUanxzFSaqe3kVLvew4=", + "lastModified": 1743891346, + "narHash": "sha256-QNxnxIi6PJEnwJp7ZXUpxX4/z/cmRJGeIOkIYfYh/8E=", "owner": "nixos", "repo": "nixpkgs", - "rev": "80b53fdb4f883238807ced86db41be809d60f3b5", + "rev": "f27c6099cec4fe9b67c7fbc51d8324dcb4b52694", "type": "github" }, "original": { @@ -126,11 +147,11 @@ }, "nixpkgs-unstable": { "locked": { - "lastModified": 1741865919, - "narHash": "sha256-4thdbnP6dlbdq+qZWTsm4ffAwoS8Tiq1YResB+RP6WE=", + "lastModified": 1743938762, + "narHash": "sha256-UgFYn8sGv9B8PoFpUfCa43CjMZBl1x/ShQhRDHBFQdI=", "owner": "nixos", "repo": "nixpkgs", - "rev": "573c650e8a14b2faa0041645ab18aed7e60f0c9a", + "rev": "74a40410369a1c35ee09b8a1abee6f4acbedc059", "type": "github" }, "original": { @@ -140,13 +161,59 @@ "type": "github" } }, + "nur": { + "inputs": { + "flake-parts": "flake-parts", + "nixpkgs": [ + "nixpkgs" + ], + "treefmt-nix": "treefmt-nix" + }, + "locked": { + "lastModified": 1744170471, + "narHash": "sha256-IOo5/Y7SagmCLFAVG6SGcre4XtRlJDz/61BaqBQCrQQ=", + "owner": "nix-community", + "repo": "NUR", + "rev": "8f5c2432968936b78f9e42ec0ed82167bd1a3bd7", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "NUR", + "type": "github" + } + }, "root": { "inputs": { "agenix": "agenix", "home-manager": "home-manager_2", "nix-darwin": "nix-darwin", "nixpkgs": "nixpkgs", - "nixpkgs-unstable": "nixpkgs-unstable" + "nixpkgs-unstable": "nixpkgs-unstable", + "nur": "nur", + "rycee-nurpkgs": "rycee-nurpkgs" + } + }, + "rycee-nurpkgs": { + "inputs": { + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "dir": "pkgs/firefox-addons", + "lastModified": 1744140214, + "narHash": "sha256-iZIA22PlVXMbBA3Df/SmbVj45CiikSofrSCwVT+xNYU=", + "owner": "rycee", + "repo": "nur-expressions", + "rev": "8d9af93d292ef141354d32a91dca041ce324b109", + "type": "gitlab" + }, + "original": { + "dir": "pkgs/firefox-addons", + "owner": "rycee", + "repo": "nur-expressions", + "type": "gitlab" } }, "systems": { @@ -163,6 +230,27 @@ "repo": "default", "type": "github" } + }, + "treefmt-nix": { + "inputs": { + "nixpkgs": [ + "nur", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1733222881, + "narHash": "sha256-JIPcz1PrpXUCbaccEnrcUS8jjEb/1vJbZz5KkobyFdM=", + "owner": "numtide", + "repo": "treefmt-nix", + "rev": "49717b5af6f80172275d47a418c9719a31a78b53", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "treefmt-nix", + "type": "github" + } } }, "root": "root", diff --git a/flake.nix b/flake.nix index 5dc90ed..2bc24ca 100644 --- a/flake.nix +++ b/flake.nix @@ -17,102 +17,63 @@ url = "github:LnL7/nix-darwin/nix-darwin-24.11"; inputs.nixpkgs.follows = "nixpkgs"; }; + rycee-nurpkgs = { + url = "gitlab:rycee/nur-expressions?dir=pkgs/firefox-addons"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + nur = { + url = "github:nix-community/NUR"; + inputs.nixpkgs.follows = "nixpkgs"; + }; }; outputs = { self, nix-darwin, nixpkgs, nixpkgs-unstable, home-manager, agenix - , ... }: { - homeConfigurations = { - "millironx@corianne" = home-manager.lib.homeManagerConfiguration { + , rycee-nurpkgs, nur, ... }: + let + mkHomeConfiguration = { hostname, arch ? "x86_64", os ? "linux" + , desktop ? false, extraModules ? [ ] }: + let + system = "${arch}-${os}"; pkgs = import nixpkgs { - system = "aarch64-darwin"; + inherit system; + config.allowUnfree = true; + overlays = [ nur.overlays.default ]; + }; + pkgs-unstable = import nixpkgs-unstable { + inherit system; config.allowUnfree = true; }; - - # Specify your home configuration modules here, for example, - # the path to your home.nix. + firefox-addons = pkgs.nur.repos.rycee.firefox-addons; + inherit (rycee-nurpkgs.lib.${system}) buildFirefoxXpiAddon; + in home-manager.lib.homeManagerConfiguration { + inherit pkgs; modules = [ ./homes/common.nix - ./homes/darwin.nix - ./homes/desktop.nix - ./homes/corianne.nix + ./homes/${os}.nix + ./homes/${hostname}.nix agenix.homeManagerModules.default - ]; - - # Optionally use extraSpecialArgs - # to pass through arguments to home.nix + ] ++ (if desktop then [ ./homes/desktop.nix ] else [ ]) + ++ extraModules; extraSpecialArgs = { - pkgs-unstable = import nixpkgs-unstable { - system = "aarch64-darwin"; - config.allowUnfree = true; - }; + inherit pkgs-unstable; + inherit firefox-addons; + inherit buildFirefoxXpiAddon; }; }; + in { + homeConfigurations = { + "millironx@corianne" = mkHomeConfiguration { + hostname = "corianne"; + arch = "aarch64"; + os = "darwin"; + desktop = true; + }; - "millironx@anderson" = let - system = "x86_64-linux"; - config = { allowUnfree = true; }; - pkgs = import nixpkgs { - inherit system; - inherit config; - }; - pkg-unstable = import nixpkgs-unstable { - inherit system; - inherit config; - }; - in home-manager.lib.homeManagerConfiguration { - inherit pkgs; - modules = [ - ./homes/common.nix - ./homes/linux.nix - ./homes/anderson.nix - agenix.homeManagerModules.default - ]; - extraSpecialArgs = { inherit pkg-unstable; }; - }; + "millironx@anderson" = mkHomeConfiguration { hostname = "anderson"; }; - "millironx@bosephus" = let - system = "x86_64-linux"; - config = { allowUnfree = true; }; - pkgs = import nixpkgs { - inherit system; - inherit config; - }; - pkg-unstable = import nixpkgs-unstable { - inherit system; - inherit config; - }; - in home-manager.lib.homeManagerConfiguration { - inherit pkgs; - modules = [ - ./homes/common.nix - ./homes/linux.nix - ./homes/bosephus.nix - agenix.homeManagerModules.default - ]; - extraSpecialArgs = { inherit pkg-unstable; }; - }; + "millironx@bosephus" = mkHomeConfiguration { hostname = "bosephus"; }; - "tchristensen@beocat" = let - system = "x86_64-linux"; - config = { allowUnfree = true; }; - pkgs = import nixpkgs { - inherit system; - inherit config; - }; - pkg-unstable = import nixpkgs-unstable { - inherit system; - inherit config; - }; - in home-manager.lib.homeManagerConfiguration { - inherit pkgs; - modules = [ - ./homes/common.nix - ./homes/linux.nix - ./homes/beocat.nix - agenix.homeManagerModules.default - ]; - extraSpecialArgs = { inherit pkg-unstable; }; - }; + "tchristensen@beocat" = mkHomeConfiguration { hostname = "beocat"; }; }; darwinConfigurations."corianne" = nix-darwin.lib.darwinSystem { diff --git a/homes/desktop.nix b/homes/desktop.nix index 11bb398..9a70e05 100644 --- a/homes/desktop.nix +++ b/homes/desktop.nix @@ -1,14 +1,24 @@ -{ config, lib, pkgs, pkgs-unstable, ... }: +{ config, lib, pkgs, pkgs-unstable, firefox-addons, buildFirefoxXpiAddon, ... }: let packages = import ./../pkgs.nix { inherit pkgs; inherit pkgs-unstable; }; + firefox-config = import ./../programs/firefox.nix; + zed-config = import ./../programs/zed.nix; in { home = { packages = packages.desktop; shellAliases = { code = "codium"; }; }; + programs = { + firefox = firefox-config { + inherit firefox-addons; + inherit buildFirefoxXpiAddon; + inherit lib; + }; + zed-editor = zed-config; + }; services = { gpg-agent = { enable = true; diff --git a/programs/firefox.nix b/programs/firefox.nix new file mode 100644 index 0000000..6fda45e --- /dev/null +++ b/programs/firefox.nix @@ -0,0 +1,276 @@ +{ firefox-addons, buildFirefoxXpiAddon, lib }: { + enable = true; + package = + null; # Use native package manager/Homebrew b/c there are fewer breakages + profiles = { + "millironx-default" = { + id = 0; + containers = { + "Personal" = { + id = 1; + color = "blue"; + icon = "fingerprint"; + }; + "Administrator" = { + id = 2; + color = "yellow"; + icon = "briefcase"; + }; + "Kansas State CVM" = { + id = 3; + color = "purple"; + icon = "pet"; + }; + "Kansas State" = { + id = 4; + color = "pink"; + icon = "fruit"; + }; + "Bovine Club" = { + id = 5; + color = "turquoise"; + icon = "food"; + }; + "CVF" = { + id = 6; + color = "red"; + icon = "food"; + }; + "Swine Club" = { + id = 7; + color = "green"; + icon = "food"; + }; + "Therio Club" = { + id = 8; + color = "orange"; + icon = "food"; + }; + }; + containersForce = true; + extensions = with firefox-addons; [ + bitwarden + multi-account-containers + floccus + libredirect + old-reddit-redirect + plasma-integration + pwas-for-firefox + ublock-origin + web-archives + zotero-connector + (buildFirefoxXpiAddon rec { + pname = "always_in_container"; + version = "1.0.7"; + addonId = "{a1e9543e-5f73-4763-b376-04e53fd12cbd}"; + url = + "https://addons.mozilla.org/firefox/downloads/file/4032840/${pname}-${version}.xpi"; + sha256 = "sha256-bLxjL2P6Sd06q98MSHYRTNigtcjGwn/C2r4ANWCqKrw="; + meta = with lib; { + homepage = "https://github.com/tiansh/always-in-container"; + description = + "Chose a container every time you try to open a page out of a container"; + license = licenses.mpl20; + platforms = platforms.all; + }; + }) + (buildFirefoxXpiAddon rec { + pname = "open_with"; + version = "7.2.6"; + addonId = "openwith@darktrojan.net"; + url = + "https://addons.mozilla.org/firefox/downloads/file/3831723/${pname}-${version}.xpi"; + sha256 = "sha256-f9eGhLxg4UyVn4o5e4DRkraLWzj11SGto/GOwsJa9kg="; + meta = with lib; { + homepage = "https://darktrojan.github.io/openwith/"; + description = + "Quickly test out your web pages in Chrome, Edge, Safari, or Opera. Open With opens the current page in your other browsers with just two clicks."; + license = licenses.mpl20; + platforms = platforms.all; + }; + }) + ]; + search = { + default = "Milliron X Search"; + privateDefault = "Milliron X Search"; + force = true; + engines = { + "Milliron X Search" = { + urls = [ + { + rels = [ "results" ]; + type = "text/html"; + method = "GET"; + template = + "https://search.millironx.com/search?q={searchTerms}"; + } + { + rels = [ "suggestions" ]; + type = "application/x-suggestions+json"; + method = "GET"; + template = + "https://search.millironx.com/autocompleter?q={searchTerms}"; + } + ]; + iconUpdateURL = + "https://search.millironx.com/static/themes/simple/img/favicon.png"; + updateInterval = 24 * 60 * 60 * 1000; # every day + definedAliases = [ "@mxs" ]; + }; + "Perplexity" = { + urls = + [{ template = "https://www.perplexity.ai/?q={searchTerms}"; }]; + icon = "https://www.perplexity.ai/favicon.ico"; + updateInterval = 7 * 24 * 60 * 60 * 1000; + definedAliases = [ "@pxt" ]; + }; + }; + }; + settings = { + "app.normandy.first_run" = false; + "app.shield.optoutstudies.enabled" = false; + "browser.contentblocking.category" = "strict"; + "browser.formfill.enable" = false; + "browser.newtabpage.activity-stream.asrouter.userprefs.cfr.addons" = + false; + "browser.newtabpage.activity-stream.asrouter.userprefs.cfr.features" = + false; + "browser.newtabpage.activity-stream.feeds.section.topstories" = false; + "browser.newtabpage.activity-stream.showSponsoredTopSites" = false; + "browser.newtabpage.activity-stream.showWeather" = false; + "browser.newtabpage.pinned" = [ + { + url = "https://millironx.com"; + label = "Home"; + baseDomain = "millironx.com"; + } + { + url = "https://nextcloud.millironx.com"; + label = "Nextcloud"; + baseDomain = "nextcloud.millironx.com"; + } + { + url = "https://code.millironx.com"; + label = "Code"; + baseDomain = "code.millironx.com"; + } + { + url = "https://video.millironx.com"; + label = "Videos"; + baseDomain = "video.millironx.com"; + } + { + url = "https://photos.millironx.com"; + label = "Photos"; + baseDomain = "photos.millironx.com"; + } + { + url = "https://vault.millironx.com"; + label = "Vault"; + baseDomain = "vault.millironx.com"; + } + { + url = "https://www.perplexity.ai/"; + label = "perplexity"; + } + { + url = + "https://www.vet.k-state.edu/academics/student-faculty-handbook/"; + } + ]; + "browser.shopping.experience2023.active" = false; + "browser.startup.homepage_override.mstone" = "ignore"; + "browser.tabs.closeWindowWithLastTab" = false; + "browser.tabs.inTitlebar" = 0; + "browser.theme.content-theme" = 0; + "browser.theme.toolbar-theme" = 0; + "browser.toolbars.bookmarks.visibility" = "never"; + "browser.uiCustomization.state" = { + placements = { + "widget-overflow-fixed-list" = [ ]; + "unified-extensions-area" = [ + "floccus_handmadeideas_org-browser-action" + "7esoorv3_alefvanoon_anonaddy_me-browser-action" + "plasma-browser-integration_kde_org-browser-action" + "firefoxpwa_filips_si-browser-action" + "_d07ccf11-c0cd-4938-a265-2a4d6ad01189_-browser-action" # Web Archives + "openwith_darktrojan_net-browser-action" + "zotero_chnm_gmu_edu-browser-action" + ]; + "nav-bar" = [ + "back-button" + "forward-button" + "customizableui-special-spring1" + "vertical-spacer" + "urlbar-container" + "stop-reload-button" + "customizableui-special-spring2" + "downloads-button" + "_446900e4-71c2-419f-a6a7-df9c091e268b_-browser-action" # Bitwarden + "ublock0_raymondhill_net-browser-action" + "unified-extensions-button" + "_testpilot-containers-browser-action" + ]; + "TabsToolbar" = [ + "firefox-view-button" + "tabbrowser-tabs" + "new-tab-button" + "alltabs-button" + ]; + "vertical-tabs" = [ ]; + "PersonalToolbar" = [ "import-button" "personal-bookmarks" ]; + }; + seen = [ + "save-to-pocket-button" + "developer-button" + "_446900e4-71c2-419f-a6a7-df9c091e268b_-browser-action" + "_testpilot-containers-browser-action" + "floccus_handmadeideas_org-browser-action" + "7esoorv3_alefvanoon_anonaddy_me-browser-action" + "plasma-browser-integration_kde_org-browser-action" + "firefoxpwa_filips_si-browser-action" + "ublock0_raymondhill_net-browser-action" + "_d07ccf11-c0cd-4938-a265-2a4d6ad01189_-browser-action" + "zotero_chnm_gmu_edu-browser-action" + "openwith_darktrojan_net-browser-action" + ]; + dirtyAreaCache = [ + "nav-bar" + "vertical-tabs" + "PersonalToolbar" + "unified-extensions-area" + ]; + currentVersion = 21; + newElementCount = 3; + }; + "browser.urlbar.suggest.showSearchSuggestionsFirst" = false; + "browser.urlbar.suggest.quicksuggest.nonsponsored" = false; + "browser.urlbar.suggest.quicksuggest.sponsored" = false; + "browser.urlbar.suggest.quicksuggest.trending" = false; + "browser.warnOnQuitShortcut" = false; + "datareporting.healthreport.uploadEnabled" = false; + "datareporting.usage.uploadEnabled" = false; + "extensions.formautofill.addresses.enabled" = false; + "extensions.formautofill.creditCards.enabled" = false; + "extensions.autoDisableScopes" = 0; + "network.trr.mode" = 3; # DNS over HTTPS always + "network.trr.uri" = "https://family.dns.mullvad.net/dns-query"; + "network.trr.custom_uri" = "https://family.dns.mullvad.net/dns-query"; + "privacy.bounceTrackingProtection.mode" = 1; + "privacy.clearOnShutdown_v2.browsingHistoryAndDownloads" = false; + "privacy.clearOnShutdown_v2.cache" = true; + "privacy.clearOnShutdown_v2.cookiesAndStorage" = true; + "privacy.clearOnShutdown_v2.formdata" = true; + "privacy.clearOnShutdown_v2.historyFormDataAndDownloads" = false; + "privacy.history.custom" = true; + "privacy.query_stripping.enabled" = true; + "privacy.sanitize.clearOnShutdown.hasMigratedToNewPrefs3" = true; + "privacy.sanitize.sanitizeOnShutdown" = true; + "privacy.trackingprotection.emailtracking.enabled" = true; + "privacy.trackingprotection.enabled" = true; + "privacy.trackingprotection.socialtracking.enabled" = true; + "widget.use-xdg-desktop-portal.file-picker" = 1; + }; + }; + }; +} diff --git a/programs/zed.nix b/programs/zed.nix new file mode 100644 index 0000000..e3cbb0f --- /dev/null +++ b/programs/zed.nix @@ -0,0 +1,46 @@ +{ + enable = true; + extensions = [ + "basher" + "clojure" + "cspell" + "dockerfile" + "earthfile" + "git-firefly" + "html" + "julia" + "latex" + "macos-classic" + "nix" + "toml" + "xml" + ]; + userSettings = { + assistant = { + default_model = { + provider = "zed.dev"; + model = "claude-3-5-sonnet-latest"; + }; + version = "2"; + }; + buffer_font_family = "FiraCode Nerd Font"; + buffer_font_size = 11; + features = { edit_prediction_provider = "zed"; }; + languages = { + Nix = { formatter = { external = { command = "nixfmt"; }; }; }; + }; + preview_tabs = { enabled = false; }; + ssh_connections = [{ + host = "anderson"; + projects = [{ paths = [ "/var/docker" ]; }]; + }]; + show_edit_predictions = false; + terminal = { + font_family = "MesloLGS NF"; + font_size = 10; + }; + theme = "macOS Classic Dark2"; + ui_font_size = 16; + wrap_guides = [ 80 92 120 ]; + }; +}