From 813efc75beff8e83268c5ff702e6a0fa17786d9e Mon Sep 17 00:00:00 2001 From: mat ess Date: Mon, 19 Dec 2022 21:45:46 -0500 Subject: [PATCH] Remove pkgs flake, generally tidy up --- README.md | 8 +- darwin/homebrew.nix | 3 +- flake.lock | 148 ++++++------ flake.nix | 149 +++++------- home/fish.nix | 21 +- home/git.nix | 7 +- home/helix.nix | 4 - home/programs.nix | 4 + home/{configs => }/starship-symbols.nix | 0 modules/darwin/primary-user.nix | 26 --- modules/mk-primary-user-module.nix | 25 ++ pkgs/dark-mode-notify.nix | 2 +- pkgs/default.nix | 22 ++ pkgs/flake.lock | 291 ------------------------ pkgs/flake.nix | 52 ----- 15 files changed, 194 insertions(+), 568 deletions(-) rename home/{configs => }/starship-symbols.nix (100%) delete mode 100644 modules/darwin/primary-user.nix create mode 100644 modules/mk-primary-user-module.nix create mode 100644 pkgs/default.nix delete mode 100644 pkgs/flake.lock delete mode 100644 pkgs/flake.nix diff --git a/README.md b/README.md index 3a8964f..a6e196f 100644 --- a/README.md +++ b/README.md @@ -20,10 +20,6 @@ main entry point and glue for submodules compatibility for legacy nix tooling, eg `nix-build` -### nixpkgs.nix - -used to hack compatibility for `` in nix expressions - ### configs non-nix configurations @@ -44,7 +40,7 @@ full featured macOS system homebrew + mac app store apps -#### macos-defaults.nix +#### defaults.nix macOS system settings @@ -86,4 +82,4 @@ pure nix colorscheme palettes ### pkgs -custom-built nix packages +custom-built nix packages in a sub-flake diff --git a/darwin/homebrew.nix b/darwin/homebrew.nix index 46430f7..5e86a4d 100644 --- a/darwin/homebrew.nix +++ b/darwin/homebrew.nix @@ -41,14 +41,15 @@ # If an app isn't available in the Mac App Store, or the version in the App Store has # limitiations, e.g., Transmit, install the Homebrew Cask. + homebrew.caskArgs.no_quarantine = true; homebrew.casks = [ "aerial" "alfred" "bartender" "bbedit" - "caprine" # "discord" # "element" + "ferdium" "firefox" "jitsi-meet" "knockknock" diff --git a/flake.lock b/flake.lock index 0a3efce..cfef0b9 100644 --- a/flake.lock +++ b/flake.lock @@ -3,11 +3,11 @@ "crane": { "flake": false, "locked": { - "lastModified": 1661875961, - "narHash": "sha256-f1h/2c6Teeu1ofAHWzrS8TwBPcnN+EEu+z1sRVmMQTk=", + "lastModified": 1670900067, + "narHash": "sha256-VXVa+KBfukhmWizaiGiHRVX/fuk66P8dgSFfkVN4/MY=", "owner": "ipetkov", "repo": "crane", - "rev": "d9f394e4e20e97c2a60c3ad82c2b6ef99be19e24", + "rev": "59b31b41a589c0a65e4a1f86b0e5eac68081468b", "type": "github" }, "original": { @@ -35,7 +35,7 @@ "darwin": { "inputs": { "nixpkgs": [ - "nixpkgs-unstable" + "nixpkgs" ] }, "locked": { @@ -85,6 +85,7 @@ "nci", "devshell" ], + "flake-parts": "flake-parts", "flake-utils-pre-commit": [ "helix", "nci" @@ -101,6 +102,10 @@ "helix", "nci" ], + "nix-pypi-fetcher": [ + "helix", + "nci" + ], "nixpkgs": [ "helix", "nci", @@ -116,11 +121,11 @@ ] }, "locked": { - "lastModified": 1668851003, - "narHash": "sha256-X7RCQQynbxStZR2m7HW38r/msMQwVl3afD6UXOCtvx4=", + "lastModified": 1671323629, + "narHash": "sha256-9KHTPjIDjfnzZ4NjpE3gGIVHVHopy6weRDYO/7Y3hF8=", "owner": "nix-community", "repo": "dream2nix", - "rev": "c77e8379d8fe01213ba072e40946cbfb7b58e628", + "rev": "2d7d68505c8619410df2c6b6463985f97cbcba6e", "type": "github" }, "original": { @@ -161,19 +166,21 @@ "type": "github" } }, - "flake-compat_2": { - "flake": false, + "flake-parts": { + "inputs": { + "nixpkgs-lib": "nixpkgs-lib" + }, "locked": { - "lastModified": 1668681692, - "narHash": "sha256-Ht91NGdewz8IQLtWZ9LCeNXMSXHUss+9COoqu6JLmXU=", - "owner": "edolstra", - "repo": "flake-compat", - "rev": "009399224d5e398d03b22badca40a37ac85412a1", + "lastModified": 1668450977, + "narHash": "sha256-cfLhMhnvXn6x1vPm+Jow3RiFAUSCw/l1utktCw5rVA4=", + "owner": "hercules-ci", + "repo": "flake-parts", + "rev": "d591857e9d7dd9ddbfba0ea02b43b927c3c0f1fa", "type": "github" }, "original": { - "owner": "edolstra", - "repo": "flake-compat", + "owner": "hercules-ci", + "repo": "flake-parts", "type": "github" } }, @@ -232,16 +239,16 @@ "inputs": { "nci": "nci", "nixpkgs": [ - "nixpkgs-unstable" + "nixpkgs" ], "rust-overlay": "rust-overlay" }, "locked": { - "lastModified": 1670782450, - "narHash": "sha256-0RCWIN9+NnreCg2c36pLbjcVenVPfUfnzRnYDs7P/zk=", + "lastModified": 1671493763, + "narHash": "sha256-xw8cemaLh9Nda9usE0z3sxeiDUuXZ1zDiO6md3i7XLg=", "owner": "helix-editor", "repo": "helix", - "rev": "c5bfb792b2a26545f6515a1e7b62d4f37b10841e", + "rev": "bdeefbfb23077fcbbfe1e7df6c6ac88516244bbc", "type": "github" }, "original": { @@ -253,7 +260,7 @@ "home-manager": { "inputs": { "nixpkgs": [ - "nixpkgs-unstable" + "nixpkgs" ], "utils": [ "flake-utils" @@ -273,27 +280,6 @@ "type": "github" } }, - "home-manager-atemu": { - "inputs": { - "nixpkgs": [ - "nixpkgs-unstable" - ] - }, - "locked": { - "lastModified": 1613409234, - "narHash": "sha256-BW0xKvUfjy/0Wu1W/st1TTEHhpkyV0lPEW0otysvDSQ=", - "owner": "Atemu", - "repo": "home-manager", - "rev": "e6d905336181ed8f98d48a1f6c9965b77f18e304", - "type": "github" - }, - "original": { - "owner": "Atemu", - "ref": "darwin-copy-apps-fully-wip", - "repo": "home-manager", - "type": "github" - } - }, "homebrew-enabled": { "locked": { "lastModified": 1657739253, @@ -371,11 +357,11 @@ ] }, "locked": { - "lastModified": 1669011203, - "narHash": "sha256-Lymj4HktNEFmVXtwI0Os7srDXHZbZW0Nzw3/+5Hf8ko=", + "lastModified": 1671430291, + "narHash": "sha256-UIc7H8F3N8rK72J/Vj5YJdV72tvDvYjH+UPsOFvlcsE=", "owner": "yusdacra", "repo": "nix-cargo-integration", - "rev": "c5133b91fc1d549087c91228bd213f2518728a4b", + "rev": "b1b0d38b8c3b0d0e6a38638d5bbe10b0bc67522c", "type": "github" }, "original": { @@ -386,16 +372,34 @@ }, "nixpkgs": { "locked": { - "lastModified": 1659446231, - "narHash": "sha256-hekabNdTdgR/iLsgce5TGWmfIDZ86qjPhxDg/8TlzhE=", + "lastModified": 1671268780, + "narHash": "sha256-9Okbivo10bcXEGCtmAQNfJt1Zpk6B3tjkSQ2CIXmTCg=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "eabc38219184cc3e04a974fe31857d8e0eac098d", + "rev": "80c24eeb9ff46aa99617844d0c4168659e35175f", "type": "github" }, "original": { "owner": "NixOS", - "ref": "nixpkgs-21.11-darwin", + "ref": "nixpkgs-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs-lib": { + "locked": { + "dir": "lib", + "lastModified": 1665349835, + "narHash": "sha256-UK4urM3iN80UXQ7EaOappDzcisYIuEURFRoGQ/yPkug=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "34c5293a71ffdb2fe054eb5288adc1882c1eb0b1", + "type": "github" + }, + "original": { + "dir": "lib", + "owner": "NixOS", + "ref": "nixos-unstable", "repo": "nixpkgs", "type": "github" } @@ -417,6 +421,22 @@ } }, "nixpkgs-stable": { + "locked": { + "lastModified": 1659446231, + "narHash": "sha256-hekabNdTdgR/iLsgce5TGWmfIDZ86qjPhxDg/8TlzhE=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "eabc38219184cc3e04a974fe31857d8e0eac098d", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixpkgs-21.11-darwin", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs-stable_2": { "locked": { "lastModified": 1668984258, "narHash": "sha256-0gDMJ2T3qf58xgcSbYoXiRGUkPWmKyr5C3vcathWhKs=", @@ -432,22 +452,6 @@ "type": "github" } }, - "nixpkgs-unstable": { - "locked": { - "lastModified": 1670771160, - "narHash": "sha256-ze4w84B+RbNqm0laRBgXIOZlnOI/5wlCKJWe1LXqSBA=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "0e857e0089d78dee29818dc92722a72f1dea506f", - "type": "github" - }, - "original": { - "owner": "NixOS", - "ref": "nixpkgs-unstable", - "repo": "nixpkgs", - "type": "github" - } - }, "nixpkgs_2": { "locked": { "lastModified": 1668994630, @@ -466,13 +470,13 @@ }, "pre-commit": { "inputs": { - "flake-compat": "flake-compat_2", + "flake-compat": "flake-compat", "flake-utils": [ "flake-utils" ], "gitignore": "gitignore", "nixpkgs": "nixpkgs_2", - "nixpkgs-stable": "nixpkgs-stable" + "nixpkgs-stable": "nixpkgs-stable_2" }, "locked": { "lastModified": 1670413394, @@ -493,18 +497,16 @@ "dark-mode-notify-src": "dark-mode-notify-src", "darwin": "darwin", "fisher-src": "fisher-src", - "flake-compat": "flake-compat", "flake-utils": "flake-utils", "helix": "helix", "home-manager": "home-manager", - "home-manager-atemu": "home-manager-atemu", "homebrew-enabled": "homebrew-enabled", "ia-writer-family-src": "ia-writer-family-src", "kitty-icon": "kitty-icon", "kitty-themes": "kitty-themes", "nixpkgs": "nixpkgs", "nixpkgs-master": "nixpkgs-master", - "nixpkgs-unstable": "nixpkgs-unstable", + "nixpkgs-stable": "nixpkgs-stable", "pre-commit": "pre-commit" } }, @@ -517,11 +519,11 @@ ] }, "locked": { - "lastModified": 1668998422, - "narHash": "sha256-G/BklIplCHZEeDIabaaxqgITdIXtMolRGlwxn9jG2/Q=", + "lastModified": 1671416426, + "narHash": "sha256-kpSH1Jrxfk2qd0pRPJn1eQdIOseGv5JuE+YaOrqU9s4=", "owner": "oxalica", "repo": "rust-overlay", - "rev": "68ab029c93f8f8eed4cf3ce9a89a9fd4504b2d6e", + "rev": "fbaaff24f375ac25ec64268b0a0d63f91e474b7d", "type": "github" }, "original": { diff --git a/flake.nix b/flake.nix index 6cb933e..87e6284 100644 --- a/flake.nix +++ b/flake.nix @@ -3,36 +3,30 @@ inputs = { # Package sets - nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-21.11-darwin"; - nixpkgs-unstable.url = "github:NixOS/nixpkgs/nixpkgs-unstable"; + nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable"; + nixpkgs-stable.url = "github:NixOS/nixpkgs/nixpkgs-21.11-darwin"; nixpkgs-master.url = "github:NixOS/nixpkgs/master"; # Flake helpers flake-utils.url = "github:numtide/flake-utils"; - flake-compat.url = "github:edolstra/flake-compat"; - flake-compat.flake = false; # Environment/system management darwin.url = "github:lnl7/nix-darwin/master"; - darwin.inputs.nixpkgs.follows = "nixpkgs-unstable"; + darwin.inputs.nixpkgs.follows = "nixpkgs"; home-manager.url = "github:nix-community/home-manager"; - home-manager.inputs.nixpkgs.follows = "nixpkgs-unstable"; + home-manager.inputs.nixpkgs.follows = "nixpkgs"; home-manager.inputs.utils.follows = "flake-utils"; # Config "flag" for disabling homebrew homebrew-enabled.url = "github:boolean-option/true"; - # Module to workaround https://github.com/nix-community/home-manager/issues/1341 - home-manager-atemu.url = "github:Atemu/home-manager/darwin-copy-apps-fully-wip"; - home-manager-atemu.inputs.nixpkgs.follows = "nixpkgs-unstable"; - # pre-commit and hooks pre-commit.url = "github:cachix/pre-commit-hooks.nix"; pre-commit.inputs.flake-utils.follows = "flake-utils"; # Extra sources helix.url = "github:helix-editor/helix"; - helix.inputs.nixpkgs.follows = "nixpkgs-unstable"; + helix.inputs.nixpkgs.follows = "nixpkgs"; dark-mode-notify-src.url = "github:bouk/dark-mode-notify"; dark-mode-notify-src.flake = false; ia-writer-family-src.url = "github:iaolo/iA-Fonts"; @@ -45,11 +39,21 @@ fisher-src.flake = false; }; - outputs = { self, darwin, home-manager, flake-utils, pre-commit, ... }@inputs: + outputs = + { self + , home-manager + , flake-utils + , pre-commit + , ... + }@inputs: let + # this is a "functor" that takes an option name + # this allows for creating identical modules + # which can be accessed by appropriate paths darwin or home-manager + mkPrimaryUserModule = import ./modules/mk-primary-user-module.nix; - inherit (darwin.lib) darwinSystem; - inherit (inputs.nixpkgs-unstable.lib) + inherit (inputs.darwin.lib) darwinSystem; + inherit (inputs.nixpkgs.lib) attrValues makeOverridable optionalAttrs; @@ -58,17 +62,7 @@ nixpkgsConfig = { config = { allowUnfree = true; }; overlays = attrValues self.overlays ++ [ - (final: _prev: - import ./pkgs { - inherit inputs; - inherit (final) callPackage; - inherit (final.stdenv) system; - }) - (_final: prev: optionalAttrs (prev.stdenv.system == "aarch64-darwin") - { - # Sub in x86 version of packages that don't build on Apple Silicon yet - # inherit (final.pkgs-x86); - }) + (import ./pkgs { inherit inputs; }) ]; }; @@ -78,14 +72,12 @@ username = "mat"; fullName = "mat ess"; email = "mat@mat.services"; - nixConfigDirectory = "/Users/mat/dotfiles.nix"; }; workUserInfo = { username = "mess"; fullName = "Matthew Ess"; email = "mess@yelp.com"; - nixConfigDirectory = "/Users/mess/dotfiles.nix"; }; # Modules shared by most `nix-darwin` personal configurations. @@ -101,16 +93,17 @@ nixpkgs = nixpkgsConfig; # Hack to support legacy worklows that use ``, darwin-option, etc. nix.nixPath = { - nixpkgs = "${inputs.nixpkgs-unstable}"; + nixpkgs = "${inputs.nixpkgs}"; darwin = "${inputs.darwin}"; }; # `home-manager` config - users.users.${primaryUser.username}.home = "/Users/${primaryUser.username}"; + users.users.${primaryUser.username}.home = primaryUser.homeDirectory; home-manager.useGlobalPkgs = true; home-manager.users.${primaryUser.username} = { imports = attrValues self.homeManagerModules; home.stateVersion = homeManagerStateVersion; home.primaryUser = primaryUser; + home.homeDirectory = primaryUser.homeDirectory; home.enableNixpkgsReleaseCheck = true; }; # Add a registry entry for this flake @@ -197,46 +190,25 @@ }; - # Build and activate on new system with: - # `nix build .#homeConfigurations..activationPackage; ./result/activate` - homeConfigurations = { - cloudVM = home-manager.lib.homeManagerConfiguration { - pkgs = import inputs.nixpkgs-unstable { - system = "x86_64-linux"; - inherit (nixpkgsConfig) config overlays; - }; - modules = attrValues self.homeManagerModules ++ [ - ({ config, ... }: { - home.username = config.home.primaryUser.username; - home.homeDirectory = "/home/${config.home.username}"; - home.stateVersion = homeManagerStateVersion; - home.primaryUser = primaryUserInfo // { - nixConfigDirectory = "${config.home.homeDirectory}/dotfiles.nix"; - }; - }) - ]; - }; - }; - # Overlays --------------------------------------------------------------- {{{ overlays = { # nixpkgs overlays - pkgs-stable = _final: prev: { - pkgs-stable = import inputs.nixpkgs { + pkgs-stable = _: prev: { + pkgs-stable = import inputs.nixpkgs-stable { inherit (prev.stdenv) system; inherit (nixpkgsConfig) config; }; }; - pkgs-unstable = _final: prev: { - pkgs-unstable = import inputs.nixpkgs-unstable { + pkgs-unstable = _: prev: { + pkgs-unstable = import inputs.nixpkgs { inherit (prev.stdenv) system; inherit (nixpkgsConfig) config; }; }; - pkgs-master = _final: prev: { + pkgs-master = _: prev: { pkgs-master = import inputs.nixpkgs-master { inherit (prev.stdenv) system; inherit (nixpkgsConfig) config; @@ -246,16 +218,15 @@ colors = import ./overlays/colors.nix; # Overlay useful on Macs with Apple Silicon - apple-silicon = _final: prev: optionalAttrs (prev.stdenv.system == "aarch64-darwin") { + apple-silicon = _: prev: optionalAttrs (prev.stdenv.system == "aarch64-darwin") { # Add access to x86 packages system is running Apple Silicon - pkgs-x86 = import inputs.nixpkgs-unstable { + pkgs-x86 = import inputs.nixpkgs { system = "x86_64-darwin"; inherit (nixpkgsConfig) config; }; }; - patched = _final: prev: optionalAttrs prev.stdenv.isDarwin { - inherit (inputs) kitty-icon kitty-themes fisher-src; + homebrew-enabled = _: prev: optionalAttrs prev.stdenv.isDarwin { lib = prev.lib // { homebrew-enabled = inputs.homebrew-enabled.value; }; }; }; @@ -268,13 +239,11 @@ general = import ./darwin/general.nix; homebrew = import ./darwin/homebrew.nix; # modules - primary-user = import ./modules/darwin/primary-user.nix; + darwin-primary-user = mkPrimaryUserModule "users"; }; # home manager configurations homeManagerModules = { - # configs - configs-starship-symbols = import ./home/configs/starship-symbols.nix; # services dark-mode-notify-service = import ./home/services/dark-mode-notify.nix; tarsnap-service = import ./home/services/tarsnap.nix; @@ -286,21 +255,12 @@ kitty = import ./home/kitty.nix; programs = import ./home/programs.nix; starship = import ./home/starship.nix; - install-apps = { - # fix app copying - imports = [ (import "${inputs.home-manager-atemu}/modules/targets/darwin.nix") ]; - disabledModules = [ "targets/darwin/linkapps.nix" ]; - darwin.installApps = true; - darwin.fullCopies = true; - }; + starship-symbols = import ./home/starship-symbols.nix; # modules programs-kakoune-extras = import ./modules/home/programs/kakoune/extras.nix; # currently unused programs-helix-extras = import ./modules/home/programs/helix/extras.nix; programs-kitty-extras = import ./modules/home/programs/kitty/extras.nix; - home-primary-user = { lib, ... }: { - options.home.primaryUser = - (self.darwinModules.primary-user { inherit lib; }).options.users.primaryUser; - }; + home-primary-user = mkPrimaryUserModule "home"; }; templates = { @@ -316,34 +276,27 @@ }; } // flake-utils.lib.eachDefaultSystem (system: - let - pkgs = import inputs.nixpkgs-unstable { - inherit system; - inherit (nixpkgsConfig) config; - overlays = with self.overlays; [ - pkgs-master - pkgs-stable - colors - apple-silicon - patched - ]; - }; - in - { - legacyPackages = pkgs; + let + pkgs = import inputs.nixpkgs (nixpkgsConfig // { inherit system; }); + in + { + legacyPackages = pkgs; - checks.pre-commit = pre-commit.lib.${system}.run { - src = ./.; - hooks = { - deadnix.enable = true; - nix-linter.enable = true; - nixpkgs-fmt.enable = true; - statix.enable = true; - }; + checks.pre-commit = pre-commit.lib.${system}.run { + src = ./.; + hooks = { + deadnix.enable = true; + nix-linter.enable = true; + nixpkgs-fmt.enable = true; + statix.enable = true; }; + }; - devShells.default = pkgs.mkShell { + devShells = { + default = pkgs.mkShell { inherit (self.checks.${system}.pre-commit) shellHook; }; - }); + # TODO: add utility devShells here + }; + }); } diff --git a/home/fish.nix b/home/fish.nix index 10b286b..977627d 100644 --- a/home/fish.nix +++ b/home/fish.nix @@ -6,25 +6,21 @@ programs.fish.enable = true; # Add Fish plugins - home.packages = with pkgs.fishPlugins; [ done ]; - - programs.fish.plugins = [ - { - name = "fisher"; - src = pkgs.fisher-src; - } - ]; + home.packages = builtins.attrValues { + inherit (pkgs.fishPlugins) + autopair-fish + colored-man-pages + done; + }; + programs.fish.plugins = [ pkgs.fishPlugins.fisher ]; xdg.configFile."fish/fish_plugins".text = '' - jorgebucaran/autopair.fish jorgebucaran/replay.fish - jorgebucaran/getopts.fish americanhanko/fish-spin joseluisq/gitnow fishpkg/fish-humanize-duration oh-my-fish/plugin-bang-bang matthewess/fish-autovenv - jethrokuan/z Gazorby/fish-abbreviation-tips ''; @@ -142,8 +138,9 @@ programs.fish.shellAliases = let inherit (config.home.primaryUser) nixConfigDirectory; + inherit (pkgs) bat bottom du-dust exa gitAndTools stdenv xh; in - with pkgs; { + { # Nix related from-nix = "from-dir ${nixConfigDirectory}"; # darwin-rebuild build diff --git a/home/git.nix b/home/git.nix index e667e97..428581e 100644 --- a/home/git.nix +++ b/home/git.nix @@ -1,4 +1,4 @@ -{ config, pkgs, ... }: +{ config, ... }: { # Git @@ -14,15 +14,14 @@ diff.colorMoved = "default"; pull.rebase = true; init.defaultBranch = "main"; + help.autocorrect = "prompt"; }; programs.git.ignores = [ ".DS_Store" + ".direnv" ]; # Enhanced diffs programs.git.delta.enable = true; - - # Gitea CLI - home.packages = [ pkgs.tea ]; } diff --git a/home/helix.nix b/home/helix.nix index 7f5aae0..3950efe 100644 --- a/home/helix.nix +++ b/home/helix.nix @@ -1,10 +1,6 @@ -{ pkgs, ... }: - { programs.helix.enable = true; - programs.helix.package = pkgs.helix-flake; - programs.helix.settings = { editor.bufferline = "multiple"; editor.color-modes = true; diff --git a/home/programs.nix b/home/programs.nix index 6fb7e3a..c58d2bb 100644 --- a/home/programs.nix +++ b/home/programs.nix @@ -41,6 +41,10 @@ in enable = true; # extensions = [ pijul-vscode ]; }; + zoxide = { + enable = true; + enableFishIntegration = true; + }; }; # }}} diff --git a/home/configs/starship-symbols.nix b/home/starship-symbols.nix similarity index 100% rename from home/configs/starship-symbols.nix rename to home/starship-symbols.nix diff --git a/modules/darwin/primary-user.nix b/modules/darwin/primary-user.nix deleted file mode 100644 index 9ff8ff3..0000000 --- a/modules/darwin/primary-user.nix +++ /dev/null @@ -1,26 +0,0 @@ -{ lib, ... }: - -let - inherit (lib) mkOption types; -in - -{ - options.users.primaryUser = { - username = mkOption { - type = with types; nullOr string; - default = null; - }; - fullName = mkOption { - type = with types; nullOr string; - default = null; - }; - email = mkOption { - type = with types; nullOr string; - default = null; - }; - nixConfigDirectory = mkOption { - type = with types; nullOr string; - default = null; - }; - }; -} diff --git a/modules/mk-primary-user-module.nix b/modules/mk-primary-user-module.nix new file mode 100644 index 0000000..ef60518 --- /dev/null +++ b/modules/mk-primary-user-module.nix @@ -0,0 +1,25 @@ +optionName: { config, lib, pkgs, ... }: + +let + inherit (lib) mkOption types; + inherit (pkgs.stdenv) isDarwin; + cfg = config.${optionName}.primaryUser; +in + +{ + options.${optionName}.primaryUser = { + username = mkOption { type = types.str; }; + fullName = mkOption { type = types.str; }; + email = mkOption { type = types.str; }; + homeDirectory = mkOption { + type = types.str; + default = + let prefix = if isDarwin then "/Users" else "/home"; + in "${prefix}/${cfg.username}"; + }; + nixConfigDirectory = mkOption { + type = types.str; + default = "${cfg.homeDirectory}/dotfiles.nix"; + }; + }; +} diff --git a/pkgs/dark-mode-notify.nix b/pkgs/dark-mode-notify.nix index ad2bdb7..dcceee5 100644 --- a/pkgs/dark-mode-notify.nix +++ b/pkgs/dark-mode-notify.nix @@ -2,7 +2,7 @@ , lib , xcodeenv , dark-mode-notify-src -, sdkVersion ? "13.4.1" +, sdkVersion , ... }: let diff --git a/pkgs/default.nix b/pkgs/default.nix new file mode 100644 index 0000000..d54ffe8 --- /dev/null +++ b/pkgs/default.nix @@ -0,0 +1,22 @@ +{ inputs }: +_: prev: { + inherit (inputs) kitty-icon kitty-themes; + helix = inputs.helix.packages.${prev.stdenv.system}.default; + fishPlugins = prev.fishPlugins // { + fisher = { + name = "fisher"; + src = inputs.fisher-src; + }; + }; +} // builtins.mapAttrs + (name: extras: + prev.callPackage + (./. + "/${name}.nix") + ({ "${name}-src" = inputs."${name}-src"; } // extras)) + { + dark-mode-notify = { + sdkVersion = "14.2"; + }; + ia-writer-family = { }; + yubiswitch = { }; + } diff --git a/pkgs/flake.lock b/pkgs/flake.lock deleted file mode 100644 index 906f114..0000000 --- a/pkgs/flake.lock +++ /dev/null @@ -1,291 +0,0 @@ -{ - "nodes": { - "crane": { - "flake": false, - "locked": { - "lastModified": 1661875961, - "narHash": "sha256-f1h/2c6Teeu1ofAHWzrS8TwBPcnN+EEu+z1sRVmMQTk=", - "owner": "ipetkov", - "repo": "crane", - "rev": "d9f394e4e20e97c2a60c3ad82c2b6ef99be19e24", - "type": "github" - }, - "original": { - "owner": "ipetkov", - "repo": "crane", - "type": "github" - } - }, - "dark-mode-notify-src": { - "flake": false, - "locked": { - "lastModified": 1658150829, - "narHash": "sha256-LsAQ5v5jgJw7KsJnQ3Mh6+LNj1EMHICMoD5WzF3hRmU=", - "owner": "bouk", - "repo": "dark-mode-notify", - "rev": "4d7fe211f81c5b67402fad4bed44995344a260d1", - "type": "github" - }, - "original": { - "owner": "bouk", - "repo": "dark-mode-notify", - "type": "github" - } - }, - "devshell": { - "flake": false, - "locked": { - "lastModified": 1667210711, - "narHash": "sha256-IoErjXZAkzYWHEpQqwu/DeRNJGFdR7X2OGbkhMqMrpw=", - "owner": "numtide", - "repo": "devshell", - "rev": "96a9dd12b8a447840cc246e17a47b81a4268bba7", - "type": "github" - }, - "original": { - "owner": "numtide", - "repo": "devshell", - "type": "github" - } - }, - "dream2nix": { - "inputs": { - "alejandra": [ - "helix", - "nci" - ], - "all-cabal-json": [ - "helix", - "nci" - ], - "crane": "crane", - "devshell": [ - "helix", - "nci", - "devshell" - ], - "flake-utils-pre-commit": [ - "helix", - "nci" - ], - "ghc-utils": [ - "helix", - "nci" - ], - "gomod2nix": [ - "helix", - "nci" - ], - "mach-nix": [ - "helix", - "nci" - ], - "nixpkgs": [ - "helix", - "nci", - "nixpkgs" - ], - "poetry2nix": [ - "helix", - "nci" - ], - "pre-commit-hooks": [ - "helix", - "nci" - ] - }, - "locked": { - "lastModified": 1668851003, - "narHash": "sha256-X7RCQQynbxStZR2m7HW38r/msMQwVl3afD6UXOCtvx4=", - "owner": "nix-community", - "repo": "dream2nix", - "rev": "c77e8379d8fe01213ba072e40946cbfb7b58e628", - "type": "github" - }, - "original": { - "owner": "nix-community", - "repo": "dream2nix", - "type": "github" - } - }, - "fisher-src": { - "flake": false, - "locked": { - "lastModified": 1665682222, - "narHash": "sha256-q9Yi6ZlHNFnPN05RpO+u4B5wNR1O3JGIn2AJ3AEl4xs=", - "owner": "jorgebucaran", - "repo": "fisher", - "rev": "36810b39401536650d7a1018c8f3832f51741950", - "type": "github" - }, - "original": { - "owner": "jorgebucaran", - "repo": "fisher", - "type": "github" - } - }, - "flake-utils": { - "locked": { - "lastModified": 1659877975, - "narHash": "sha256-zllb8aq3YO3h8B/U0/J1WBgAL8EX5yWf5pMj3G0NAmc=", - "owner": "numtide", - "repo": "flake-utils", - "rev": "c0e246b9b83f637f4681389ecabcb2681b4f3af0", - "type": "github" - }, - "original": { - "owner": "numtide", - "repo": "flake-utils", - "type": "github" - } - }, - "helix": { - "inputs": { - "nci": "nci", - "nixpkgs": [ - "nixpkgs" - ], - "rust-overlay": "rust-overlay" - }, - "locked": { - "lastModified": 1671307145, - "narHash": "sha256-1kRwUoJHLaTs8Y1nH7L3B2ecfcLoXzPMC5rTvL4FEns=", - "owner": "helix-editor", - "repo": "helix", - "rev": "ba3c24aa0268735ac57321442d458ab6a1ac662c", - "type": "github" - }, - "original": { - "owner": "helix-editor", - "repo": "helix", - "type": "github" - } - }, - "ia-writer-family-src": { - "flake": false, - "locked": { - "lastModified": 1663752357, - "narHash": "sha256-sgYsOn6iXE9f0hlDZX1uA3WnTAY1zc5/U9JOcjn5uGw=", - "owner": "iaolo", - "repo": "iA-Fonts", - "rev": "8548eea983611993db2d6f65bd3ae1609f62dcbd", - "type": "github" - }, - "original": { - "owner": "iaolo", - "repo": "iA-Fonts", - "type": "github" - } - }, - "kitty-icon": { - "flake": false, - "locked": { - "lastModified": 1659349637, - "narHash": "sha256-Vy+iLGnysrJMSLfkaYq15pb/wG4kIbfsXRrPgSc3OFs=", - "owner": "DinkDonk", - "repo": "kitty-icon", - "rev": "269c0f0bd1c792cebc7821f299ce9250ed9bcd67", - "type": "github" - }, - "original": { - "owner": "DinkDonk", - "repo": "kitty-icon", - "type": "github" - } - }, - "kitty-themes": { - "flake": false, - "locked": { - "lastModified": 1669518372, - "narHash": "sha256-PGV/iPg7nFW8RMEMJbt1oGcAzTaS3u6I+sCpIDrx7ic=", - "owner": "kovidgoyal", - "repo": "kitty-themes", - "rev": "4d309e984b81dd120d7a697abe4f817da6f3cfe5", - "type": "github" - }, - "original": { - "owner": "kovidgoyal", - "repo": "kitty-themes", - "type": "github" - } - }, - "nci": { - "inputs": { - "devshell": "devshell", - "dream2nix": "dream2nix", - "nixpkgs": [ - "helix", - "nixpkgs" - ], - "rust-overlay": [ - "helix", - "rust-overlay" - ] - }, - "locked": { - "lastModified": 1669011203, - "narHash": "sha256-Lymj4HktNEFmVXtwI0Os7srDXHZbZW0Nzw3/+5Hf8ko=", - "owner": "yusdacra", - "repo": "nix-cargo-integration", - "rev": "c5133b91fc1d549087c91228bd213f2518728a4b", - "type": "github" - }, - "original": { - "owner": "yusdacra", - "repo": "nix-cargo-integration", - "type": "github" - } - }, - "nixpkgs": { - "locked": { - "lastModified": 1671387159, - "narHash": "sha256-o4uayLVZZo8eorRSxB4VnGU0pNZqXHOP2U+oKocbuX8=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "9622fb43338ca1b77962d3be8731bbae069e7e72", - "type": "github" - }, - "original": { - "owner": "NixOS", - "ref": "nixpkgs-unstable", - "repo": "nixpkgs", - "type": "github" - } - }, - "root": { - "inputs": { - "dark-mode-notify-src": "dark-mode-notify-src", - "fisher-src": "fisher-src", - "helix": "helix", - "ia-writer-family-src": "ia-writer-family-src", - "kitty-icon": "kitty-icon", - "kitty-themes": "kitty-themes", - "nixpkgs": "nixpkgs" - } - }, - "rust-overlay": { - "inputs": { - "flake-utils": "flake-utils", - "nixpkgs": [ - "helix", - "nixpkgs" - ] - }, - "locked": { - "lastModified": 1668998422, - "narHash": "sha256-G/BklIplCHZEeDIabaaxqgITdIXtMolRGlwxn9jG2/Q=", - "owner": "oxalica", - "repo": "rust-overlay", - "rev": "68ab029c93f8f8eed4cf3ce9a89a9fd4504b2d6e", - "type": "github" - }, - "original": { - "owner": "oxalica", - "repo": "rust-overlay", - "type": "github" - } - } - }, - "root": "root", - "version": 7 -} diff --git a/pkgs/flake.nix b/pkgs/flake.nix deleted file mode 100644 index 1d0f7bf..0000000 --- a/pkgs/flake.nix +++ /dev/null @@ -1,52 +0,0 @@ -{ - description = "mat's extra nix pkgs"; - - inputs = { - nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable"; - - helix.url = "github:helix-editor/helix"; - helix.inputs.nixpkgs.follows = "nixpkgs"; - dark-mode-notify-src.url = "github:bouk/dark-mode-notify"; - dark-mode-notify-src.flake = false; - ia-writer-family-src.url = "github:iaolo/iA-Fonts"; - ia-writer-family-src.flake = false; - kitty-icon.url = "github:DinkDonk/kitty-icon"; - kitty-icon.flake = false; - kitty-themes.url = "github:kovidgoyal/kitty-themes"; - kitty-themes.flake = false; - fisher-src.url = "github:jorgebucaran/fisher"; - fisher-src.flake = false; - }; - - outputs = - { fisher-src, helix, kitty-icon, kitty-themes, ... }@inputs: { - overlays = - let - overlay = _: prev: - let - mkPkg = name: extras: prev.callPackage (./. + name + ".nix") - { - "${name}-src" = inputs."${name}-src"; - } // extras; - in - { - inherit kitty-icon kitty-themes; - helix = helix.packages.${prev.system}.default; - fishPlugins.fisher = { - name = "fisher"; - src = fisher-src; - }; - } // prev.mapAttrs mkPkg { - dark-mode-notify = { - sdkVersion = "14.1"; - }; - ia-writer-family = { }; - yubiswitch = { }; - }; - in - { - default = overlay; - extra-pkgs = overlay; - }; - }; -}