this repo has no description
0
fork

Configure Feed

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

Add a "top-level" flake.nix instead of subflakes

Adjust its configuration to work on macOS, with home-manager!

+270 -41
+115
.config/flake.lock
··· 1 + { 2 + "nodes": { 3 + "home-manager": { 4 + "inputs": { 5 + "nixpkgs": [ 6 + "nixpkgs" 7 + ] 8 + }, 9 + "locked": { 10 + "lastModified": 1720042825, 11 + "narHash": "sha256-A0vrUB6x82/jvf17qPCpxaM+ulJnD8YZwH9Ci0BsAzE=", 12 + "owner": "nix-community", 13 + "repo": "home-manager", 14 + "rev": "e1391fb22e18a36f57e6999c7a9f966dc80ac073", 15 + "type": "github" 16 + }, 17 + "original": { 18 + "id": "home-manager", 19 + "ref": "release-24.05", 20 + "type": "indirect" 21 + } 22 + }, 23 + "nix-darwin": { 24 + "inputs": { 25 + "nixpkgs": [ 26 + "nixpkgs-darwin" 27 + ] 28 + }, 29 + "locked": { 30 + "lastModified": 1720845312, 31 + "narHash": "sha256-yPhAsJTpyoIPQZJGC8Fw8W2lAXyhLoTn+HP20bmfkfk=", 32 + "owner": "LnL7", 33 + "repo": "nix-darwin", 34 + "rev": "5ce8503cf402cf76b203eba4b7e402bea8e44abc", 35 + "type": "github" 36 + }, 37 + "original": { 38 + "id": "nix-darwin", 39 + "type": "indirect" 40 + } 41 + }, 42 + "nixos-unstable": { 43 + "locked": { 44 + "lastModified": 1720768451, 45 + "narHash": "sha256-EYekUHJE2gxeo2pM/zM9Wlqw1Uw2XTJXOSAO79ksc4Y=", 46 + "owner": "NixOS", 47 + "repo": "nixpkgs", 48 + "rev": "7e7c39ea35c5cdd002cd4588b03a3fb9ece6fad9", 49 + "type": "github" 50 + }, 51 + "original": { 52 + "id": "nixpkgs", 53 + "ref": "nixos-unstable", 54 + "type": "indirect" 55 + } 56 + }, 57 + "nixpkgs": { 58 + "locked": { 59 + "lastModified": 1720691131, 60 + "narHash": "sha256-CWT+KN8aTPyMIx8P303gsVxUnkinIz0a/Cmasz1jyIM=", 61 + "owner": "NixOS", 62 + "repo": "nixpkgs", 63 + "rev": "a046c1202e11b62cbede5385ba64908feb7bfac4", 64 + "type": "github" 65 + }, 66 + "original": { 67 + "id": "nixpkgs", 68 + "ref": "nixos-24.05", 69 + "type": "indirect" 70 + } 71 + }, 72 + "nixpkgs-darwin": { 73 + "locked": { 74 + "lastModified": 1720881915, 75 + "narHash": "sha256-uC/eDBJqbxuQzh0pYgbCtoCMjnKUFbJYkixeVDir5J8=", 76 + "owner": "NixOS", 77 + "repo": "nixpkgs", 78 + "rev": "68c6b3ca5da36c8c579376099691f3fe51a0070c", 79 + "type": "github" 80 + }, 81 + "original": { 82 + "id": "nixpkgs", 83 + "ref": "nixpkgs-24.05-darwin", 84 + "type": "indirect" 85 + } 86 + }, 87 + "nixpkgs-unstable": { 88 + "locked": { 89 + "lastModified": 1720781449, 90 + "narHash": "sha256-po3TZO9kcZwzvkyMJKb0WCzzDtiHWD34XeRaX1lWXp0=", 91 + "owner": "NixOS", 92 + "repo": "nixpkgs", 93 + "rev": "8b5a3d5a1d951344d683b442c0739010b80039db", 94 + "type": "github" 95 + }, 96 + "original": { 97 + "id": "nixpkgs", 98 + "ref": "nixpkgs-unstable", 99 + "type": "indirect" 100 + } 101 + }, 102 + "root": { 103 + "inputs": { 104 + "home-manager": "home-manager", 105 + "nix-darwin": "nix-darwin", 106 + "nixos-unstable": "nixos-unstable", 107 + "nixpkgs": "nixpkgs", 108 + "nixpkgs-darwin": "nixpkgs-darwin", 109 + "nixpkgs-unstable": "nixpkgs-unstable" 110 + } 111 + } 112 + }, 113 + "root": "root", 114 + "version": 7 115 + }
+115
.config/flake.nix
··· 1 + { 2 + description = '' 3 + Top-level dotfiles flake configuration. This flake is intended to have outputs for each of: 4 + - home-manager config on Linux (non-NixOS) 5 + - nix-darwin config 6 + - (eventually) NixOS configuration. 7 + 8 + NOTE: .config/.git must exist as a symlink to .local/share/yadm/repo.git 9 + or Nix may complain about "has an unsupported type" for untracked files 10 + under .config. This way, only yadm-tracked files are part of the 11 + context used by the flake: https://wiki.nixos.org/wiki/Flakes#Git_WARNING 12 + ''; 13 + 14 + inputs = { 15 + # Gah there's so many of these!!! 16 + nixpkgs.url = "flake:nixpkgs/nixos-24.05"; 17 + nixos-unstable.url = "flake:nixpkgs/nixos-unstable"; 18 + 19 + nixpkgs-darwin.url = "flake:nixpkgs/nixpkgs-24.05-darwin"; 20 + nixpkgs-unstable.url = "flake:nixpkgs/nixpkgs-unstable"; 21 + 22 + nix-darwin = { 23 + url = "flake:nix-darwin"; 24 + inputs.nixpkgs.follows = "nixpkgs-darwin"; 25 + }; 26 + home-manager = { 27 + # use stable version here to be compatible with stable darwin/nixos modules 28 + url = "flake:home-manager/release-24.05"; 29 + inputs.nixpkgs.follows = "nixpkgs"; 30 + }; 31 + }; 32 + 33 + outputs = inputs @ {self, nixpkgs, nix-darwin, home-manager, ... }: 34 + let 35 + inherit (builtins) mapAttrs; 36 + inherit (nixpkgs) lib; 37 + 38 + systems = { 39 + MacBook-Pro = { 40 + system = "aarch64-darwin"; 41 + user = "ianchamberlain"; 42 + }; 43 + ichamberlain-mbp-2 = { 44 + system = "x86_64-darwin"; 45 + user = "ichamberlain"; 46 + }; 47 + prismo = { 48 + system = "x86_64-linux"; 49 + user = "ianchamberlain"; 50 + # TODO: maybe some kinda nixos flag or something 51 + }; 52 + # ?? 53 + ichamberlain-dev = { 54 + system = "x86_64-linux"; 55 + user = "ichamberlain"; 56 + }; 57 + }; 58 + 59 + darwinSystems = lib.filterAttrs 60 + (_: { system, ... }: lib.hasSuffix "darwin" system) 61 + systems; 62 + 63 + # TODO: actually use this 64 + nixosSystems = { inherit (systems) prismo; }; 65 + in { 66 + darwinConfigurations = mapAttrs 67 + (hostname: { system, user }: nix-darwin.lib.darwinSystem { 68 + inherit system; 69 + 70 + modules = [ 71 + ./nix-darwin/configuration.nix 72 + { 73 + # home-manager module expects this to be set: 74 + users.users.${user}.home = "/Users/${user}"; 75 + } 76 + home-manager.darwinModules.home-manager 77 + { 78 + home-manager = { 79 + useGlobalPkgs = true; 80 + users.${user} = import ./home-manager/home.nix; 81 + extraSpecialArgs = { 82 + unstable = inputs.nixpkgs-unstable.legacyPackages.${system}; 83 + }; 84 + verbose = true; 85 + }; 86 + } 87 + ]; 88 + 89 + specialArgs = { inherit self ; }; 90 + }) 91 + darwinSystems; 92 + 93 + darwinPackages = mapAttrs (host: _: self.darwinConfigurations.${host}.pkgs) darwinSystems; 94 + 95 + homeConfigurations = mapAttrs 96 + (host: { system, user }: home-manager.lib.homeManagerConfiguration { 97 + modules = [ 98 + ./home-manager/home.nix 99 + { 100 + home.username = "${user}"; 101 + # TODO This is different on most Linuxes: 102 + home.homeDirectory = "/Users/${user}"; 103 + } 104 + ]; 105 + 106 + extraSpecialArgs = { 107 + username = user; 108 + pkgs-unstable = inputs.nixpkgs-unstable.legacyPackages.${system}; 109 + }; 110 + }) 111 + systems; 112 + 113 + homePackages = mapAttrs (host: { user, ... }: self.homeConfigurations."${user}".pkgs) systems; 114 + }; 115 + }
+39 -33
.config/home-manager/home.nix
··· 1 - { config, pkgs, lib, pkgsUnstable, ... }: 2 - { 3 - 4 - # TODO: may need to use lix-installer to upgrade to a non-beta version: 5 - # https://git.lix.systems/lix-project/lix/issues/411 6 - # https://git.lix.systems/lix-project/lix/issues/431 7 - # https://git.lix.systems/lix-project/lix-installer/issues/10 8 - nix.package = pkgs.lix; 9 - 1 + { config, lib, pkgs, unstable, ... }: 2 + let 3 + stdenv = pkgs.stdenv; 4 + in { 10 5 programs = { 11 6 # Let Home Manager install and manage itself. 12 7 home-manager.enable = true; ··· 31 26 }; 32 27 33 28 services = { 34 - # For commit signing, git-crypt, etc. 35 - gpg-agent = { 36 - enable = true; 37 - defaultCacheTtl = 432000; # 5 days 38 - maxCacheTtl = 432000; 39 - pinentryPackage = pkgs.pinentry-curses; 40 - }; 41 - 42 29 # Automount disks when plugged in 43 30 # udiskie = { 44 31 # enable = true; ··· 48 35 # }; 49 36 50 37 # syncthing.enable = true; 38 + } // lib.optionalAttrs stdenv.isLinux { 39 + # For commit signing, git-crypt, etc. 40 + gpg-agent = { 41 + enable = true; 42 + defaultCacheTtl = 432000; # 5 days 43 + maxCacheTtl = 432000; 44 + pinentryPackage = pkgs.pinentry-curses; 45 + }; 51 46 }; 52 47 48 + nixpkgs.overlays = [ 49 + (final: prev: { 50 + lnav = prev.lnav.overrideAttrs (_: rec { 51 + version = "0.12.2"; 52 + 53 + # Can't just use an override, since lnav doesn't use finalAttrs pattern: 54 + # https://github.com/NixOS/nixpkgs/issues/293452 55 + src = pkgs.fetchFromGitHub { 56 + owner = "tstack"; 57 + repo = "lnav"; 58 + rev = "v${version}"; 59 + sha256 = "grEW3J50osKJzulNQFN7Gir5+wk1qFPc/YaT+EZMAqs="; 60 + }; 61 + }); 62 + 63 + htop = prev.htop.overrideAttrs (_: { 64 + src = pkgs.fetchFromGitHub { 65 + owner = "ian-h-chamberlain"; 66 + repo = "htop"; 67 + rev = "feat/non-fkey-menubar"; 68 + sha256 = ""; 69 + }; 70 + }); 71 + }) 72 + ]; 73 + 53 74 home.packages = with pkgs; [ 54 75 # Fish completions + path setup stuff, needed since I'm not letting 55 76 # home-manager do all the shell setup for me. Most notably, this creates ··· 59 80 cacert 60 81 docker-compose 61 82 git-crypt 62 - pkgsUnstable.lnav 83 + unstable.lnav 63 84 shellcheck 64 85 thefuck 65 86 tree ··· 80 101 TERMINFO_DIRS = ":${config.home.profileDirectory}/share/terminfo"; 81 102 }; 82 103 83 - # Home Manager needs a bit of information about you and the 84 - # paths it should manage. 85 - 86 - # TODO: this could be a home.local.nix or something that is a `yadm alt` file 87 - home.username = "ichamberlain"; 88 - home.homeDirectory = "/Users/ichamberlain"; 89 - 90 - # This value determines the Home Manager release that your 91 - # configuration is compatible with. This helps avoid breakage 92 - # when a new Home Manager release introduces backwards 93 - # incompatible changes. 94 - # 95 - # You can update Home Manager without changing this value. See 96 - # the Home Manager release notes for a list of state version 97 - # changes in each release. 98 104 home.stateVersion = "20.09"; 99 105 }
+1 -8
.config/nix-darwin/configuration.nix
··· 1 - { self, host, pkgs, ... }: { 1 + { self, pkgs, ... }: { 2 2 # List packages installed in system profile. To search by name, run: 3 3 # $ nix-env -qaP | grep wget 4 4 environment.systemPackages = []; ··· 9 9 10 10 # Necessary for using flakes on this system. 11 11 nix.settings.experimental-features = "nix-command flakes"; 12 - 13 - /* TODO: use home-manager for this stuff instead 14 - programs = { 15 - fish.enable = true; 16 - man.enable = true; 17 - }; 18 - #*/ 19 12 20 13 security.pam.enableSudoTouchIdAuth = true; 21 14