From c8d762ee5958c45e54c71be44cc9109d365b48cc Mon Sep 17 00:00:00 2001 From: LunarAkai Date: Fri, 14 Mar 2025 23:35:36 +0100 Subject: [PATCH] hmm --- flake.lock | 17 +---------------- flake.nix | 20 ++++---------------- myLib/default.nix | 12 +++++++++++- 3 files changed, 16 insertions(+), 33 deletions(-) diff --git a/flake.lock b/flake.lock index e6b4004..5be13c1 100644 --- a/flake.lock +++ b/flake.lock @@ -118,8 +118,7 @@ "alejandra": "alejandra", "home-manager": "home-manager", "nixpkgs": "nixpkgs", - "nixpkgs-stable": "nixpkgs-stable", - "systems": "systems" + "nixpkgs-stable": "nixpkgs-stable" } }, "rust-analyzer-src": { @@ -138,20 +137,6 @@ "repo": "rust-analyzer", "type": "github" } - }, - "systems": { - "locked": { - "lastModified": 1681028828, - "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", - "owner": "nix-systems", - "repo": "default", - "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", - "type": "github" - }, - "original": { - "id": "systems", - "type": "indirect" - } } }, "root": "root", diff --git a/flake.nix b/flake.nix index 4666283..c285314 100644 --- a/flake.nix +++ b/flake.nix @@ -16,25 +16,13 @@ outputs = { self, - nixpkgs, - home-manager, - systems, ... } @ inputs: let - inherit (self) outputs; + myLib = import ./myLib/default.nix {inherit self inputs;}; + in + with myLib; { + inherit lib; - # copied from https://github.com/Misterio77/nix-config/blob/main/flake.nix - lib = nixpkgs.lib // home-manager.lib; - forEachSystem = f: lib.genAttrs (import systems) (system: f pkgsFor.${system}); - pkgsFor = lib.genAttrs (import systems) ( - system: - import nixpkgs { - inherit system; - config.allowUnfree = true; - } - ); - in { - with myLib; formatter = forEachSystem (pkgs: pkgs.alejandra); homeManagerModules.default = ./modules/home-manager; diff --git a/myLib/default.nix b/myLib/default.nix index 4989695..9aa653d 100644 --- a/myLib/default.nix +++ b/myLib/default.nix @@ -1,7 +1,17 @@ -{inputs}: let +{inputs, nixpkgs, home-manager, systems }: let myLib = (import ./default.nix) {inherit inputs;}; outputs = inputs.self.outputs; in rec { + # copied from https://github.com/Misterio77/nix-config/blob/main/flake.nix + lib = nixpkgs.lib // home-manager.lib; + forEachSystem = f: lib.genAttrs (import systems) (system: f pkgsFor.${system}); + pkgsFor = lib.genAttrs (import systems) ( + system: + import nixpkgs { + inherit system; + config.allowUnfree = true; + } + ); mkSystem = config: inputs.nixpkgs.lib.nixosSystem {