this repo has no description
0
fork

Configure Feed

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

Various nixos/wsl updates, inc. updating unstable

+145 -52
+6 -6
.config/flake.lock
··· 136 136 }, 137 137 "nixos-unstable": { 138 138 "locked": { 139 - "lastModified": 1720768451, 140 - "narHash": "sha256-EYekUHJE2gxeo2pM/zM9Wlqw1Uw2XTJXOSAO79ksc4Y=", 139 + "lastModified": 1733759999, 140 + "narHash": "sha256-463SNPWmz46iLzJKRzO3Q2b0Aurff3U1n0nYItxq7jU=", 141 141 "owner": "NixOS", 142 142 "repo": "nixpkgs", 143 - "rev": "7e7c39ea35c5cdd002cd4588b03a3fb9ece6fad9", 143 + "rev": "a73246e2eef4c6ed172979932bc80e1404ba2d56", 144 144 "type": "github" 145 145 }, 146 146 "original": { ··· 203 203 }, 204 204 "nixpkgs-unstable": { 205 205 "locked": { 206 - "lastModified": 1725534445, 207 - "narHash": "sha256-Yd0FK9SkWy+ZPuNqUgmVPXokxDgMJoGuNpMEtkfcf84=", 206 + "lastModified": 1733749988, 207 + "narHash": "sha256-+5qdtgXceqhK5ZR1YbP1fAUsweBIrhL38726oIEAtDs=", 208 208 "owner": "NixOS", 209 209 "repo": "nixpkgs", 210 - "rev": "9bb1e7571aadf31ddb4af77fc64b2d59580f9a39", 210 + "rev": "bc27f0fde01ce4e1bfec1ab122d72b7380278e68", 211 211 "type": "github" 212 212 }, 213 213 "original": {
+13 -12
.config/flake.nix
··· 82 82 wsl = true; 83 83 nixos = true; 84 84 }; 85 + Disney-PC = { 86 + system = "x86_64-linux"; 87 + user = "ian"; 88 + class = "work"; 89 + wsl = true; 90 + nixos = true; 91 + }; 85 92 }; 86 93 87 94 isDarwin = system: lib.hasSuffix "darwin" system; ··· 135 142 }) 136 143 darwinSystems; 137 144 138 - nixosConfigurations = mapAttrs 139 - (hostname: { system, user, wsl ? false, ...}: nixpkgs.lib.nixosSystem { 145 + nixosConfigurations = mapAttrs 146 + (hostname: { system, user, wsl ? false, ... }: nixpkgs.lib.nixosSystem { 140 147 inherit system; 141 148 specialArgs = specialArgsFor hostname; 142 149 143 150 modules = [ 151 + ./nixos/configuration.nix 144 152 inputs.nixos-wsl.nixosModules.default 145 - { 146 - wsl = nixpkgs.lib.mkIf wsl { 147 - enable = true; 148 - defaultUser = user; 149 - wslConf.network.hostname = hostname; 150 - }; 151 - } 152 - ./nixos/configuration.nix 153 153 home-manager.nixosModules.home-manager 154 154 { 155 155 home-manager = { ··· 179 179 extraSpecialArgs = specialArgsFor hostname; 180 180 modules = [ 181 181 ./home-manager/home.nix 182 - ({ pkgs, ... }: { 182 + { 183 + # nixos and darwin get this from the host configuration 183 184 nix.package = inputs.unstable.lix; 184 - }) 185 + } 185 186 ./nixpkgs/flake-overlays.nix 186 187 ]; 187 188 }))
+25 -15
.config/home-manager/home.nix
··· 4 4 , pkgs 5 5 , unstable ? import <nixos-unstable> { } # backwards compat for non-flake 6 6 , homeDirectory ? "/home/${config.home.user}" 7 + , host 7 8 , ... 8 9 }: 9 10 let ··· 14 15 user = config.home.user or "ianchamberlain"; 15 16 in 16 17 { 17 - imports = [ 18 + imports = self.lib.existingPaths [ 18 19 ./macos-defaults.nix 19 20 ./default-apps.nix 21 + # This is kinda janky but I guess it works... 22 + # https://github.com/nix-community/home-manager/issues/1906 23 + ./${if host.wsl then "" else "non-"}wsl.nix 20 24 # ./firefox.nix # TODO 21 25 ]; 22 26 ··· 32 36 # https://github.com/nix-community/home-manager/issues/5602 33 37 34 38 nix.settings = { 35 - repl-overlays = "/${config.xdg.configHome}/nix/repl-overlays.nix"; 39 + repl-overlays = "${config.xdg.configHome}/nix/repl-overlays.nix"; 36 40 # Use extra- to avoid overwriting settings from nix-darwin 37 41 extra-experimental-features = [ 38 42 "repl-flake" 39 - # TODO: lix doesn't seem to be taking effect properly in nixos-wsl 40 - # "pipe-operator" 43 + "pipe-operator" 41 44 ]; 42 45 43 46 # TODO: try out default-flake ··· 55 58 home-manager.enable = true; 56 59 57 60 bat.enable = true; 61 + direnv = { 62 + enable = true; 63 + nix-direnv.enable = true; 64 + }; 58 65 fd.enable = true; 59 66 fish.enable = true; 60 67 git.enable = true; ··· 111 118 # }; 112 119 113 120 # syncthing.enable = true; 114 - 115 121 # For commit signing, git-crypt, etc. 116 122 gpg-agent = { 117 123 # https://github.com/nix-community/home-manager/issues/3864 118 124 # TODO: it would be nice to setup gpg-agent.conf on macOS properly 119 125 # during activation... Maybe nix-darwin has something? 120 126 enable = stdenv.isLinux; 121 - 122 127 defaultCacheTtl = 432000; # 5 days 123 128 maxCacheTtl = 432000; 124 - pinentryPackage = pkgs.pinentry-curses; 129 + pinentryPackage = lib.mkIf (!host.wsl) pkgs.pinentry-curses; 125 130 }; 126 131 }; 127 132 128 133 # See services.gpg-agent - manually set up conf file on macos instead 129 - home.file.".gnupg/gpg-agent.conf" = lib.mkIf stdenv.isDarwin { 130 - text = '' 131 - # Use nix-packaged pinentry-mac 132 - pinentry-program ${pkgs.pinentry_mac}/bin/pinentry-mac 133 - # Set TTL to 5 days for GPG passphrase prompt 134 - default-cache-ttl 432000 135 - max-cache-ttl 432000 136 - ''; 134 + home.file = { 135 + ".gnupg/gpg-agent.conf" = lib.mkIf stdenv.isDarwin { 136 + text = '' 137 + # Use nix-packaged pinentry-mac 138 + pinentry-program ${pkgs.pinentry_mac}/bin/pinentry-mac 139 + # Set TTL to 5 days for GPG passphrase prompt 140 + default-cache-ttl 432000 141 + max-cache-ttl 432000 142 + ''; 143 + }; 137 144 }; 138 145 139 146 home.packages = with pkgs; [ 140 147 buildifier 141 148 clang-tools 149 + comby 150 + difftastic 142 151 docker 143 152 docker-compose 144 153 docker-credential-helpers 154 + file 145 155 gh 146 156 git-crypt 147 157 git-lfs
+42
.config/home-manager/wsl.nix
··· 1 + { pkgs, lib, ... }: 2 + let 3 + pinentry-injector = pkgs.buildGoModule { 4 + pname = "pinentry-injector"; 5 + version = "0.1.0"; 6 + meta.mainProgram = "pinentry-injector"; 7 + 8 + # Since it's just a single-file zero-dependency app, generate go.mod on the fly 9 + # and pretend its dependencies are vendored. 10 + src = ./wsl/pinentry-injector; 11 + patchPhase = '' 12 + go mod init ian-h-chamberlain.com/pinentry-injector 13 + ''; 14 + vendorHash = null; 15 + }; 16 + 17 + # Request pinentry via Git-bash's GPG instead of pinentry-curses 18 + pinentry-wrapper = pkgs.writeShellApplication { 19 + name = "pinentry-win"; 20 + # TODO: PR these as inputs for nixpkgs#wslu itself? 21 + runtimeInputs = with pkgs; [ wslu coreutils gnused pinentry-injector ]; 22 + # TODO: if I write a real program to intercept stdin/stdout I can inject 23 + # a SETTITLE command using the key name for AutoType to work nicer. Ideally 24 + # cross-platform enough to work on native windows too 25 + text = /*bash*/ '' 26 + # Add wslpath to PATH (for wslu to work properly) 27 + export PATH=/bin:$PATH 28 + # Gpg4Win's pinentry-qt seems better behaved than plain pinentry from Git for Windows 29 + real_pinentry="$(wslpath "$(wslvar -s USERPROFILE)")/scoop/apps/gpg4win/current/Gpg4win/bin/pinentry.exe" 30 + exec "$real_pinentry" "$@" 31 + ''; 32 + }; 33 + in 34 + { 35 + services.gpg-agent.pinentryPackage = pinentry-wrapper; 36 + 37 + home.file.".local/bin/xdg-open".source = lib.getExe' pkgs.wslu "wslview"; 38 + home.packages = with pkgs; [ 39 + wslu 40 + pinentry-wrapper 41 + ]; 42 + }
+1 -1
.config/nix-darwin/configuration.nix
··· 32 32 ]; 33 33 34 34 shells = [ pkgs.fish ]; 35 - loginShell = "${pkgs.fish}/bin/fish"; 35 + loginShell = "${lib.getExe pkgs.fish}"; 36 36 37 37 etc = let homeDir = config.users.users.${host.user}.home; in { 38 38 # Symlink to dotfiles flake for easier activation
+26 -4
.config/nixos/configuration.nix
··· 1 - { config, lib, pkgs, host, ... }: 1 + { config, lib, pkgs, unstable, host, ... }: 2 2 { 3 3 # TODO: when converting prismo, will probably import ./prismo.nix or something 4 4 imports = [ 5 - ./wsl.nix 5 + ./wsl 6 6 ]; 7 7 8 8 nix.settings.experimental-features = [ "nix-command" "flakes" ]; 9 - nix.package = pkgs.lix; 9 + nix.package = unstable.lix; 10 10 11 11 time.timeZone = "America/New_York"; 12 12 ··· 22 22 # Symlink to dotfiles flake for easier activation 23 23 "nixos/flake.nix".source = "${homeDir}/.config/flake.nix"; 24 24 }; 25 + 26 + # Override the default aliases, I brought my own 27 + shellAliases = { 28 + ls = null; 29 + ll = null; 30 + l = null; 31 + }; 25 32 }; 26 33 27 - programs.fish.enable = true; 34 + 35 + # Based on /bin/sh: 36 + # https://github.com/NixOS/nixpkgs/blob/8261f6e94510101738ab45f0b877f2993c7fb069/nixos/modules/config/shells-environment.nix#L213 37 + system.activationScripts.binbash = 38 + let bash = lib.getExe config.system.build.binsh; in 39 + lib.stringAfter [ "stdio" ] 40 + /*bash*/ '' 41 + mkdir -m 0755 -p /bin 42 + ln -sfn "${bash}" /bin/.bash.tmp 43 + mv /bin/.bash.tmp /bin/bash # atomically replace /bin/bash 44 + ''; 45 + 46 + 47 + programs = { 48 + fish.enable = true; 49 + }; 28 50 29 51 users.users.${host.user} = { 30 52 isNormalUser = true;
-14
.config/nixos/wsl.nix
··· 1 - { host, lib, pkgs, ... }: { 2 - imports = [ 3 - ./wsl/scoop.nix 4 - ]; 5 - 6 - wsl = lib.mkIf host.wsl { 7 - wslConf.user.default = host.user; 8 - }; 9 - 10 - programs.nix-ld = lib.mkIf host.wsl { 11 - enable = true; 12 - package = pkgs.nix-ld-rs; 13 - }; 14 - }
+32
.config/nixos/wsl/default.nix
··· 1 + { host, lib, pkgs, ... }: 2 + let 3 + isWsl = host.wsl or false; 4 + in 5 + { 6 + imports = [ 7 + ./scoop.nix 8 + ]; 9 + 10 + wsl = lib.mkIf isWsl { 11 + enable = true; 12 + defaultUser = host.user; 13 + wslConf = { 14 + user.default = host.user; 15 + network.hostname = host.name; 16 + }; 17 + }; 18 + 19 + programs.nix-ld = lib.mkIf isWsl { 20 + enable = true; 21 + package = pkgs.nix-ld-rs; 22 + }; 23 + 24 + # Enable mDNS for reaching windows via .local hostname 25 + services.avahi = lib.mkIf isWsl { 26 + enable = true; 27 + nssmdns4 = true; 28 + }; 29 + 30 + 31 + security.pki.certificates = [ ]; 32 + }