Move nix-vm-test out of flake inputs

This commit is contained in:
Sofie 2024-10-29 11:19:55 +01:00
parent c099b40594
commit 6350ea5596
No known key found for this signature in database
GPG key ID: C9E9DE9EDCD42BC1
2 changed files with 22 additions and 41 deletions

21
flake.lock generated
View file

@ -1,25 +1,5 @@
{ {
"nodes": { "nodes": {
"nix-vm-test": {
"inputs": {
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1729365388,
"narHash": "sha256-PRBcv8IWfXlw7DLuljqyPVAqtcj3/7RtmsKCou8dhAg=",
"owner": "numtide",
"repo": "nix-vm-test",
"rev": "62092e89a2a69fa63fb4f560f48e2f874d3393bb",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "nix-vm-test",
"type": "github"
}
},
"nixpkgs": { "nixpkgs": {
"locked": { "locked": {
"lastModified": 1729256560, "lastModified": 1729256560,
@ -38,7 +18,6 @@
}, },
"root": { "root": {
"inputs": { "inputs": {
"nix-vm-test": "nix-vm-test",
"nixpkgs": "nixpkgs" "nixpkgs": "nixpkgs"
} }
} }

View file

@ -1,17 +1,10 @@
{ {
description = "Manage system config using nix on any distro"; description = "Manage system config using nix on any distro";
inputs = { inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
nix-vm-test = {
url = "github:numtide/nix-vm-test";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs = outputs =
inputs: { self, nixpkgs }:
let let
systems = [ systems = [
"aarch64-linux" "aarch64-linux"
@ -19,32 +12,38 @@
]; ];
eachSystem = eachSystem =
f: f:
inputs.nixpkgs.lib.genAttrs systems ( nixpkgs.lib.genAttrs systems (
system: system:
f { f {
inherit system; inherit system;
pkgs = inputs.nixpkgs.legacyPackages.${system}; pkgs = nixpkgs.legacyPackages.${system};
} }
); );
nix-vm-test-lib = "${
builtins.fetchTarball {
url = "https://github.com/numtide/nix-vm-test/archive/7901cec00670681b3e405565cb7bffe6a9368240.tar.gz";
sha256 = "0m82a40r3j7qinp3y6mh36da89dkwvpalz6a4znx9rqp6kh3885x";
}
}/lib.nix";
in in
{ {
lib = import ./nix/lib.nix { inherit (inputs) nixpkgs; }; lib = import ./nix/lib.nix { inherit nixpkgs; };
packages = eachSystem ( packages = eachSystem (
{ pkgs, system }: { pkgs, system }:
import ./packages.nix { inherit pkgs; } import ./packages.nix { inherit pkgs; }
// { // {
default = inputs.self.packages.${system}.system-manager; default = self.packages.${system}.system-manager;
} }
); );
overlays = { overlays = {
packages = final: _prev: import ./packages.nix { pkgs = final; }; packages = final: _prev: import ./packages.nix { pkgs = final; };
default = inputs.self.overlays.packages; default = self.overlays.packages;
}; };
# Only useful for quick tests # Only useful for quick tests
systemConfigs.default = inputs.self.lib.makeSystemConfig { systemConfigs.default = self.lib.makeSystemConfig {
modules = [ ./examples/example.nix ]; modules = [ ./examples/example.nix ];
}; };
@ -58,11 +57,11 @@
); );
checks = ( checks = (
inputs.nixpkgs.lib.recursiveUpdate nixpkgs.lib.recursiveUpdate
(eachSystem ( (eachSystem (
{ system, ... }: { system, ... }:
{ {
system-manager = inputs.self.packages.${system}.system-manager; system-manager = self.packages.${system}.system-manager;
} }
)) ))
{ {
@ -72,9 +71,12 @@
in in
(import ./test/nix/modules { (import ./test/nix/modules {
inherit system; inherit system;
inherit (inputs.nixpkgs) lib; inherit (nixpkgs) lib;
nix-vm-test = inputs.nix-vm-test.lib.${system}; nix-vm-test = import nix-vm-test-lib {
system-manager = inputs.self; inherit nixpkgs;
inherit system;
};
system-manager = self;
}); });
} }
); );