this repo has no description
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Adjust flake outputs and setup .config/.git link

+38 -25
+22 -22
.config/flake.nix
··· 56 56 }; 57 57 }; 58 58 59 - darwinSystems = lib.filterAttrs 60 - (_: { system, ... }: lib.hasSuffix "darwin" system) 61 - systems; 59 + isDarwin = system: lib.hasSuffix "darwin" system; 62 60 61 + darwinSystems = lib.filterAttrs (_: { system, ... }: isDarwin system) systems; 63 62 # TODO: actually use this and switch prismo over to flakes 64 63 nixosSystems = { inherit (systems) prismo; }; 65 64 in ··· 78 77 { 79 78 home-manager = { 80 79 useGlobalPkgs = true; 80 + 81 81 users.${user} = import ./home-manager/home.nix; 82 + 82 83 extraSpecialArgs = { 83 84 unstable = inputs.nixpkgs-unstable.legacyPackages.${system}; 84 85 }; 85 - verbose = true; 86 86 }; 87 87 } 88 88 ]; ··· 91 91 }) 92 92 darwinSystems; 93 93 94 - darwinPackages = mapAttrs (host: _: self.darwinConfigurations.${host}.pkgs) darwinSystems; 94 + # Exposed for convenience 95 + darwinPackages = mapAttrs (cfg: cfg.pkgs) self.darwinConfigurations; 95 96 96 - homeConfigurations = mapAttrs 97 - (host: { system, user }: home-manager.lib.homeManagerConfiguration { 98 - modules = [ 99 - ./home-manager/home.nix 100 - { 101 - home.username = "${user}"; 102 - # TODO This is different on most Linuxes: 103 - home.homeDirectory = "/Users/${user}"; 104 - } 105 - ]; 97 + homeConfigurations = lib.mapAttrs' 98 + (host: { system, user }: lib.nameValuePair 99 + "${user}@${host}" 100 + (if isDarwin system then 101 + # Expose the home configuration built by darwinModules.home-manager: 102 + self.darwinConfigurations.${host}.config.home-manager.users.${user} 103 + else 104 + home-manager.lib.homeManagerConfiguration { 105 + modules = [ 106 + ./home-manager/home.nix 107 + ]; 106 108 107 - extraSpecialArgs = { 108 - username = user; 109 - pkgs-unstable = inputs.nixpkgs-unstable.legacyPackages.${system}; 110 - }; 111 - }) 109 + extraSpecialArgs = { 110 + username = user; 111 + pkgs-unstable = inputs.nixpkgs-unstable.legacyPackages.${system}; 112 + }; 113 + })) 112 114 systems; 113 - 114 - homePackages = mapAttrs (host: { user, ... }: self.homeConfigurations."${user}".pkgs) systems; 115 115 }; 116 116 }
+1
.config/home-manager/flake.lock
··· 1 + ../flake.lock
+15 -3
.config/home-manager/home.nix
··· 1 1 inputs @ { config, lib, pkgs, ... }: 2 2 let 3 - stdenv = pkgs.stdenv; 3 + inherit (pkgs) stdenv; 4 + inherit (config.lib.file) mkOutOfStoreSymlink; 5 + # TODO: proper input should be handled by flake or something 4 6 unstable = inputs.unstable or (import <nixos-unstable> { }); 5 7 in 6 8 { 7 - home.username = "ianchamberlain"; 8 - home.homeDirectory = "/home/${config.home.username}"; 9 + # These defaults are mainly just for nixOS which I haven't converted to flakes yet 10 + # so it needs to be deprioritized to avoid conflict with e.g. darwinModules 11 + home.username = lib.mkDefault "ianchamberlain"; 12 + home.homeDirectory = lib.mkDefault "/home/${config.home.username}"; 9 13 10 14 programs = { 11 15 # Let Home Manager install and manage itself. ··· 29 33 # them. Easier than migrating all of my config over to nix. 30 34 # `source = mkOutOfStoreSymlink ...` would also work here, but generates a 31 35 # warning at switch time that it is symlinking to itself, so this seems better. 36 + # 37 + # Maybe could work a little nicer using something like this: 38 + # https://github.com/nix-community/home-manager/issues/676#issuecomment-1595795685 32 39 xdg.configFile = { 33 40 "fish/config.fish".enable = false; 34 41 "nvim/init.lua".enable = false; 42 + 43 + # See ../flake.nix for why this exists. It would be nice to make it be a 44 + # relative path instead, but I guess this works, and it's needed since the 45 + # filename ".git" is special to git and can't be checked into the repo. 46 + ".git".source = mkOutOfStoreSymlink /${config.home.homeDirectory}/.local/share/yadm/repo.git; 35 47 }; 36 48 37 49 services = {