Personal Nix flake
nixos home-manager nix
1
fork

Configure Feed

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

feat: IP info on var.hosts, better known hosts file

The known hosts file now gets home domain and IP variations for each host

+40 -16
+3 -12
nix/legacyPackages/default.nix
··· 1 - { 2 - inputs, 3 - lib, 4 - self, 5 - ... 6 - }: let 7 - inherit (inputs.self.lib) callPackageWith callPackageRecursiveWith; 1 + {self, ...}: let 2 + inherit (self.lib) callPackageWith callPackageRecursiveWith; 8 3 in { 9 4 perSystem = { 10 5 self', ··· 16 11 in { 17 12 legacyPackages = { 18 13 ci.matrix = callPackage ./ciMatrix.nix {inherit self;}; 14 + knownHosts = callPackage ./knownHosts.nix {inherit self;}; 19 15 scripts = callPackageRecursive ./scripts {inherit (self'.legacyPackages.pkgs) writeNuScriptStdinBin;}; 20 16 vimPlugins = callPackageRecursive ./vimPlugins {}; 21 - knownHosts = 22 - self.vars.hosts 23 - |> lib.mapAttrsToList (host: cfg: "${host} ${cfg.pubKey}") 24 - |> lib.concatStringsSep "\n" 25 - |> pkgs.writeText "known-hosts"; 26 17 }; 27 18 }; 28 19 }
+22
nix/legacyPackages/knownHosts.nix
··· 1 + { 2 + lib, 3 + self, 4 + writeText, 5 + ... 6 + }: let 7 + inherit (self.vars) hosts networks; 8 + in 9 + hosts 10 + |> lib.concatMapAttrs ( 11 + host: cfg: 12 + { 13 + "${host}" = cfg.pubKey; 14 + "${host}.${networks.home.domain}" = cfg.pubKey; 15 + } 16 + // lib.optionalAttrs (cfg.ip.v4 or null != null) { 17 + "${cfg.ip.v4}" = cfg.pubKey; 18 + } 19 + ) 20 + |> lib.mapAttrsToList (host: key: "${host} ${key}") 21 + |> lib.concatStringsSep "\n" 22 + |> writeText "known-hosts"
+14 -4
vars/hosts.nix
··· 1 1 { 2 - desktop.pubKey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIMNf+oynlWr+Xq3UYKpCy8ih/w9sT6IuIKAtYjo6sfJr"; 3 - laptop.pubKey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIHh5IZnZipti8mCt0NPCVrJ5XTU2z+nb7d2hgMG4/B3C"; 4 - raspberrypi.pubKey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAILr9pl4qaL/+DV//lhE5y6V7xJ2eh1BSlwNYD9L9a2sQ"; 5 - raspberrypi.system = "aarch64-linux"; 2 + desktop = { 3 + pubKey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIMNf+oynlWr+Xq3UYKpCy8ih/w9sT6IuIKAtYjo6sfJr"; 4 + system = "x86_64-linux"; 5 + ip.v4 = "10.0.0.50"; 6 + }; 7 + laptop = { 8 + pubKey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIHh5IZnZipti8mCt0NPCVrJ5XTU2z+nb7d2hgMG4/B3C"; 9 + system = "x86_64-linux"; 10 + }; 11 + raspberrypi = { 12 + pubKey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAILr9pl4qaL/+DV//lhE5y6V7xJ2eh1BSlwNYD9L9a2sQ"; 13 + system = "aarch64-linux"; 14 + ip.v4 = "10.0.0.2"; 15 + }; 6 16 }
+1
vars/networks.nix
··· 1 1 { 2 2 home = { 3 + domain = "local"; 3 4 gateway = "10.0.0.1"; 4 5 routingPrefix = "10.0.0.0/8"; 5 6 subnetMask = "255.255.255.0";