hosts/kvothe/configuration.nix (view raw)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 |
{ self, config, pkgs, lib, ... }: { programs.bash.enable = true; environment = { shells = [ pkgs.bash ]; }; users.users.icy = { name = "icy"; home = "/Users/icy"; }; services.nix-daemon.enable = true; security.pam.enableSudoTouchIdAuth = true; system.stateVersion = 5; system.activationScripts.applications.text = pkgs.lib.mkForce ( # '' # echo "setting up ~/Applications..." >&2 # rm -rf ~/Applications/Nix\ Apps # mkdir -p ~/Applications/Nix\ Apps # for app in $(find ${config.system.build.applications}/Applications -maxdepth 1 -type l); do # src="$(/usr/bin/stat -f%Y "$app")" # cp -r "$src" ~/Applications/Nix\ Apps # done # '' '' echo "setting up /Applications..." >&2 rm -rf /Applications/Nix\ Apps mkdir -p /Applications/Nix\ Apps find ${ pkgs.buildEnv { name = "system-applications"; paths = config.environment.systemPackages; pathsToLink = "/Applications"; } }/Applications -maxdepth 1 -type l -exec readlink '{}' + | while read -r src; do app_name=$(basename "$src") echo "copying $src" >&2 ${pkgs.mkalias}/bin/mkalias "$src" "/Applications/Nix Apps/$app_name" done '' ); } |