From 44bae215646a9712070e78024341eeb0c91690e1 Mon Sep 17 00:00:00 2001 From: Timothy DeHerrera Date: Mon, 1 Mar 2021 20:11:23 -0700 Subject: [PATCH] nix#registry: update names Continuing the work from 487fa7ea26bfb756bba0d5f60cb360b2e198ce00, simplify the registry entries a bit more by simply refering to the input flakes. Also add alias `orch` for easy search `override`. --- hosts/default.nix | 54 +++++++++++++-------------------------- profiles/core/default.nix | 19 +++----------- 2 files changed, 21 insertions(+), 52 deletions(-) diff --git a/hosts/default.nix b/hosts/default.nix index ec220ca..64fca1a 100644 --- a/hosts/default.nix +++ b/hosts/default.nix @@ -37,49 +37,31 @@ let modules; }; - global = - let - inherit (lock) nodes; + global = { + home-manager.useGlobalPkgs = true; + home-manager.useUserPackages = true; - lock = builtins.fromJSON (builtins.readFile ../flake.lock); - in - { - home-manager.useGlobalPkgs = true; - home-manager.useUserPackages = true; + hardware.enableRedistributableFirmware = lib.mkDefault true; - hardware.enableRedistributableFirmware = lib.mkDefault true; + networking.hostName = hostName; - networking.hostName = hostName; + nix.nixPath = [ + "nixpkgs=${nixos}" + "nixos-config=${self}/compat/nixos" + "home-manager=${home}" + ]; - nix.nixPath = [ - "nixpkgs=${nixos}" - "nixos-config=${self}/compat/nixos" - "home-manager=${home}" - ]; + nixpkgs = { inherit pkgs; }; - nixpkgs = { inherit pkgs; }; - - nix.registry = { - flk.flake = self; - - nixos = { - exact = true; - from = { - id = "nixos"; - type = "indirect"; - }; - to = { - inherit (nixos) lastModified narHash rev; - - path = override.outPath; - type = "path"; - }; - }; - }; - - system.configurationRevision = lib.mkIf (self ? rev) self.rev; + nix.registry = { + devos.flake = self; + nixos.flake = nixos; + override.flake = override; }; + system.configurationRevision = lib.mkIf (self ? rev) self.rev; + }; + local = { require = [ (import "${toString ./.}/${hostName}.nix") diff --git a/profiles/core/default.nix b/profiles/core/default.nix index 9c091fe..8fc0525 100644 --- a/profiles/core/default.nix +++ b/profiles/core/default.nix @@ -67,7 +67,8 @@ in ns = "n search --no-update-lock-file"; nf = "n flake"; nepl = "n repl ''"; - srch = "nsni"; + srch = "ns nixos"; + orch = "ns override"; nrb = ifSudo "sudo nixos-rebuild"; mn = '' manix "" | grep '^# ' | sed 's/^# \(.*\) (.*/\1/;s/ (.*//;s/^# //' | sk --preview="manix '{}'" | xargs manix @@ -94,21 +95,7 @@ in dn = ifSudo "s systemctl stop"; jtl = "journalctl"; - } // lib.mapAttrs' - (n: v: - let - prefix = lib.concatStrings (lib.take 2 (lib.stringToCharacters n)); - ref = from: - if from ? ref - then "ns ${from.id}/${from.ref}" - else "ns ${from.id}"; - in - lib.nameValuePair - "ns${prefix}" - (ref v.from) - ) - config.nix.registry; - + }; }; fonts = {