mirror of
https://github.com/pjones/plasma-manager.git
synced 2024-08-17 03:30:22 +03:00
demo: Add a demo app that runs Plasma in a VM
This commit is contained in:
parent
55a2478ace
commit
9e29bcddf3
12
example/home.nix
Normal file
12
example/home.nix
Normal file
@ -0,0 +1,12 @@
|
||||
{ ... }:
|
||||
{
|
||||
programs.plasma = {
|
||||
enable = true;
|
||||
|
||||
# A high-level setting:
|
||||
workspace.clickItemTo = "select";
|
||||
|
||||
# A low-level setting:
|
||||
files."baloofilerc"."Basic Settings"."Indexing-Enabled" = false;
|
||||
};
|
||||
}
|
19
flake.nix
19
flake.nix
@ -42,6 +42,20 @@
|
||||
{
|
||||
default = self.packages.${system}.rc2nix;
|
||||
|
||||
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;
|
||||
|
||||
rc2nix = pkgs.writeShellApplication {
|
||||
name = "rc2nix";
|
||||
runtimeInputs = with pkgs; [ ruby ];
|
||||
@ -53,6 +67,11 @@
|
||||
{
|
||||
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";
|
||||
|
62
test/demo.nix
Normal file
62
test/demo.nix
Normal file
@ -0,0 +1,62 @@
|
||||
{ pkgs
|
||||
, home-manager
|
||||
, module
|
||||
, extraPackages
|
||||
}:
|
||||
|
||||
let
|
||||
homeConfig = {
|
||||
imports = [ ../example/home.nix ];
|
||||
};
|
||||
|
||||
user = import ./user.nix {
|
||||
inherit module home-manager homeConfig;
|
||||
};
|
||||
|
||||
in
|
||||
{ modulesPath, ... }:
|
||||
{
|
||||
imports = [
|
||||
(modulesPath + "/profiles/qemu-guest.nix")
|
||||
(modulesPath + "/virtualisation/qemu-vm.nix")
|
||||
user
|
||||
];
|
||||
|
||||
config = {
|
||||
networking.hostName = "plasma-demo";
|
||||
|
||||
fileSystems."/" = {
|
||||
device = "/dev/disk/by-label/nixos";
|
||||
fsType = "ext4";
|
||||
autoResize = true;
|
||||
};
|
||||
|
||||
boot = {
|
||||
growPartition = true;
|
||||
loader.timeout = 5;
|
||||
kernelParams = [
|
||||
"console=ttyS0"
|
||||
"boot.shell_on_fail"
|
||||
];
|
||||
};
|
||||
|
||||
virtualisation = {
|
||||
forwardPorts = [{
|
||||
from = "host";
|
||||
host.port = 2222;
|
||||
guest.port = 22;
|
||||
}];
|
||||
};
|
||||
|
||||
services.xserver = {
|
||||
enable = true;
|
||||
displayManager.sddm.enable = true;
|
||||
displayManager.defaultSession = "plasma";
|
||||
desktopManager.plasma5.enable = true;
|
||||
displayManager.autoLogin.enable = true;
|
||||
displayManager.autoLogin.user = "fake";
|
||||
};
|
||||
|
||||
environment.systemPackages = extraPackages;
|
||||
};
|
||||
}
|
@ -19,8 +19,7 @@
|
||||
useGlobalPkgs = true;
|
||||
|
||||
users.fake = { ... }: {
|
||||
imports = [ module ];
|
||||
config = homeConfig;
|
||||
imports = [ module homeConfig ];
|
||||
};
|
||||
};
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user