From a5cc2f536defd755cf2d98d15d344b9508655e39 Mon Sep 17 00:00:00 2001 From: Fabian Montero Date: Mon, 25 Aug 2025 12:24:25 -0600 Subject: [PATCH] move to standard trivionomicon flake.nix --- flake.lock | 17 +++----- flake.nix | 120 +++++++---------------------------------------------- 2 files changed, 21 insertions(+), 116 deletions(-) diff --git a/flake.lock b/flake.lock index 4fad1d3..79a6162 100644 --- a/flake.lock +++ b/flake.lock @@ -571,19 +571,14 @@ ] }, "locked": { - "lastModified": 1754513973, - "narHash": "sha256-7+gk+pQiMILfjajg+S0ceAJkl5ldi7m5WTqlEnmS7hA=", - "ref": "master", - "rev": "c651b8c4706cfc750303db12ae19e58164a6bebb", - "revCount": 28, - "type": "git", - "url": "https://git.posixlycorrect.com/deepState/trivionomicon" + "path": "./trivionomicon", + "type": "path" }, "original": { - "ref": "master", - "type": "git", - "url": "https://git.posixlycorrect.com/deepState/trivionomicon" - } + "path": "./trivionomicon", + "type": "path" + }, + "parent": [] }, "unstable": { "locked": { diff --git a/flake.nix b/flake.nix index ec8b67c..66ad268 100644 --- a/flake.nix +++ b/flake.nix @@ -18,7 +18,7 @@ homepage.url = "git+https://git.posixlycorrect.com/fabian/homepage.git?ref=master"; trivionomicon = { - url = "git+https://git.posixlycorrect.com/deepState/trivionomicon?ref=master"; + url = "./trivionomicon"; inputs.nixpkgs.follows = "nixpkgs"; }; @@ -33,112 +33,22 @@ }; }; - outputs = flakes @ { - self, - nixpkgs, - unstable, - home-manager, - nur, - impermanence, - hm-isolation, - nixGL, - flake-utils, - vpsadminos, - homepage, - mediawikiSkinCitizen, - authentik-nix, - trivionomicon, - }: let - system = "x86_64-linux"; + outputs = flakes: + flakes.trivionomicon.lib.mkSystemFlake { + inherit flakes; - importPkgs = flake: - import flake { - inherit system; + system = "x86_64-linux"; + doctrinePrefix = "local"; - config = import ./pkgs/config nixpkgs.lib; - overlays = [ - self.overlays.default - nur.overlays.default - nixGL.overlay - trivionomicon.overlays.default - ]; + paths = { + # localOverlay = "pkgs"; + nixpkgsConfig = "pkgs/config"; + + nixosSource = "sys"; + nixosPlatforms = "sys/platform"; + + hmSource = "home"; + hmPlatforms = "home/platform"; }; - - pkgs = importPkgs nixpkgs; - - inherit (pkgs.local.lib) importAll; - - local = final: prev: import ./pkgs {inherit final prev flakes;}; - in - with pkgs.lib; { - formatter.${system} = pkgs.alejandra; - packages.${system} = pkgs.local; - - overlays.default = final: prev: let - locals = local final prev; - in - locals.override - // { - local = locals; - unstable = importPkgs unstable; - }; - - nixosConfigurations = let - nixosSystem = {modules}: - makeOverridable nixpkgs.lib.nixosSystem { - inherit modules pkgs system; - - specialArgs = { - inherit flakes; - doctrine = import "${trivionomicon}/doctrine" { - inherit pkgs; - namespace = "sys"; - }; - }; - }; - - hostConfig = host: - nixosSystem { - modules = [ - ./sys - host - ]; - }; - in - mapAttrs (_: hostConfig) (importAll {root = ./sys/platforms;}); - - homeConfigurations = let - registry = {...}: { - config.nix.registry = - mapAttrs (_: value: { - flake = value; - }) - flakes; - }; - - home = platform: - home-manager.lib.homeManagerConfiguration { - inherit pkgs; - - modules = [ - ./home - platform - registry - hm-isolation.homeManagerModule - ]; - - extraSpecialArgs = { - inherit flakes; - doctrine = import "${trivionomicon}/doctrine" { - inherit pkgs; - namespace = "hm"; - }; - }; - }; - - platformHome = name: platform: - nameValuePair name (home platform); - in - mapAttrs' platformHome (importAll {root = ./home/platforms;}); }; }