2022-06-22 22:10:51 +03:00
|
|
|
{
|
|
|
|
description = "Manage KDE Plasma with Home Manager";
|
|
|
|
|
|
|
|
inputs = {
|
|
|
|
nixpkgs.url = "github:NixOS/nixpkgs/nixos-22.05";
|
|
|
|
|
|
|
|
home-manager.url = "github:nix-community/home-manager/release-22.05";
|
|
|
|
home-manager.inputs.nixpkgs.follows = "nixpkgs";
|
|
|
|
};
|
|
|
|
|
|
|
|
outputs = inputs@{ self, ... }:
|
|
|
|
let
|
|
|
|
# List of systems we run NixOS tests for:
|
|
|
|
supportedSystems = [
|
2022-06-22 23:33:33 +03:00
|
|
|
"aarch64-darwin"
|
2022-06-22 22:10:51 +03:00
|
|
|
"aarch64-linux"
|
2022-06-22 23:33:33 +03:00
|
|
|
"i686-linux"
|
|
|
|
"x86_64-darwin"
|
|
|
|
"x86_64-linux"
|
2022-06-22 22:10:51 +03:00
|
|
|
];
|
|
|
|
|
|
|
|
# Function to generate a set based on supported systems:
|
|
|
|
forAllSystems = inputs.nixpkgs.lib.genAttrs supportedSystems;
|
|
|
|
|
2022-06-22 23:33:33 +03:00
|
|
|
# Like `forAllSystems` except just those support NixOS tests:
|
|
|
|
forQemuSystems = inputs.nixpkgs.lib.genAttrs [
|
|
|
|
"x86_64-linux"
|
|
|
|
"aarch64-linux"
|
|
|
|
];
|
|
|
|
|
2022-06-22 22:10:51 +03:00
|
|
|
# Attribute set of nixpkgs for each system:
|
|
|
|
nixpkgsFor = forAllSystems (system:
|
|
|
|
import inputs.nixpkgs { inherit system; });
|
|
|
|
in
|
|
|
|
{
|
|
|
|
homeManagerModules.plasma = { ... }: {
|
|
|
|
imports = [ ./modules ];
|
|
|
|
};
|
|
|
|
|
2022-06-22 23:33:33 +03:00
|
|
|
packages = forAllSystems (system:
|
|
|
|
let pkgs = nixpkgsFor.${system}; in
|
|
|
|
{
|
|
|
|
default = self.packages.${system}.rc2nix;
|
|
|
|
|
2022-06-23 00:42:18 +03:00
|
|
|
demo = (inputs.nixpkgs.lib.nixosSystem {
|
|
|
|
inherit system;
|
|
|
|
modules = [
|
|
|
|
(import test/demo.nix {
|
|
|
|
pkgs = nixpkgsFor.x86_64-linux;
|
|
|
|
home-manager = inputs.home-manager;
|
|
|
|
module = self.homeManagerModules.plasma;
|
|
|
|
extraPackages = with self.packages.${system}; [
|
|
|
|
rc2nix
|
|
|
|
];
|
|
|
|
})
|
|
|
|
];
|
|
|
|
}).config.system.build.vm;
|
|
|
|
|
2022-06-22 23:33:33 +03:00
|
|
|
rc2nix = pkgs.writeShellApplication {
|
|
|
|
name = "rc2nix";
|
|
|
|
runtimeInputs = with pkgs; [ ruby ];
|
|
|
|
text = ''ruby ${script/rc2nix.rb} "$@"'';
|
|
|
|
};
|
|
|
|
});
|
|
|
|
|
|
|
|
apps = forAllSystems (system:
|
|
|
|
{
|
|
|
|
default = self.apps.${system}.rc2nix;
|
|
|
|
|
2022-06-23 00:42:18 +03:00
|
|
|
demo = {
|
|
|
|
type = "app";
|
|
|
|
program = "${self.packages.${system}.demo}/bin/run-plasma-demo-vm";
|
|
|
|
};
|
|
|
|
|
2022-06-22 23:33:33 +03:00
|
|
|
rc2nix = {
|
|
|
|
type = "app";
|
|
|
|
program = "${self.packages.${system}.rc2nix}/bin/rc2nix";
|
|
|
|
};
|
|
|
|
});
|
|
|
|
|
|
|
|
checks = forQemuSystems (system:
|
2022-06-22 22:10:51 +03:00
|
|
|
let test = path: import path {
|
|
|
|
pkgs = nixpkgsFor.${system};
|
|
|
|
home-manager = inputs.home-manager;
|
|
|
|
module = self.homeManagerModules.plasma;
|
|
|
|
};
|
|
|
|
in
|
|
|
|
{
|
|
|
|
default = test ./test/basic.nix;
|
|
|
|
});
|
|
|
|
};
|
|
|
|
}
|