Compare commits

..

No commits in common. "813efc75beff8e83268c5ff702e6a0fa17786d9e" and "a4082f54c0523cade498a253de40eb740064e0dc" have entirely different histories.

13 changed files with 235 additions and 198 deletions

View File

@ -20,6 +20,10 @@ main entry point and glue for submodules
compatibility for legacy nix tooling, eg `nix-build` compatibility for legacy nix tooling, eg `nix-build`
### nixpkgs.nix
used to hack compatibility for `<nixpkgs>` in nix expressions
### configs ### configs
non-nix configurations non-nix configurations
@ -40,7 +44,7 @@ full featured macOS system
homebrew + mac app store apps homebrew + mac app store apps
#### defaults.nix #### macos-defaults.nix
macOS system settings macOS system settings
@ -82,4 +86,4 @@ pure nix colorscheme palettes
### pkgs ### pkgs
custom-built nix packages in a sub-flake custom-built nix packages

View File

@ -41,7 +41,6 @@
# If an app isn't available in the Mac App Store, or the version in the App Store has # 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. # limitiations, e.g., Transmit, install the Homebrew Cask.
homebrew.caskArgs.no_quarantine = true;
homebrew.casks = [ homebrew.casks = [
"aerial" "aerial"
"alfred" "alfred"
@ -49,7 +48,6 @@
"bbedit" "bbedit"
# "discord" # "discord"
# "element" # "element"
"ferdium"
"firefox" "firefox"
"jitsi-meet" "jitsi-meet"
"knockknock" "knockknock"

View File

@ -3,11 +3,11 @@
"crane": { "crane": {
"flake": false, "flake": false,
"locked": { "locked": {
"lastModified": 1670900067, "lastModified": 1661875961,
"narHash": "sha256-VXVa+KBfukhmWizaiGiHRVX/fuk66P8dgSFfkVN4/MY=", "narHash": "sha256-f1h/2c6Teeu1ofAHWzrS8TwBPcnN+EEu+z1sRVmMQTk=",
"owner": "ipetkov", "owner": "ipetkov",
"repo": "crane", "repo": "crane",
"rev": "59b31b41a589c0a65e4a1f86b0e5eac68081468b", "rev": "d9f394e4e20e97c2a60c3ad82c2b6ef99be19e24",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -35,7 +35,7 @@
"darwin": { "darwin": {
"inputs": { "inputs": {
"nixpkgs": [ "nixpkgs": [
"nixpkgs" "nixpkgs-unstable"
] ]
}, },
"locked": { "locked": {
@ -85,7 +85,6 @@
"nci", "nci",
"devshell" "devshell"
], ],
"flake-parts": "flake-parts",
"flake-utils-pre-commit": [ "flake-utils-pre-commit": [
"helix", "helix",
"nci" "nci"
@ -102,10 +101,6 @@
"helix", "helix",
"nci" "nci"
], ],
"nix-pypi-fetcher": [
"helix",
"nci"
],
"nixpkgs": [ "nixpkgs": [
"helix", "helix",
"nci", "nci",
@ -121,11 +116,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1671323629, "lastModified": 1668851003,
"narHash": "sha256-9KHTPjIDjfnzZ4NjpE3gGIVHVHopy6weRDYO/7Y3hF8=", "narHash": "sha256-X7RCQQynbxStZR2m7HW38r/msMQwVl3afD6UXOCtvx4=",
"owner": "nix-community", "owner": "nix-community",
"repo": "dream2nix", "repo": "dream2nix",
"rev": "2d7d68505c8619410df2c6b6463985f97cbcba6e", "rev": "c77e8379d8fe01213ba072e40946cbfb7b58e628",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -166,21 +161,19 @@
"type": "github" "type": "github"
} }
}, },
"flake-parts": { "flake-compat_2": {
"inputs": { "flake": false,
"nixpkgs-lib": "nixpkgs-lib"
},
"locked": { "locked": {
"lastModified": 1668450977, "lastModified": 1668681692,
"narHash": "sha256-cfLhMhnvXn6x1vPm+Jow3RiFAUSCw/l1utktCw5rVA4=", "narHash": "sha256-Ht91NGdewz8IQLtWZ9LCeNXMSXHUss+9COoqu6JLmXU=",
"owner": "hercules-ci", "owner": "edolstra",
"repo": "flake-parts", "repo": "flake-compat",
"rev": "d591857e9d7dd9ddbfba0ea02b43b927c3c0f1fa", "rev": "009399224d5e398d03b22badca40a37ac85412a1",
"type": "github" "type": "github"
}, },
"original": { "original": {
"owner": "hercules-ci", "owner": "edolstra",
"repo": "flake-parts", "repo": "flake-compat",
"type": "github" "type": "github"
} }
}, },
@ -239,16 +232,16 @@
"inputs": { "inputs": {
"nci": "nci", "nci": "nci",
"nixpkgs": [ "nixpkgs": [
"nixpkgs" "nixpkgs-unstable"
], ],
"rust-overlay": "rust-overlay" "rust-overlay": "rust-overlay"
}, },
"locked": { "locked": {
"lastModified": 1671493763, "lastModified": 1670782450,
"narHash": "sha256-xw8cemaLh9Nda9usE0z3sxeiDUuXZ1zDiO6md3i7XLg=", "narHash": "sha256-0RCWIN9+NnreCg2c36pLbjcVenVPfUfnzRnYDs7P/zk=",
"owner": "helix-editor", "owner": "helix-editor",
"repo": "helix", "repo": "helix",
"rev": "bdeefbfb23077fcbbfe1e7df6c6ac88516244bbc", "rev": "c5bfb792b2a26545f6515a1e7b62d4f37b10841e",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -260,7 +253,7 @@
"home-manager": { "home-manager": {
"inputs": { "inputs": {
"nixpkgs": [ "nixpkgs": [
"nixpkgs" "nixpkgs-unstable"
], ],
"utils": [ "utils": [
"flake-utils" "flake-utils"
@ -280,6 +273,27 @@
"type": "github" "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": { "homebrew-enabled": {
"locked": { "locked": {
"lastModified": 1657739253, "lastModified": 1657739253,
@ -357,11 +371,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1671430291, "lastModified": 1669011203,
"narHash": "sha256-UIc7H8F3N8rK72J/Vj5YJdV72tvDvYjH+UPsOFvlcsE=", "narHash": "sha256-Lymj4HktNEFmVXtwI0Os7srDXHZbZW0Nzw3/+5Hf8ko=",
"owner": "yusdacra", "owner": "yusdacra",
"repo": "nix-cargo-integration", "repo": "nix-cargo-integration",
"rev": "b1b0d38b8c3b0d0e6a38638d5bbe10b0bc67522c", "rev": "c5133b91fc1d549087c91228bd213f2518728a4b",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -372,34 +386,16 @@
}, },
"nixpkgs": { "nixpkgs": {
"locked": { "locked": {
"lastModified": 1671268780, "lastModified": 1659446231,
"narHash": "sha256-9Okbivo10bcXEGCtmAQNfJt1Zpk6B3tjkSQ2CIXmTCg=", "narHash": "sha256-hekabNdTdgR/iLsgce5TGWmfIDZ86qjPhxDg/8TlzhE=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "80c24eeb9ff46aa99617844d0c4168659e35175f", "rev": "eabc38219184cc3e04a974fe31857d8e0eac098d",
"type": "github" "type": "github"
}, },
"original": { "original": {
"owner": "NixOS", "owner": "NixOS",
"ref": "nixpkgs-unstable", "ref": "nixpkgs-21.11-darwin",
"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", "repo": "nixpkgs",
"type": "github" "type": "github"
} }
@ -421,22 +417,6 @@
} }
}, },
"nixpkgs-stable": { "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": { "locked": {
"lastModified": 1668984258, "lastModified": 1668984258,
"narHash": "sha256-0gDMJ2T3qf58xgcSbYoXiRGUkPWmKyr5C3vcathWhKs=", "narHash": "sha256-0gDMJ2T3qf58xgcSbYoXiRGUkPWmKyr5C3vcathWhKs=",
@ -452,6 +432,22 @@
"type": "github" "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": { "nixpkgs_2": {
"locked": { "locked": {
"lastModified": 1668994630, "lastModified": 1668994630,
@ -470,13 +466,13 @@
}, },
"pre-commit": { "pre-commit": {
"inputs": { "inputs": {
"flake-compat": "flake-compat", "flake-compat": "flake-compat_2",
"flake-utils": [ "flake-utils": [
"flake-utils" "flake-utils"
], ],
"gitignore": "gitignore", "gitignore": "gitignore",
"nixpkgs": "nixpkgs_2", "nixpkgs": "nixpkgs_2",
"nixpkgs-stable": "nixpkgs-stable_2" "nixpkgs-stable": "nixpkgs-stable"
}, },
"locked": { "locked": {
"lastModified": 1670413394, "lastModified": 1670413394,
@ -497,16 +493,18 @@
"dark-mode-notify-src": "dark-mode-notify-src", "dark-mode-notify-src": "dark-mode-notify-src",
"darwin": "darwin", "darwin": "darwin",
"fisher-src": "fisher-src", "fisher-src": "fisher-src",
"flake-compat": "flake-compat",
"flake-utils": "flake-utils", "flake-utils": "flake-utils",
"helix": "helix", "helix": "helix",
"home-manager": "home-manager", "home-manager": "home-manager",
"home-manager-atemu": "home-manager-atemu",
"homebrew-enabled": "homebrew-enabled", "homebrew-enabled": "homebrew-enabled",
"ia-writer-family-src": "ia-writer-family-src", "ia-writer-family-src": "ia-writer-family-src",
"kitty-icon": "kitty-icon", "kitty-icon": "kitty-icon",
"kitty-themes": "kitty-themes", "kitty-themes": "kitty-themes",
"nixpkgs": "nixpkgs", "nixpkgs": "nixpkgs",
"nixpkgs-master": "nixpkgs-master", "nixpkgs-master": "nixpkgs-master",
"nixpkgs-stable": "nixpkgs-stable", "nixpkgs-unstable": "nixpkgs-unstable",
"pre-commit": "pre-commit" "pre-commit": "pre-commit"
} }
}, },
@ -519,11 +517,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1671416426, "lastModified": 1668998422,
"narHash": "sha256-kpSH1Jrxfk2qd0pRPJn1eQdIOseGv5JuE+YaOrqU9s4=", "narHash": "sha256-G/BklIplCHZEeDIabaaxqgITdIXtMolRGlwxn9jG2/Q=",
"owner": "oxalica", "owner": "oxalica",
"repo": "rust-overlay", "repo": "rust-overlay",
"rev": "fbaaff24f375ac25ec64268b0a0d63f91e474b7d", "rev": "68ab029c93f8f8eed4cf3ce9a89a9fd4504b2d6e",
"type": "github" "type": "github"
}, },
"original": { "original": {

123
flake.nix
View File

@ -3,30 +3,36 @@
inputs = { inputs = {
# Package sets # Package sets
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable"; nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-21.11-darwin";
nixpkgs-stable.url = "github:NixOS/nixpkgs/nixpkgs-21.11-darwin"; nixpkgs-unstable.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
nixpkgs-master.url = "github:NixOS/nixpkgs/master"; nixpkgs-master.url = "github:NixOS/nixpkgs/master";
# Flake helpers # Flake helpers
flake-utils.url = "github:numtide/flake-utils"; flake-utils.url = "github:numtide/flake-utils";
flake-compat.url = "github:edolstra/flake-compat";
flake-compat.flake = false;
# Environment/system management # Environment/system management
darwin.url = "github:lnl7/nix-darwin/master"; darwin.url = "github:lnl7/nix-darwin/master";
darwin.inputs.nixpkgs.follows = "nixpkgs"; darwin.inputs.nixpkgs.follows = "nixpkgs-unstable";
home-manager.url = "github:nix-community/home-manager"; home-manager.url = "github:nix-community/home-manager";
home-manager.inputs.nixpkgs.follows = "nixpkgs"; home-manager.inputs.nixpkgs.follows = "nixpkgs-unstable";
home-manager.inputs.utils.follows = "flake-utils"; home-manager.inputs.utils.follows = "flake-utils";
# Config "flag" for disabling homebrew # Config "flag" for disabling homebrew
homebrew-enabled.url = "github:boolean-option/true"; 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 and hooks
pre-commit.url = "github:cachix/pre-commit-hooks.nix"; pre-commit.url = "github:cachix/pre-commit-hooks.nix";
pre-commit.inputs.flake-utils.follows = "flake-utils"; pre-commit.inputs.flake-utils.follows = "flake-utils";
# Extra sources # Extra sources
helix.url = "github:helix-editor/helix"; helix.url = "github:helix-editor/helix";
helix.inputs.nixpkgs.follows = "nixpkgs"; helix.inputs.nixpkgs.follows = "nixpkgs-unstable";
dark-mode-notify-src.url = "github:bouk/dark-mode-notify"; dark-mode-notify-src.url = "github:bouk/dark-mode-notify";
dark-mode-notify-src.flake = false; dark-mode-notify-src.flake = false;
ia-writer-family-src.url = "github:iaolo/iA-Fonts"; ia-writer-family-src.url = "github:iaolo/iA-Fonts";
@ -39,21 +45,11 @@
fisher-src.flake = false; fisher-src.flake = false;
}; };
outputs = outputs = { self, darwin, home-manager, flake-utils, pre-commit, ... }@inputs:
{ self
, home-manager
, flake-utils
, pre-commit
, ...
}@inputs:
let 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 (inputs.darwin.lib) darwinSystem; inherit (darwin.lib) darwinSystem;
inherit (inputs.nixpkgs.lib) inherit (inputs.nixpkgs-unstable.lib)
attrValues attrValues
makeOverridable makeOverridable
optionalAttrs; optionalAttrs;
@ -62,7 +58,17 @@
nixpkgsConfig = { nixpkgsConfig = {
config = { allowUnfree = true; }; config = { allowUnfree = true; };
overlays = attrValues self.overlays ++ [ overlays = attrValues self.overlays ++ [
(import ./pkgs { inherit inputs; }) (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);
})
]; ];
}; };
@ -72,12 +78,14 @@
username = "mat"; username = "mat";
fullName = "mat ess"; fullName = "mat ess";
email = "mat@mat.services"; email = "mat@mat.services";
nixConfigDirectory = "/Users/mat/dotfiles.nix";
}; };
workUserInfo = { workUserInfo = {
username = "mess"; username = "mess";
fullName = "Matthew Ess"; fullName = "Matthew Ess";
email = "mess@yelp.com"; email = "mess@yelp.com";
nixConfigDirectory = "/Users/mess/dotfiles.nix";
}; };
# Modules shared by most `nix-darwin` personal configurations. # Modules shared by most `nix-darwin` personal configurations.
@ -93,17 +101,16 @@
nixpkgs = nixpkgsConfig; nixpkgs = nixpkgsConfig;
# Hack to support legacy worklows that use `<nixpkgs>`, darwin-option, etc. # Hack to support legacy worklows that use `<nixpkgs>`, darwin-option, etc.
nix.nixPath = { nix.nixPath = {
nixpkgs = "${inputs.nixpkgs}"; nixpkgs = "${inputs.nixpkgs-unstable}";
darwin = "${inputs.darwin}"; darwin = "${inputs.darwin}";
}; };
# `home-manager` config # `home-manager` config
users.users.${primaryUser.username}.home = primaryUser.homeDirectory; users.users.${primaryUser.username}.home = "/Users/${primaryUser.username}";
home-manager.useGlobalPkgs = true; home-manager.useGlobalPkgs = true;
home-manager.users.${primaryUser.username} = { home-manager.users.${primaryUser.username} = {
imports = attrValues self.homeManagerModules; imports = attrValues self.homeManagerModules;
home.stateVersion = homeManagerStateVersion; home.stateVersion = homeManagerStateVersion;
home.primaryUser = primaryUser; home.primaryUser = primaryUser;
home.homeDirectory = primaryUser.homeDirectory;
home.enableNixpkgsReleaseCheck = true; home.enableNixpkgsReleaseCheck = true;
}; };
# Add a registry entry for this flake # Add a registry entry for this flake
@ -190,25 +197,46 @@
}; };
# Build and activate on new system with:
# `nix build .#homeConfigurations.<name>.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 --------------------------------------------------------------- {{{
overlays = { overlays = {
# nixpkgs overlays # nixpkgs overlays
pkgs-stable = _: prev: { pkgs-stable = _final: prev: {
pkgs-stable = import inputs.nixpkgs-stable { pkgs-stable = import inputs.nixpkgs {
inherit (prev.stdenv) system; inherit (prev.stdenv) system;
inherit (nixpkgsConfig) config; inherit (nixpkgsConfig) config;
}; };
}; };
pkgs-unstable = _: prev: { pkgs-unstable = _final: prev: {
pkgs-unstable = import inputs.nixpkgs { pkgs-unstable = import inputs.nixpkgs-unstable {
inherit (prev.stdenv) system; inherit (prev.stdenv) system;
inherit (nixpkgsConfig) config; inherit (nixpkgsConfig) config;
}; };
}; };
pkgs-master = _: prev: { pkgs-master = _final: prev: {
pkgs-master = import inputs.nixpkgs-master { pkgs-master = import inputs.nixpkgs-master {
inherit (prev.stdenv) system; inherit (prev.stdenv) system;
inherit (nixpkgsConfig) config; inherit (nixpkgsConfig) config;
@ -218,15 +246,16 @@
colors = import ./overlays/colors.nix; colors = import ./overlays/colors.nix;
# Overlay useful on Macs with Apple Silicon # Overlay useful on Macs with Apple Silicon
apple-silicon = _: prev: optionalAttrs (prev.stdenv.system == "aarch64-darwin") { apple-silicon = _final: prev: optionalAttrs (prev.stdenv.system == "aarch64-darwin") {
# Add access to x86 packages system is running Apple Silicon # Add access to x86 packages system is running Apple Silicon
pkgs-x86 = import inputs.nixpkgs { pkgs-x86 = import inputs.nixpkgs-unstable {
system = "x86_64-darwin"; system = "x86_64-darwin";
inherit (nixpkgsConfig) config; inherit (nixpkgsConfig) config;
}; };
}; };
homebrew-enabled = _: prev: optionalAttrs prev.stdenv.isDarwin { patched = _final: prev: optionalAttrs prev.stdenv.isDarwin {
inherit (inputs) kitty-icon kitty-themes fisher-src;
lib = prev.lib // { homebrew-enabled = inputs.homebrew-enabled.value; }; lib = prev.lib // { homebrew-enabled = inputs.homebrew-enabled.value; };
}; };
}; };
@ -239,11 +268,13 @@
general = import ./darwin/general.nix; general = import ./darwin/general.nix;
homebrew = import ./darwin/homebrew.nix; homebrew = import ./darwin/homebrew.nix;
# modules # modules
darwin-primary-user = mkPrimaryUserModule "users"; primary-user = import ./modules/darwin/primary-user.nix;
}; };
# home manager configurations # home manager configurations
homeManagerModules = { homeManagerModules = {
# configs
configs-starship-symbols = import ./home/configs/starship-symbols.nix;
# services # services
dark-mode-notify-service = import ./home/services/dark-mode-notify.nix; dark-mode-notify-service = import ./home/services/dark-mode-notify.nix;
tarsnap-service = import ./home/services/tarsnap.nix; tarsnap-service = import ./home/services/tarsnap.nix;
@ -255,12 +286,21 @@
kitty = import ./home/kitty.nix; kitty = import ./home/kitty.nix;
programs = import ./home/programs.nix; programs = import ./home/programs.nix;
starship = import ./home/starship.nix; starship = import ./home/starship.nix;
starship-symbols = import ./home/starship-symbols.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;
};
# modules # modules
programs-kakoune-extras = import ./modules/home/programs/kakoune/extras.nix; # currently unused programs-kakoune-extras = import ./modules/home/programs/kakoune/extras.nix; # currently unused
programs-helix-extras = import ./modules/home/programs/helix/extras.nix; programs-helix-extras = import ./modules/home/programs/helix/extras.nix;
programs-kitty-extras = import ./modules/home/programs/kitty/extras.nix; programs-kitty-extras = import ./modules/home/programs/kitty/extras.nix;
home-primary-user = mkPrimaryUserModule "home"; home-primary-user = { lib, ... }: {
options.home.primaryUser =
(self.darwinModules.primary-user { inherit lib; }).options.users.primaryUser;
};
}; };
templates = { templates = {
@ -277,7 +317,17 @@
} // flake-utils.lib.eachDefaultSystem (system: } // flake-utils.lib.eachDefaultSystem (system:
let let
pkgs = import inputs.nixpkgs (nixpkgsConfig // { inherit system; }); pkgs = import inputs.nixpkgs-unstable {
inherit system;
inherit (nixpkgsConfig) config;
overlays = with self.overlays; [
pkgs-master
pkgs-stable
colors
apple-silicon
patched
];
};
in in
{ {
legacyPackages = pkgs; legacyPackages = pkgs;
@ -292,11 +342,8 @@
}; };
}; };
devShells = { devShells.default = pkgs.mkShell {
default = pkgs.mkShell {
inherit (self.checks.${system}.pre-commit) shellHook; inherit (self.checks.${system}.pre-commit) shellHook;
}; };
# TODO: add utility devShells here
};
}); });
} }

View File

@ -6,21 +6,25 @@
programs.fish.enable = true; programs.fish.enable = true;
# Add Fish plugins # Add Fish plugins
home.packages = builtins.attrValues { home.packages = with pkgs.fishPlugins; [ done ];
inherit (pkgs.fishPlugins)
autopair-fish programs.fish.plugins = [
colored-man-pages {
done; name = "fisher";
}; src = pkgs.fisher-src;
programs.fish.plugins = [ pkgs.fishPlugins.fisher ]; }
];
xdg.configFile."fish/fish_plugins".text = '' xdg.configFile."fish/fish_plugins".text = ''
jorgebucaran/autopair.fish
jorgebucaran/replay.fish jorgebucaran/replay.fish
jorgebucaran/getopts.fish
americanhanko/fish-spin americanhanko/fish-spin
joseluisq/gitnow joseluisq/gitnow
fishpkg/fish-humanize-duration fishpkg/fish-humanize-duration
oh-my-fish/plugin-bang-bang oh-my-fish/plugin-bang-bang
matthewess/fish-autovenv matthewess/fish-autovenv
jethrokuan/z
Gazorby/fish-abbreviation-tips Gazorby/fish-abbreviation-tips
''; '';
@ -138,9 +142,8 @@
programs.fish.shellAliases = programs.fish.shellAliases =
let let
inherit (config.home.primaryUser) nixConfigDirectory; inherit (config.home.primaryUser) nixConfigDirectory;
inherit (pkgs) bat bottom du-dust exa gitAndTools stdenv xh;
in in
{ with pkgs; {
# Nix related # Nix related
from-nix = "from-dir ${nixConfigDirectory}"; from-nix = "from-dir ${nixConfigDirectory}";
# darwin-rebuild build # darwin-rebuild build

View File

@ -1,4 +1,4 @@
{ config, ... }: { config, pkgs, ... }:
{ {
# Git # Git
@ -14,14 +14,15 @@
diff.colorMoved = "default"; diff.colorMoved = "default";
pull.rebase = true; pull.rebase = true;
init.defaultBranch = "main"; init.defaultBranch = "main";
help.autocorrect = "prompt";
}; };
programs.git.ignores = [ programs.git.ignores = [
".DS_Store" ".DS_Store"
".direnv"
]; ];
# Enhanced diffs # Enhanced diffs
programs.git.delta.enable = true; programs.git.delta.enable = true;
# Gitea CLI
home.packages = [ pkgs.tea ];
} }

View File

@ -1,11 +1,13 @@
{ pkgs, ... }:
{ {
programs.helix.enable = true; programs.helix.enable = true;
programs.helix.package = pkgs.helix-flake;
programs.helix.settings = { programs.helix.settings = {
editor.bufferline = "multiple"; editor.bufferline = "multiple";
editor.color-modes = true; editor.color-modes = true;
editor.cursor-shape.insert = "bar";
editor.cursorline = true;
editor.indent-guides.render = true; editor.indent-guides.render = true;
editor.indent-guides.skip-levels = 1; editor.indent-guides.skip-levels = 1;
editor.line-number = "relative"; editor.line-number = "relative";

View File

@ -41,10 +41,6 @@ in
enable = true; enable = true;
# extensions = [ pijul-vscode ]; # extensions = [ pijul-vscode ];
}; };
zoxide = {
enable = true;
enableFishIntegration = true;
};
}; };
# }}} # }}}
@ -63,8 +59,7 @@ in
abduco # lightweight session management abduco # lightweight session management
atool # archive tool atool # archive tool
bottom # fancy version of `top` with ASCII graphs bottom # fancy version of `top` with ASCII graphs
# do i need these? coreutils
# coreutils
curl curl
du-dust # fancy version of `du` du-dust # fancy version of `du`
exa # fancy version of `ls` exa # fancy version of `ls`

View File

@ -0,0 +1,26 @@
{ 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;
};
};
}

View File

@ -1,25 +0,0 @@
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";
};
};
}

View File

@ -2,7 +2,7 @@
, lib , lib
, xcodeenv , xcodeenv
, dark-mode-notify-src , dark-mode-notify-src
, sdkVersion , sdkVersion ? "13.4.1"
, ... , ...
}: }:
let let

View File

@ -1,22 +1,10 @@
{ inputs }: { callPackage, inputs, system }:
_: prev: { {
inherit (inputs) kitty-icon kitty-themes; dark-mode-notify = callPackage ./dark-mode-notify.nix {
helix = inputs.helix.packages.${prev.stdenv.system}.default; sdkVersion = "14.1";
fishPlugins = prev.fishPlugins // { inherit (inputs) dark-mode-notify-src;
fisher = {
name = "fisher";
src = inputs.fisher-src;
}; };
}; ia-writer-family = callPackage ./ia-writer-family.nix { inherit (inputs) ia-writer-family-src; };
} // builtins.mapAttrs helix-flake = inputs.helix.packages.${system}.default;
(name: extras: yubiswitch = callPackage ./yubiswitch.nix { };
prev.callPackage }
(./. + "/${name}.nix")
({ "${name}-src" = inputs."${name}-src"; } // extras))
{
dark-mode-notify = {
sdkVersion = "14.2";
};
ia-writer-family = { };
yubiswitch = { };
}