plasma-manager/flake.nix

96 lines
2.7 KiB
Nix
Raw Normal View History

2022-06-22 22:10:51 +03:00
{
description = "Manage KDE Plasma with Home Manager";
inputs = {
2024-04-22 18:14:02 +03:00
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
2022-06-22 22:10:51 +03:00
2024-04-22 18:14:02 +03:00
home-manager.url = "github:nix-community/home-manager";
2022-06-22 22:10:51 +03:00
home-manager.inputs.nixpkgs.follows = "nixpkgs";
};
outputs = inputs@{ self, ... }:
let
# Systems that can run tests:
2022-06-22 22:10:51 +03:00
supportedSystems = [
"aarch64-linux"
"i686-linux"
"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;
# Attribute set of nixpkgs for each system:
nixpkgsFor = forAllSystems (system:
import inputs.nixpkgs { inherit system; });
in
{
homeManagerModules.plasma-manager = { ... }: {
2022-06-22 22:10:51 +03:00
imports = [ ./modules ];
};
packages = forAllSystems (system:
let pkgs = nixpkgsFor.${system}; in
{
default = self.packages.${system}.rc2nix;
demo = (inputs.nixpkgs.lib.nixosSystem {
inherit system;
modules = [
(import test/demo.nix {
2024-02-26 20:36:24 +03:00
home-manager-module = inputs.home-manager.nixosModules.home-manager;
plasma-module = self.homeManagerModules.plasma-manager;
})
2024-04-22 18:14:02 +03:00
(_: { environment.systemPackages = [ self.packages.${system}.rc2nix ]; })
];
}).config.system.build.vm;
rc2nix = pkgs.writeShellApplication {
name = "rc2nix";
runtimeInputs = with pkgs; [ python3 ];
text = ''python3 ${script/rc2nix.py} "$@"'';
};
});
apps = forAllSystems (system: {
default = self.apps.${system}.rc2nix;
demo = {
type = "app";
program = "${self.packages.${system}.demo}/bin/run-plasma-demo-vm";
};
rc2nix = {
type = "app";
program = "${self.packages.${system}.rc2nix}/bin/rc2nix";
2022-06-22 22:10:51 +03:00
};
});
checks = forAllSystems (system:
2022-06-22 22:10:51 +03:00
{
2024-02-26 19:58:45 +03:00
default = nixpkgsFor.${system}.callPackage ./test/basic.nix {
home-manager-module = inputs.home-manager.nixosModules.home-manager;
plasma-module = self.homeManagerModules.plasma-manager;
};
2022-06-22 22:10:51 +03:00
});
devShells = forAllSystems (system: {
default = nixpkgsFor.${system}.mkShell {
buildInputs = with nixpkgsFor.${system}; [
ruby
ruby.devdoc
2024-07-07 16:03:54 +03:00
(
python3.withPackages (
pyPkgs: [
pyPkgs.python-lsp-server
2024-07-13 12:40:05 +03:00
pyPkgs.black
pyPkgs.isort
2024-07-07 16:03:54 +03:00
]
)
)
];
};
});
2022-06-22 22:10:51 +03:00
};
}