This commit is contained in:
Paul Zinselmeyer 2024-08-28 11:39:24 +02:00
commit 27bc941d29
Signed by: pfzetto
GPG key ID: B471A1AF06C895FD
7 changed files with 651 additions and 0 deletions

1
.gitattributes vendored Normal file
View file

@ -0,0 +1 @@
*.jpg filter=lfs diff=lfs merge=lfs -text

81
flake.lock Normal file
View file

@ -0,0 +1,81 @@
{
"nodes": {
"home-manager": {
"inputs": {
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1720042825,
"narHash": "sha256-A0vrUB6x82/jvf17qPCpxaM+ulJnD8YZwH9Ci0BsAzE=",
"owner": "nix-community",
"repo": "home-manager",
"rev": "e1391fb22e18a36f57e6999c7a9f966dc80ac073",
"type": "github"
},
"original": {
"owner": "nix-community",
"ref": "release-24.05",
"repo": "home-manager",
"type": "github"
}
},
"impermanence": {
"locked": {
"lastModified": 1724489415,
"narHash": "sha256-ey8vhwY/6XCKoh7fyTn3aIQs7WeYSYtLbYEG87VCzX4=",
"owner": "nix-community",
"repo": "impermanence",
"rev": "c7f5b394397398c023000cf843986ee2571a1fd7",
"type": "github"
},
"original": {
"owner": "nix-community",
"repo": "impermanence",
"type": "github"
}
},
"nixpkgs": {
"locked": {
"lastModified": 1724316499,
"narHash": "sha256-Qb9MhKBUTCfWg/wqqaxt89Xfi6qTD3XpTzQ9eXi3JmE=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "797f7dc49e0bc7fab4b57c021cdf68f595e47841",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixos-24.05",
"repo": "nixpkgs",
"type": "github"
}
},
"nur": {
"locked": {
"lastModified": 1724754492,
"narHash": "sha256-oTQ3H993c2hJREkqEN5zyff5ifIRKDRtFTvHlxFcHdI=",
"owner": "nix-community",
"repo": "NUR",
"rev": "d39c7ced498d546513270b314d682ac5d7de734d",
"type": "github"
},
"original": {
"owner": "nix-community",
"repo": "NUR",
"type": "github"
}
},
"root": {
"inputs": {
"home-manager": "home-manager",
"impermanence": "impermanence",
"nixpkgs": "nixpkgs",
"nur": "nur"
}
}
},
"root": "root",
"version": 7
}

36
flake.nix Normal file
View file

@ -0,0 +1,36 @@
{
nixConfig.experimental-features = [ "nix-command" "flakes" ];
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-24.05";
nur.url = "github:nix-community/NUR";
home-manager = {
url = "github:nix-community/home-manager/release-24.05";
inputs.nixpkgs.follows = "nixpkgs";
};
impermanence.url = "github:nix-community/impermanence";
};
outputs = { self, nixpkgs, nur, home-manager, impermanence }@inputs: {
nixosConfigurations."stube-pc" = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
specialArgs = inputs;
modules = [
./stube-pc/system.nix
home-manager.nixosModules.home-manager
impermanence.nixosModules.impermanence
{
nixpkgs.overlays = [ nur.overlay ];
nix.settings.experimental-features = [ "nix-command" "flakes" ];
home-manager = {
useGlobalPkgs = true;
useUserPackages = true;
extraSpecialArgs = inputs;
sharedModules = [ impermanence.nixosModules.home-manager.impermanence ];
users.stube.imports = [ ./stube-pc/home-manager.nix ];
};
}
];
};
};
}

BIN
stube-pc/background.jpg (Stored with Git LFS) Normal file

Binary file not shown.

View file

@ -0,0 +1,55 @@
# Do not modify this file! It was generated by nixos-generate-config
# and may be overwritten by future invocations. Please make changes
# to /etc/nixos/configuration.nix instead.
{ config, lib, pkgs, modulesPath, ... }:
{
imports =
[ (modulesPath + "/profiles/qemu-guest.nix")
];
boot.initrd.availableKernelModules = [ "ahci" "xhci_pci" "sd_mod" "sr_mod" "usb_storage" ];
boot.initrd.kernelModules = [ "amdgpu" ];
boot.kernelModules = [ "kvm-amd" "radeon.cik_support=0" "amdgpu.cik_support=1" ];
boot.extraModulePackages = [ ];
fileSystems."/" =
{ device = "none";
fsType = "tmpfs";
};
fileSystems."/nix" =
{ device = "/dev/disk/by-uuid/a1872869-9d8d-4ef2-9fce-16cb0a562e6c";
fsType = "btrfs";
options = [ "subvol=nix" ];
};
fileSystems."/persist" =
{ device = "/dev/disk/by-uuid/a1872869-9d8d-4ef2-9fce-16cb0a562e6c";
fsType = "btrfs";
options = [ "subvol=persist" ];
neededForBoot = true;
};
fileSystems."/swap" =
{ device = "/dev/disk/by-uuid/a1872869-9d8d-4ef2-9fce-16cb0a562e6c";
fsType = "btrfs";
options = [ "subvol=swap" ];
};
fileSystems."/boot" =
{ device = "/dev/disk/by-uuid/3b635ee4-a134-4d2b-af7d-36e3930314d9";
fsType = "ext4";
};
swapDevices = [ { device = "/swap/swapfile"; } ];
# Enables DHCP on each ethernet and wireless interface. In case of scripted networking
# (the default) this is the recommended approach. When using systemd-networkd it's
# still possible to use this option, but it's recommended to use it in conjunction
# with explicit per-interface declarations with `networking.interfaces.<interface>.useDHCP`.
networking.useDHCP = lib.mkDefault true;
# networking.interfaces.enp2s0.useDHCP = lib.mkDefault true;
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
}

387
stube-pc/home-manager.nix Normal file
View file

@ -0,0 +1,387 @@
{ config, pkgs, lib, ... }:
let
# a custom qlcplus desktop file to launch in kiosk mode with the correct workspace
qlcplus_launcher_entry = pkgs.writeText "qlcplus.desktop" ''
[Desktop Entry]
Type=Application
Name=Q Light Controller Plus
GenericName=Lighting control
Keywords=qlc;light;controller;dmx;analog;midi;artnet;e131;osc;
Exec=${pkgs.qlcplus}/bin/qlcplus --kiosk --open /home/stube/.stube.qxw
Icon=qlcplus
MimeType=application/x-qlc-workspace;
Categories=Qt;AudioVideo;
X-XFCE-Source=${pkgs.qlcplus}/share/applications/qlcplus.desktop
'';
custom-menu-file = pkgs.writeText "custom.menu" ''
<!DOCTYPE Menu PUBLIC "-//freedesktop//DTD Menu 1.0//EN"
"http://www.freedesktop.org/standards/menu-spec/1.0/menu.dtd">
<Menu>
<Name>Xfce</Name>
<DefaultAppDirs/>
<DefaultDirectoryDirs/>
<Include>
<Filename>xfce4-file-manager.desktop</Filename>
<Filename>xfce4-web-browser.desktop</Filename>
<Filename>shutdown.desktop</Filename>
<Filename>restart.desktop</Filename>
</Include>
<Layout>
<Filename>xfce4-file-manager.desktop</Filename>
<Filename>xfce4-web-browser.desktop</Filename>
<Separator/>
<Merge type="all"/>
<Separator/>
<Filename>shutdown.desktop</Filename>
<Filename>restart.desktop</Filename>
</Layout>
<Menu>
<Name>Development</Name>
<Directory>xfce-development.directory</Directory>
<Include>
<Category>Development</Category>
</Include>
</Menu>
<Menu>
<Name>Education</Name>
<Directory>xfce-education.directory</Directory>
<Include>
<Category>Education</Category>
</Include>
<Exclude>
<Filename>math.desktop</Filename>
</Exclude>
</Menu>
<Menu>
<Name>Games</Name>
<Directory>xfce-games.directory</Directory>
<Include>
<Category>Game</Category>
</Include>
</Menu>
<Menu>
<Name>Graphics</Name>
<Directory>xfce-graphics.directory</Directory>
<Include>
<Category>Graphics</Category>
</Include>
<Exclude>
<Filename>draw.desktop</Filename>
</Exclude>
</Menu>
<Menu>
<Name>Multimedia</Name>
<Directory>xfce-multimedia.directory</Directory>
<Include>
<Category>Audio</Category>
<Category>Video</Category>
<Category>AudioVideo</Category>
</Include>
<Exclude>
<Filename>qlcplus-fixtureeditor.desktop</Filename>
</Exclude>
</Menu>
<Menu>
<Name>Network</Name>
<Directory>xfce-network.directory</Directory>
<Include>
<Category>Network</Category>
</Include>
<Exclude>
<Or>
<Filename>xfce4-mail-reader.desktop</Filename>
<Filename>xfce4-web-browser.desktop</Filename>
<Filename>xfce4-web-browser.desktop</Filename>
<Filename>firefox.desktop</Filename>
</Or>
</Exclude>
</Menu>
<Menu>
<Name>Office</Name>
<Directory>xfce-office.directory</Directory>
<Include>
<Category>Office</Category>
</Include>
</Menu>
<Menu>
<Name>Science</Name>
<Directory>xfce-science.directory</Directory>
<Include>
<Category>Science</Category>
</Include>
<Exclude>
<Filename>math.desktop</Filename>
</Exclude>
</Menu>
<Menu>
<Name>System</Name>
<Directory>xfce-system.directory</Directory>
<Include>
<Or>
<Category>Emulator</Category>
<Category>System</Category>
</Or>
</Include>
<Exclude>
<Filename>xfce4-session-logout.desktop</Filename>
</Exclude>
<Menu>
<Name>Settings</Name>
<Directory>xfce-settings.directory</Directory>
<Include>
<Category>Settings</Category>
</Include>
<Layout>
<Filename>xfce-settings-manager.desktop</Filename>
<Separator/>
<Merge type="all"/>
</Layout>
<Menu>
<Name>Screensavers</Name>
<Directory>xfce-screensavers.directory</Directory>
<Include>
<Category>Screensaver</Category>
</Include>
</Menu>
</Menu>
<Menu>
<Name>Accessories</Name>
<Directory>xfce-accessories.directory</Directory>
<Include>
<Or>
<Category>Accessibility</Category>
<Category>Core</Category>
<Category>Legacy</Category>
<Category>Utility</Category>
<Filename>qlcplus-fixtureeditor.desktop</Filename>
</Or>
</Include>
<Exclude>
<Or>
<Filename>xfce4-file-manager.desktop</Filename>
<Filename>xfce4-terminal-emulator.desktop</Filename>
<Filename>xfce4-about.desktop</Filename>
<Filename>xfce4-run.desktop</Filename>
</Or>
</Exclude>
</Menu>
</Menu>
<Menu>
<Name>Other</Name>
<Directory>xfce-other.directory</Directory>
<OnlyUnallocated/>
<Include>
<All/>
</Include>
</Menu>
<DefaultMergeDirs/>
</Menu>
'';
in
{
home.persistence."/persist/home/stube" = {
files = [
".stube.qxw"
];
directories = [
".mixxx"
# xfconf.settings needs an existing installation
".config/xfce4"
];
allowOther = false;
};
home.activation.restart-xfce4-panel = lib.hm.dag.entryAfter ["writeBoundary"] ''
run /bin/sh -c "${pkgs.xfce.xfce4-panel}/bin/xfce4-panel -r || true"
'';
xfconf.settings = {
xfwm4 = {
"general/workspace_count" = 1;
};
xfce4-power-manager = {
"xfce4-power-manager/presentation-mode" = true;
"xfce4-power-manager/lock-screen-suspend-hibernate" = false;
};
xfce4-notifyd."do-not-disturb" = true;
xfce4-panel = {
"plugins/plugin-100" = "applicationsmenu";
"plugins/plugin-100/custom-menu" = true;
"plugins/plugin-100/custom-menu-file" = "${custom-menu-file}";
"plugins/plugin-100/button-icon" = "org.xfce.panel.actions";
"plugins/plugin-100/button-title" = "Anwendungen";
"plugins/plugin-110" = "separator";
"plugins/plugin-110/style" = 0;
"plugins/plugin-101" = "tasklist";
"plugins/plugin-101/grouping" = "1";
"plugins/plugin-101/show-handle" = false;
"plugins/plugin-102" = "separator";
"plugins/plugin-102/expand" = true;
"plugins/plugin-102/style" = 0;
"plugins/plugin-103" = "systray";
"plugins/plugin-103/square-icons" = true;
"plugins/plugin-104" = "separator";
"plugins/plugin-104/style" = 0;
"plugins/plugin-105" = "pulseaudio";
"plugins/plugin-105/enable-keyboard-shortcuts" = true;
"plugins/plugin-106" = "separator";
"plugins/plugin-106/style" = 0;
"plugins/plugin-107" = "clock";
"plugins/plugin-107/digital-date-format" = "%d %b %Y";
"plugins/plugin-108" = "separator";
"plugins/plugin-108/style" = 0;
/*
"plugins/plugin-109" = "actions";
"plugins/plugin-109/items" = [
"-lock-screen"
"-switch-user"
"-separator"
"-suspend"
"-hibernate"
"-hybrid-sleep"
"-separator"
"+shutdown"
"-restart"
"-separator"
"-logout"
"-logout-dialog"
];
*/
"panels/panel-1/plugin-ids" = [ 100 110 101 102 103 104 105 106 107 108 ];
"plugins/plugin-200" = "showdesktop";
"plugins/plugin-201" = "launcher";
"plugins/plugin-201/items" = ["${pkgs.xfce.xfce4-settings}/share/applications/xfce4-file-manager.desktop"];
"plugins/plugin-210" = "separator";
"plugins/plugin-210/style" = 0;
"plugins/plugin-211" = "launcher";
"plugins/plugin-211/items" = ["${pkgs.firefox}/share/applications/firefox.desktop"];
"plugins/plugin-212" = "launcher";
"plugins/plugin-212/items" = ["${pkgs.spotify}/share/applications/spotify.desktop"];
"plugins/plugin-213" = "launcher";
"plugins/plugin-213/items" = ["${pkgs.mixxx}/share/applications/org.mixxx.Mixxx.desktop"];
"plugins/plugin-220" = "separator";
"plugins/plugin-220/style" = 0;
"plugins/plugin-221" = "launcher";
"plugins/plugin-221/items" = [ "${qlcplus_launcher_entry}" ];
"panels/panel-2/plugin-ids" = [ 200 201 210 211 212 213 220 221 ];
};
xfce4-desktop = {
"backdrop/screen0/monitorVirtual-1/workspace0/last-image" = "${./background.jpg}";
"desktop-icons/file-icons/show-home" = false;
"desktop-icons/file-icons/show-filesystem" = false;
"desktop-icons/file-icons/show-trash" = false;
};
};
xdg.desktopEntries.shutdown = {
name = "Herunterfahren";
terminal = false;
icon = "xfsm-shutdown";
exec = "shutdown -h now";
};
xdg.desktopEntries.restart = {
name = "Neustarten";
terminal = false;
icon = "xfsm-reboot";
exec = "reboot";
};
home.packages = with pkgs; [
qlcplus
spotify
mixxx
vlc
mpv
libreoffice-still
];
programs.firefox = {
enable = true;
profiles.default = {
settings = {
"browser.startup.homepage" = "https://duckduckgo.com";
"general.useragent.locale" = "de-DE";
};
search = {
default = "DuckDuckGo";
force = true;
};
/*
extensions = with pkgs.nur.repos.rycee.firefox-addons; [
ublock-origin
decentraleyes
privacy-badger
];
*/
};
policies = {
DisableTelemetry = true;
DisableFirefoxStudies = true;
EnableTrackingProtection = {
Value = true;
Locked = true;
Cryptomining = true;
Fingerprinting = true;
};
DisablePocket = true;
DisableFirefoxAccounts = true;
DisableAccounts = true;
DisableFirefoxScreenshots = true;
OverrideFirstRunPage = "";
OverridePostUpdatePage = "";
DontCheckDefaultBrowser = true;
DisplayBookmarksToolbar = "never";
DisplayMenuBar = "default-off";
SearchBar = "unified";
ExtensionSettings = {
"*".installation_mode = "blocked";
"uBlock0@raymondhill.net" = {
install_url = "https://addons.mozilla.org/firefox/downloads/latest/ublock-origin/latest.xpi";
installation_mode = "force_installed";
};
/*
"jid1-MnnxcxisBPnSXQ@jetpack" = {
install_url = "https://addons.mozilla.org/firefox/downloads/latest/privacy-badger17/latest.xpi";
installation_mode = "force_installed";
};
"jid1-BoFifL9Vbdl2zQ@jetpack" = {
install_url = "https://addons.mozilla.org/firefox/downloads/latest/decentraleyes/latest.xpi";
installation_mode = "force_installed";
};
*/
};
};
};
home.stateVersion = "24.05";
}

88
stube-pc/system.nix Normal file
View file

@ -0,0 +1,88 @@
{ self, config, pkgs, lib, ...}: {
imports = [ ./hardware-configuration.nix ];
nixpkgs.config.allowUnfreePredicate = pkg: builtins.elem (lib.getName pkg) [ "spotify" ];
boot.loader.grub = {
enable = true;
device = "/dev/sda";
};
boot.loader.timeout = 1;
networking.hostName = "stube-pc";
networking.networkmanager.enable = true;
networking.firewall.enable = true;
time.timeZone = "Europe/Berlin";
users.mutableUsers = false;
users.users.root.password = "start1234";
users.users.stube = {
isNormalUser = true;
extraGroups = [ "networkmanager" ];
password = "stube";
};
systemd.services."display-manager".after = [ "home-manager-stube.service" ];
console.keyMap = "de";
services.pipewire = {
enable = true;
pulse.enable = true;
};
services.xserver = {
enable = true;
xkb.layout = "de";
desktopManager.xfce.enable = true;
};
services.displayManager = {
enable = true;
defaultSession = "xfce";
autoLogin = {
enable = true;
user = "stube";
};
};
services.xserver.displayManager.lightdm.greeter.enable = false;
services.xserver.displayManager.lightdm.autoLogin.timeout = 0;
services.xserver.desktopManager.xfce.enableScreensaver = false;
hardware.opengl = {
enable = true;
driSupport = true;
driSupport32Bit = true;
};
environment.systemPackages = with pkgs; [
vim
xfce.xfce4-pulseaudio-plugin
pavucontrol
];
environment.etc."current-nixos".source = self;
environment.persistence."/persist" = {
enable = true;
hideMounts = true;
directories = [
"/var/log"
"/var/lib/nixos"
"/var/lib/systemd/coredump"
"/etc/NetworkManager/system-connections"
];
files = [
"/etc/machine-id"
"/etc/ssh/ssh_host_rsa_key"
"/etc/ssh/ssh_host_rsa_key.pub"
"/etc/ssh/ssh_host_ed25519_key"
"/etc/ssh/ssh_host_ed25519_key.pub"
];
};
security.polkit.enable = true;
system.stateVersion = "24.05";
}