mirror of
https://github.com/pjones/plasma-manager.git
synced 2024-10-05 19:58:27 +03:00
flake: Simplify the flake.nix file and add a devShell
This commit is contained in:
parent
65e4ed1364
commit
a9e0e6869c
57
flake.nix
57
flake.nix
@ -10,24 +10,16 @@
|
|||||||
|
|
||||||
outputs = inputs@{ self, ... }:
|
outputs = inputs@{ self, ... }:
|
||||||
let
|
let
|
||||||
# List of systems we run NixOS tests for:
|
# Systems that can run tests:
|
||||||
supportedSystems = [
|
supportedSystems = [
|
||||||
"aarch64-darwin"
|
|
||||||
"aarch64-linux"
|
"aarch64-linux"
|
||||||
"i686-linux"
|
"i686-linux"
|
||||||
"x86_64-darwin"
|
|
||||||
"x86_64-linux"
|
"x86_64-linux"
|
||||||
];
|
];
|
||||||
|
|
||||||
# Function to generate a set based on supported systems:
|
# Function to generate a set based on supported systems:
|
||||||
forAllSystems = inputs.nixpkgs.lib.genAttrs supportedSystems;
|
forAllSystems = inputs.nixpkgs.lib.genAttrs supportedSystems;
|
||||||
|
|
||||||
# Like `forAllSystems` except just those support NixOS tests:
|
|
||||||
forQemuSystems = inputs.nixpkgs.lib.genAttrs [
|
|
||||||
"x86_64-linux"
|
|
||||||
"aarch64-linux"
|
|
||||||
];
|
|
||||||
|
|
||||||
# Attribute set of nixpkgs for each system:
|
# Attribute set of nixpkgs for each system:
|
||||||
nixpkgsFor = forAllSystems (system:
|
nixpkgsFor = forAllSystems (system:
|
||||||
import inputs.nixpkgs { inherit system; });
|
import inputs.nixpkgs { inherit system; });
|
||||||
@ -63,30 +55,39 @@
|
|||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|
||||||
apps = forAllSystems (system:
|
apps = forAllSystems (system: {
|
||||||
{
|
default = self.apps.${system}.rc2nix;
|
||||||
default = self.apps.${system}.rc2nix;
|
|
||||||
|
|
||||||
demo = {
|
demo = {
|
||||||
type = "app";
|
type = "app";
|
||||||
program = "${self.packages.${system}.demo}/bin/run-plasma-demo-vm";
|
program = "${self.packages.${system}.demo}/bin/run-plasma-demo-vm";
|
||||||
};
|
|
||||||
|
|
||||||
rc2nix = {
|
|
||||||
type = "app";
|
|
||||||
program = "${self.packages.${system}.rc2nix}/bin/rc2nix";
|
|
||||||
};
|
|
||||||
});
|
|
||||||
|
|
||||||
checks = forQemuSystems (system:
|
|
||||||
let test = path: import path {
|
|
||||||
pkgs = nixpkgsFor.${system};
|
|
||||||
home-manager = inputs.home-manager;
|
|
||||||
module = self.homeManagerModules.plasma;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
rc2nix = {
|
||||||
|
type = "app";
|
||||||
|
program = "${self.packages.${system}.rc2nix}/bin/rc2nix";
|
||||||
|
};
|
||||||
|
});
|
||||||
|
|
||||||
|
checks = forAllSystems (system:
|
||||||
|
let
|
||||||
|
test = path: import path {
|
||||||
|
pkgs = nixpkgsFor.${system};
|
||||||
|
home-manager = inputs.home-manager;
|
||||||
|
module = self.homeManagerModules.plasma;
|
||||||
|
};
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
default = test ./test/basic.nix;
|
default = test ./test/basic.nix;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
devShells = forAllSystems (system: {
|
||||||
|
default = nixpkgsFor.${system}.mkShell {
|
||||||
|
buildInputs = with nixpkgsFor.${system}; [
|
||||||
|
ruby
|
||||||
|
ruby.devdoc
|
||||||
|
];
|
||||||
|
};
|
||||||
|
});
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user