Update flakes, move some apps into home-manager

work
mat ess 2022-11-05 18:03:58 -04:00
parent d0dd3c5ef6
commit 978be501a3
10 changed files with 113 additions and 134 deletions

View File

@ -56,10 +56,6 @@ macOS system settings
simple configurations simple configurations
#### copyApplications.nix
hack to work around https://github.com/nix-community/home-manager/issues/1341
#### default.nix #### default.nix
main user environment configuration main user environment configuration

View File

@ -1,19 +1,7 @@
{ config, pkgs, lib, ... }: { config, pkgs, lib, ... }:
{ {
# Apps environment.systemPackages = [ pkgs.terminal-notifier ];
# `home-manager` currently has issues adding them to `~/Applications`
# Issue: https://github.com/nix-community/home-manager/issues/1341
# See workaround at ../home/copyApplications.nix
environment.systemPackages = with pkgs; [
kitty
terminal-notifier
];
# https://github.com/nix-community/home-manager/issues/423
environment.variables = {
TERMINFO_DIRS = [ "${pkgs.kitty.terminfo.outPath}/share/terminfo" ];
};
# Fonts # Fonts
fonts.fontDir.enable = true; fonts.fontDir.enable = true;

View File

@ -1,15 +1,4 @@
{ config, lib, pkgs, ... }: { config, pkgs, ... }: {
let
inherit (lib) mkIf;
caskIsPresent = cask: lib.any (x: x == cask) config.homebrew.casks;
mkIfCaskPresent = cask: mkIf (caskIsPresent cask);
brewEnabled = config.homebrew.enable;
in
{
# perma-enabling to prevent losing brew when we skip bundling
# environment.shellInit = mkIf brewEnabled ''
environment.shellInit = '' environment.shellInit = ''
eval "$(${config.homebrew.brewPrefix}/brew shellenv)" eval "$(${config.homebrew.brewPrefix}/brew shellenv)"
''; '';
@ -17,7 +6,6 @@ in
# https://docs.brew.sh/Shell-Completion#configuring-completions-in-fish # https://docs.brew.sh/Shell-Completion#configuring-completions-in-fish
# For some reason if the Fish completions are added at the end of `fish_complete_path` they don't # For some reason if the Fish completions are added at the end of `fish_complete_path` they don't
# seem to work, but they do work if added at the start. # seem to work, but they do work if added at the start.
# programs.fish.interactiveShellInit = mkIf brewEnabled ''
programs.fish.interactiveShellInit = '' programs.fish.interactiveShellInit = ''
if test -d (brew --prefix)"/share/fish/completions" if test -d (brew --prefix)"/share/fish/completions"
set -p fish_complete_path (brew --prefix)/share/fish/completions set -p fish_complete_path (brew --prefix)/share/fish/completions
@ -58,34 +46,30 @@ in
"aerial" "aerial"
"alfred" "alfred"
"bartender" "bartender"
"discord" # "discord"
"element" # "element"
"firefox" "firefox"
"jitsi-meet" "jitsi-meet"
"knockknock" "knockknock"
"lagrange" # "lagrange"
"logitech-options" "logitech-options"
"lulu" "lulu"
"macsvg" "macsvg"
"miniforge" "miniforge"
"mullvadvpn" "mullvadvpn"
"obsidian" # "obsidian"
"rectangle" "rectangle"
"secretive" "secretive"
"signal" "signal"
"slack" # "slack"
"stay" "stay"
"transmission" "transmission"
"utm" "utm"
"zoom" # "zoom"
]; ];
# Configuration related to casks
environment.variables.SSH_AUTH_SOCK = mkIfCaskPresent "secretive"
"${config.home.homeDirectory}/Library/Containers/com.maxgoedjen.Secretive.SecretAgent/Data/socket.ssh";
# For cli packages that aren't currently available for macOS in `nixpkgs`.Packages should be # For cli packages that aren't currently available for macOS in `nixpkgs`.Packages should be
# installed in `../home/default.nix` whenever possible. # installed in `../home/programs.nix` whenever possible.
homebrew.brews = [ homebrew.brews = [
"ffmpeg" "ffmpeg"
"fileicon" "fileicon"

View File

@ -1,5 +1,22 @@
{ {
"nodes": { "nodes": {
"all-cabal-json": {
"flake": false,
"locked": {
"lastModified": 1665552503,
"narHash": "sha256-r14RmRSwzv5c+bWKUDaze6pXM7nOsiz1H8nvFHJvufc=",
"owner": "nix-community",
"repo": "all-cabal-json",
"rev": "d7c0434eebffb305071404edcf9d5cd99703878e",
"type": "github"
},
"original": {
"owner": "nix-community",
"ref": "hackage",
"repo": "all-cabal-json",
"type": "github"
}
},
"crane": { "crane": {
"flake": false, "flake": false,
"locked": { "locked": {
@ -39,11 +56,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1663677921, "lastModified": 1667419884,
"narHash": "sha256-NfQnUfRrjv8DXeugdbQC5El+MMhShP42ohc8iM+UAdM=", "narHash": "sha256-oLNw87ZI5NxTMlNQBv1wG2N27CUzo9admaFlnmavpiY=",
"owner": "lnl7", "owner": "lnl7",
"repo": "nix-darwin", "repo": "nix-darwin",
"rev": "088c98a584a38b5f844bb9e9cd32eb28479ca6d7", "rev": "cfc0125eafadc9569d3d6a16ee928375b77e3100",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -56,11 +73,11 @@
"devshell": { "devshell": {
"flake": false, "flake": false,
"locked": { "locked": {
"lastModified": 1660811669, "lastModified": 1667210711,
"narHash": "sha256-V6lmsaLNFz41myppL0yxglta92ijkSvpZ+XVygAh+bU=", "narHash": "sha256-IoErjXZAkzYWHEpQqwu/DeRNJGFdR7X2OGbkhMqMrpw=",
"owner": "numtide", "owner": "numtide",
"repo": "devshell", "repo": "devshell",
"rev": "c2feacb46ee69949124c835419861143c4016fb5", "rev": "96a9dd12b8a447840cc246e17a47b81a4268bba7",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -76,6 +93,7 @@
"nci", "nci",
"nixpkgs" "nixpkgs"
], ],
"all-cabal-json": "all-cabal-json",
"crane": "crane", "crane": "crane",
"devshell": [ "devshell": [
"helix", "helix",
@ -87,6 +105,7 @@
"nci", "nci",
"nixpkgs" "nixpkgs"
], ],
"ghc-utils": "ghc-utils",
"gomod2nix": [ "gomod2nix": [
"helix", "helix",
"nci", "nci",
@ -114,11 +133,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1662176993, "lastModified": 1667429039,
"narHash": "sha256-Sy7DsGAveDUFBb6YDsUSYZd/AcXfP/MOMIwMt/NgY84=", "narHash": "sha256-Lu6da25JioHzerkLHAHSO9suCQFzJ/XBjkcGCIbasLM=",
"owner": "nix-community", "owner": "nix-community",
"repo": "dream2nix", "repo": "dream2nix",
"rev": "809bc5940214744eb29778a9a0b03f161979c1b2", "rev": "5252794e58eedb02d607fa3187ffead7becc81b0",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -160,6 +179,21 @@
} }
}, },
"flake-utils": { "flake-utils": {
"locked": {
"lastModified": 1667395993,
"narHash": "sha256-nuEHfE/LcWyuSWnS8t12N1wc105Qtau+/OdUAjtQ0rA=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "5aed5285a952e0b949eb3ba02c12fa4fcfef535f",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"flake-utils_2": {
"locked": { "locked": {
"lastModified": 1659877975, "lastModified": 1659877975,
"narHash": "sha256-zllb8aq3YO3h8B/U0/J1WBgAL8EX5yWf5pMj3G0NAmc=", "narHash": "sha256-zllb8aq3YO3h8B/U0/J1WBgAL8EX5yWf5pMj3G0NAmc=",
@ -174,19 +208,20 @@
"type": "github" "type": "github"
} }
}, },
"flake-utils_2": { "ghc-utils": {
"flake": false,
"locked": { "locked": {
"lastModified": 1656928814, "lastModified": 1662774800,
"narHash": "sha256-RIFfgBuKz6Hp89yRr7+NR5tzIAbn52h8vT6vXkYjZoM=", "narHash": "sha256-1Rd2eohGUw/s1tfvkepeYpg8kCEXiIot0RijapUjAkE=",
"owner": "numtide", "ref": "refs/heads/master",
"repo": "flake-utils", "rev": "bb3a2d3dc52ff0253fb9c2812bd7aa2da03e0fea",
"rev": "7e2a3b3dfd9af950a856d66b0a7d01e3c18aa249", "revCount": 1072,
"type": "github" "type": "git",
"url": "https://gitlab.haskell.org/bgamari/ghc-utils"
}, },
"original": { "original": {
"owner": "numtide", "type": "git",
"repo": "flake-utils", "url": "https://gitlab.haskell.org/bgamari/ghc-utils"
"type": "github"
} }
}, },
"helix": { "helix": {
@ -198,11 +233,11 @@
"rust-overlay": "rust-overlay" "rust-overlay": "rust-overlay"
}, },
"locked": { "locked": {
"lastModified": 1663860810, "lastModified": 1667577856,
"narHash": "sha256-NJubeVByiZz+0oU6f+OCaltxOZnUW4AGUipnj0RBYnk=", "narHash": "sha256-GJpJomXWkyne6zoS3JT1H81A2i4uDLZ/cyCPnjxKZaE=",
"owner": "helix-editor", "owner": "helix-editor",
"repo": "helix", "repo": "helix",
"rev": "eb6fd283dcf041ecf822fd8f2d4520abb2a26df9", "rev": "38149872989477f62222ce68dc32d2d6018ae165",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -216,14 +251,16 @@
"nixpkgs": [ "nixpkgs": [
"nixpkgs-unstable" "nixpkgs-unstable"
], ],
"utils": "utils" "utils": [
"flake-utils"
]
}, },
"locked": { "locked": {
"lastModified": 1663835995, "lastModified": 1667574732,
"narHash": "sha256-XNHQ+mdHbjNR1Oit00SFAEcrAZoCS08E7uAFcVMtwhM=", "narHash": "sha256-73TVk3uSQOja6Q/5OuNcpcqwo6+SMzJPRtYAjU0rBx4=",
"owner": "nix-community", "owner": "nix-community",
"repo": "home-manager", "repo": "home-manager",
"rev": "bd83eab6220226085c82e637931a7ae3863d9893", "rev": "b764068a506c6f70dba998efa0e7fcb99cb4deb2",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -277,11 +314,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1662177071, "lastModified": 1667542401,
"narHash": "sha256-x6XF//RdZlw81tFAYM1TkjY+iQIpyMCWZ46r9o4wVQY=", "narHash": "sha256-mdWjP5tjSf8n6FAtpSgL23kX4+eWBwLrSYo9iY3mA8Q=",
"owner": "yusdacra", "owner": "yusdacra",
"repo": "nix-cargo-integration", "repo": "nix-cargo-integration",
"rev": "65270dea87bb82fc02102a15221677eea237680e", "rev": "cd5e5cbd81c80dc219455dd3b1e0ddb55fae51ec",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -308,11 +345,11 @@
}, },
"nixpkgs-master": { "nixpkgs-master": {
"locked": { "locked": {
"lastModified": 1663895890, "lastModified": 1667617883,
"narHash": "sha256-p0hOonmnAwi6sTzfzhbJZL1MAWaIitXhzdcGTUpro5k=", "narHash": "sha256-8YP5mnK97NhAW3GUWC3MYglA5Xo2MrordY0vAgxBMos=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "403bfc5a5cc9c8843651bc309b14633fb1e7e1d3", "rev": "eb738c0fd3ec5b28996bb5f2af5ebae933780259",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -324,11 +361,11 @@
}, },
"nixpkgs-unstable": { "nixpkgs-unstable": {
"locked": { "locked": {
"lastModified": 1663879234, "lastModified": 1667610399,
"narHash": "sha256-zCe2EVY+Jt3I7gBgMSkuGesZ57vyt/WwIUwshiwDErk=", "narHash": "sha256-XZd0f4ZWAY0QOoUSdiNWj/eFiKb4B9CJPtl9uO9SYY4=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "a8a557e233c30b60225fa5af41cc56f8409e4afb", "rev": "1dd8696f96db47156e1424a49578fe7dd4ce99a4",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -363,11 +400,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1662087605, "lastModified": 1667487142,
"narHash": "sha256-Gpf2gp2JenKGf+TylX/YJpttY2bzsnvAMLdLaxoZRyU=", "narHash": "sha256-bVuzLs1ZVggJAbJmEDVO9G6p8BH3HRaolK70KXvnWnU=",
"owner": "oxalica", "owner": "oxalica",
"repo": "rust-overlay", "repo": "rust-overlay",
"rev": "60c2cfaa8b90ed8cebd18b214fac8682dcf222dd", "rev": "cf668f737ac986c0a89e83b6b2e3c5ddbd8cf33b",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -375,21 +412,6 @@
"repo": "rust-overlay", "repo": "rust-overlay",
"type": "github" "type": "github"
} }
},
"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"
}
} }
}, },
"root": "root", "root": "root",

View File

@ -7,20 +7,21 @@
nixpkgs-unstable.url = "github:NixOS/nixpkgs/nixpkgs-unstable"; 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-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-unstable"; 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-unstable"; home-manager.inputs.nixpkgs.follows = "nixpkgs-unstable";
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";
# Flake helpers
flake-utils.url = "github:numtide/flake-utils";
flake-compat.url = "github:edolstra/flake-compat";
flake-compat.flake = false;
# Extra sources # Extra sources
helix.url = "github:helix-editor/helix"; helix.url = "github:helix-editor/helix";
helix.inputs.nixpkgs.follows = "nixpkgs-unstable"; helix.inputs.nixpkgs.follows = "nixpkgs-unstable";
@ -266,7 +267,6 @@
homeManagerModules = { homeManagerModules = {
# configs # configs
configs-starship-symbols = import ./home/configs/starship-symbols.nix; configs-starship-symbols = import ./home/configs/starship-symbols.nix;
copyApplications = import ./home/copyApplications.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;

View File

@ -1,22 +0,0 @@
# adapted from
# https://github.com/reckenrode/nixos-configs/blob/2acd7b0699fd57628deb7b8855b4d5f0ea8f8cb1/common/darwin/home-manager/copyApplications.nix
# workaround for
# https://github.com/nix-community/home-manager/issues/1341
{ config, pkgs, lib, ... }:
{
home.activation = lib.optionalAttrs pkgs.stdenv.isDarwin {
copyApplications = lib.hm.dag.entryAfter [ "writeBoundary" ] ''
appsSrc="${config.home.homeDirectory}/Applications/Nix Apps/"
if [ -d "$appsSrc" ]; then
baseDir="$HOME/Applications/Home Manager Apps"
rsyncArgs="--archive --checksum --chmod=-w --copy-unsafe-links --delete"
$DRY_RUN_CMD mkdir -p "$baseDir"
$DRY_RUN_CMD sudo rm -rf "$baseDir"/*
$DRY_RUN_CMD sudo ${pkgs.rsync}/bin/rsync ''${VERBOSE_ARG:+-v} $rsyncArgs "$appsSrc" "$baseDir"
fi
'';
};
}

View File

@ -44,8 +44,6 @@ in
# General config ----------------------------------------------------------------------------- {{{ # General config ----------------------------------------------------------------------------- {{{
programs.kitty.settings = { programs.kitty.settings = {
# # https://fsd.it/shop/fonts/pragmatapro/
# font_family = "PragmataPro Mono Liga";
font_family = "FiraCode Nerd Font"; font_family = "FiraCode Nerd Font";
font_size = "14.0"; font_size = "14.0";
adjust_line_height = "120%"; adjust_line_height = "120%";
@ -70,12 +68,6 @@ in
macos_option_as_alt = "both"; macos_option_as_alt = "both";
}; };
# Change the style of italic font variants
# programs.kitty.extraConfig = ''
# font_features PragmataProMonoLiga-Italic +ss06
# font_features PragmataProMonoLiga-BoldItalic +ss07
# '';
programs.kitty.extras.useSymbolsFromNerdFont = "FiraCode Nerd Font"; programs.kitty.extras.useSymbolsFromNerdFont = "FiraCode Nerd Font";
# }}} # }}}

View File

@ -1,9 +1,14 @@
{ config, pkgs, lib, ... }: { config, pkgs, lib, ... }:
let
secretiveAuthSocket = "${config.home.homeDirectory}/Library/Containers/com.maxgoedjen.Secretive.SecretAgent/Data/socket.ssh";
in
{ {
# Programs + packages with configuration --------------------------------------------------------------- {{{ # Programs + packages with configuration --------------------------------------------------------------- {{{
home.sessionVariables = { home.sessionVariables = {
EDITOR = "hx"; EDITOR = "hx";
} // lib.optionalAttrs pkgs.stdenv.isDarwin {
SSH_AUTH_SOCK = secretiveAuthSocket;
}; };
programs = { programs = {
# a nicer cat # a nicer cat
@ -42,6 +47,11 @@
}; };
helix = { helix = {
enable = true; enable = true;
package = pkgs.helix-flake;
settings = {
theme = "tokyonight";
editor.indent-guides.render = true;
};
}; };
nix-index = { nix-index = {
enable = true; enable = true;
@ -52,7 +62,7 @@
matchBlocks."*".extraOptions = lib.optionalAttrs pkgs.stdenv.isDarwin { matchBlocks."*".extraOptions = lib.optionalAttrs pkgs.stdenv.isDarwin {
UseKeychain = "yes"; UseKeychain = "yes";
AddKeysToAgent = "yes"; AddKeysToAgent = "yes";
IdentityAgent = "${config.home.homeDirectory}/Library/Containers/com.maxgoedjen.Secretive.SecretAgent/Data/socket.ssh"; IdentityAgent = secretiveAuthSocket;
}; };
}; };
# vscode # vscode
@ -66,6 +76,15 @@
# Other packages ----------------------------------------------------------------------------- {{{ # Other packages ----------------------------------------------------------------------------- {{{
home.packages = with pkgs; [ home.packages = with pkgs; [
# GUI apps
discord-ptb
element-desktop
# kitty
lagrange
obsidian
slack
zoom-us
# System # System
abduco # lightweight session management abduco # lightweight session management
atool # archive tool atool # archive tool

View File

@ -115,7 +115,7 @@ in
]; ];
home.activation = mkIf (pkgs.stdenv.isDarwin && cfg.fixIcon.enable) { home.activation = mkIf (pkgs.stdenv.isDarwin && cfg.fixIcon.enable) {
fixKittyIcon = lib.hm.dag.entryAfter [ "writeBoundary" ] '' fixKittyIcon = lib.hm.dag.entryAfter [ "installPackages" "linkGeneration" ] ''
$DRY_RUN_CMD sudo /opt/homebrew/bin/fileicon set ${cfg.fixIcon.appPath} ${cfg.fixIcon.iconPath} $DRY_RUN_CMD sudo /opt/homebrew/bin/fileicon set ${cfg.fixIcon.appPath} ${cfg.fixIcon.iconPath}
''; '';
}; };

View File

@ -1,9 +1,9 @@
{ callPackage, inputs, system }: { callPackage, inputs, system }:
{ {
dark-mode-notify = callPackage ./dark-mode-notify.nix { dark-mode-notify = callPackage ./dark-mode-notify.nix {
sdkVersion = "14.0"; sdkVersion = "14.1";
inherit (inputs) dark-mode-notify-src; inherit (inputs) dark-mode-notify-src;
}; };
helix = inputs.helix.packages.${system}.default; helix-flake = inputs.helix.packages.${system}.default;
yubiswitch = callPackage ./yubiswitch.nix { }; yubiswitch = callPackage ./yubiswitch.nix { };
} }