rename common module to nixos

This commit is contained in:
willifan 2025-02-09 16:49:24 +01:00
parent 68cc9cbc1d
commit f22fddbd3e
60 changed files with 1 additions and 1 deletions

View file

@ -0,0 +1,34 @@
{ lib, config, pkgs, inputs, system, ... }:
lib.mkIf config.desktop.enable {
environment.systemPackages =
(with pkgs; [
feh
enpass
proton-pass
vesktop
obsidian
kicad
protonmail-desktop
signal-desktop
piper
qemu
libreoffice
blender
gimp
inkscape
prusa-slicer
UVtools
audacity
])
++
[
inputs.zen.packages.${system}.specific
];
}

View file

@ -0,0 +1,18 @@
{ lib, config, ... }:
lib.mkIf config.desktop.autologin.enable {
security.pam.services.hyprlock = { };
services.greetd = {
enable = true;
settings = rec {
initial_session = {
command = config.desktop.windowManager;
user = "willifan";
};
default_session = initial_session;
};
};
}

View file

@ -0,0 +1,28 @@
{ lib, config, ... }:
lib.mkIf config.desktop.enable {
boot = {
plymouth = {
enable = true;
# theme = "bgrt";
# logo = "${pkgs.nixos-icons}/share/icons/hicolor/48x48/apps/nix-snowflake-white.png";
# font = "${pkgs.dejavu_fonts.minimal}/share/fonts/truetype/DejaVuSans.ttf";
};
consoleLogLevel = 0;
initrd.verbose = false;
kernelParams = [
"quiet"
"splash"
"boot.shell_on_fail"
"loglevel=3"
"rd.systemd.show_status=false"
"rd.udev.log_level=3"
"udev.log_priority=3"
];
# Hide the OS choice for bootloaders.
# It's still possible to open the bootloader list by pressing any key
# It will just not appear on screen unless a key is pressed
loader.timeout = 0;
};
}

View file

@ -0,0 +1,26 @@
{ ... }:
{
imports = [
./games
./applications.nix
./autostart.nix
./boot.nix
./dev.nix
./firefox.nix
./k40.nix
./keyboard.nix
./nfs-client.nix
./nix-ld.nix
./pipewire.nix
./plasma6.nix
./polkit.nix
./printers.nix
./remoteBuilder.nix
./ssh-server.nix
./thunar.nix
./udev.nix
];
}

View file

@ -0,0 +1,8 @@
{ lib, config, pkgs, ... }:
lib.mkIf config.desktop.dev.enable {
environment.systemPackages = with pkgs; [
jetbrains.rust-rover
jetbrains.pycharm-community-bin
];
}

View file

@ -0,0 +1,13 @@
{ lib, config, pkgs, ... }:
lib.mkIf config.desktop.enable {
environment.systemPackages = [
pkgs.firefoxpwa
];
programs.firefox = {
enable = true;
package = pkgs.firefox;
nativeMessagingHosts.packages = [ pkgs.firefoxpwa ];
};
}

View file

@ -0,0 +1,37 @@
{ lib, config, pkgs, ... }:
lib.mkIf config.desktop.enable {
services.udev.extraRules = ''
# Disable mouse as gamepad
ACTION=="add", SUBSYSTEM=="input", ATTRS{idVendor}=="0b05", ATTRS{idProduct}=="1906", RUN+="/bin/sh -c 'chmod 000 /dev/input/by-id/usb-ASUSTeK_ROG_PUGIO_II-if03-joystick'"
ACTION=="add", SUBSYSTEM=="input", ATTRS{idVendor}=="0b05", ATTRS{idProduct}=="1908", RUN+="/bin/sh -c 'chmod 000 /dev/input/by-id/usb-ASUSTeK_ROG_PUGIO_II-if03-joystick'"
ACTION=="add", SUBSYSTEM=="input", ATTRS{idVendor}=="0b05", ATTRS{idProduct}=="1906", RUN+="/bin/sh -c 'chmod 000 /dev/input/by-id/usb-ASUSTeK_ROG_PUGIO_II-if03-event-joystick'"
ACTION=="add", SUBSYSTEM=="input", ATTRS{idVendor}=="0b05", ATTRS{idProduct}=="1908", RUN+="/bin/sh -c 'chmod 000 /dev/input/by-id/usb-ASUSTeK_ROG_PUGIO_II-if03-event-joystick'"
'';
services.ratbagd = {
enable = true;
package = pkgs.libratbag.overrideAttrs (previousAttrs: {
postInstall = ''
# Ensure the target directory exists
mkdir -p $out/share/libratbag/
# cat the custom configuration file
cat << EOF > $out/share/libratbag/asus-rog-pugio-II.device
[Device]
Name=ASUS ROG Pugio II
DeviceMatch=usb:0b05:1906;usb:0b05:1908
Driver=asus
[Driver/asus]
Profiles=3
Buttons=10
Leds=3
Dpis=4
Wireless=1
DpiRange=100:16000@100
ButtonMapping=f0;f1;f2;e4;e5;e6;0;e8;e9;e1;e2
EOF
'';
});
};
}

View file

@ -0,0 +1,17 @@
{ ... }:
{
imports = [
./ROG_Pugio_II_fixes.nix
./emulation.nix
./mangohud.nix
./minecraft.nix
./moonlight.nix
./steam.nix
./tetrio.nix
./yuzu.nix
];
}

View file

@ -0,0 +1,10 @@
{ lib, config, pkgs, ... }:
lib.mkIf config.desktop.emulation.enable {
environment.systemPackages = with pkgs; [
melonDS
dolphin-emu
#lime3ds
cemu
steam-rom-manager
];
}

View file

@ -0,0 +1,6 @@
{ lib, config, pkgs, ... }:
lib.mkIf config.desktop.enable {
environment.systemPackages = with pkgs; [
mangohud
];
}

View file

@ -0,0 +1,6 @@
{ lib, config, pkgs, ... }:
lib.mkIf config.desktop.enable {
environment.systemPackages = with pkgs; [
prismlauncher
];
}

View file

@ -0,0 +1,8 @@
{ lib, config, pkgs, ... }:
lib.mkIf config.desktop.enable {
environment.systemPackages = [
pkgs.moonlight-qt
];
}

View file

@ -0,0 +1,16 @@
{ lib, config, ... }:
lib.mkIf config.desktop.enable {
programs.steam = {
enable = true;
gamescopeSession = {
enable = true;
};
};
hardware.steam-hardware.enable = true;
services.udev.extraRules = ''
SUBSYSTEM=="tty", ATTRS{idVendor}=="28de", ATTRS{idProduct}=="2102", MODE="0660", TAG+="uaccess"
'';
}

View file

@ -0,0 +1,8 @@
{ lib, config, pkgs, ... }:
lib.mkIf config.desktop.enable {
environment.systemPackages = [
pkgs.tetrio-desktop
];
}

View file

@ -0,0 +1,6 @@
{ lib, config, pkgs, ... }:
lib.mkIf config.desktop.enable {
environment.systemPackages = with pkgs; [
yuzu
];
}

View file

@ -0,0 +1,12 @@
{ lib, config, pkgs, ... }:
lib.mkIf config.desktop.laser.enable {
services.udev.extraRules = ''
SUBSYSTEM=="usb", ATTRS{idVendor}=="1a86", ATTRS{idProduct}=="5512", MODE:="0666"
'';
environment.systemPackages = with pkgs; [
k40-whisperer
];
}

View file

@ -0,0 +1,13 @@
{ lib, config, pkgs, ... }:
lib.mkIf config.desktop.enable {
environment.systemPackages = with pkgs; [
qmk-udev-rules
vial
];
hardware.keyboard.qmk.enable = true;
services.udev.extraRules = ''
KERNEL=="hidraw*", SUBSYSTEM=="hidraw", ATTRS{serial}=="*vial:f64c2b3c*", MODE="0660", GROUP="users", TAG+="uaccess", TAG+="udev-acl"
'';
}

View file

@ -0,0 +1,20 @@
{ lib, config, pkgs, ... }:
lib.mkIf config.desktop.enable {
environment.systemPackages = with pkgs; [
nfs-utils
];
services.autofs = {
enable = true;
autoMaster =
let
mapConf = pkgs.writeText "auto.nfs" ''
roms -fstype=nfs4 192.168.178.19:/roms
'';
in
''
/mnt/nfs ${mapConf}
'';
};
}

View file

@ -0,0 +1,7 @@
{ lib, config, pkgs, ... }:
lib.mkIf config.desktop.enable {
programs.nix-ld.enable = true;
programs.nix-ld.libraries = with pkgs; [
];
}

View file

@ -0,0 +1,13 @@
{ lib, config, ... }:
lib.mkIf config.desktop.enable {
security.rtkit.enable = true;
services.pipewire = {
enable = true;
alsa.enable = true;
alsa.support32Bit = true;
pulse.enable = true;
wireplumber.enable = true;
# If you want to use JACK applications, uncomment this
#jack.enable = true;
};
}

View file

@ -0,0 +1,6 @@
{ lib, config, ... }:
lib.mkIf config.desktop.wm.plasma6.enable {
services.desktopManager.plasma6 = {
enable = true;
};
}

View file

@ -0,0 +1,24 @@
{ lib, config, pkgs, ... }:
lib.mkIf config.desktop.enable {
environment.systemPackages = with pkgs; [
polkit_gnome
];
security.polkit.enable = true;
systemd = {
user.services.polkit-gnome-authentication-agent-1 = {
description = "polkit-gnome-authentication-agent-1";
wantedBy = [ "graphical-session.target" ];
wants = [ "graphical-session.target" ];
after = [ "graphical-session.target" ];
serviceConfig = {
Type = "simple";
ExecStart = "${pkgs.polkit_gnome}/libexec/polkit-gnome-authentication-agent-1";
Restart = "on-failure";
RestartSec = 1;
TimeoutStopSec = 10;
};
};
};
}

View file

@ -0,0 +1,13 @@
{ lib, config, pkgs, ... }:
lib.mkIf config.desktop.enable {
services.printing = {
enable = true;
drivers = [ pkgs.gutenprint pkgs.gutenprintBin ];
};
services.avahi = {
enable = true;
nssmdns4 = true;
openFirewall = true;
};
}

View file

@ -0,0 +1,37 @@
{ lib, config, ... }:
lib.mkIf config.desktop.enable {
nix.buildMachines = [
{
hostName = "Anton";
sshUser = "builder";
systems = [ "x86_64-linux" "aarch64-linux" ];
protocol = "ssh-ng";
# if the builder supports building for multiple architectures,
# replace the previous line by, e.g.
# systems = ["x86_64-linux" "aarch64-linux"];
maxJobs = 4;
speedFactor = 2;
supportedFeatures = [ "nixos-test" "benchmark" "big-parallel" "kvm" ];
mandatoryFeatures = [ ];
}
{
hostName = "Puenktchen";
sshUser = "builder";
systems = [ "x86_64-linux" "aarch64-linux" ];
protocol = "ssh-ng";
# if the builder supports building for multiple architectures,
# replace the previous line by, e.g.
# systems = ["x86_64-linux" "aarch64-linux"];
maxJobs = 8;
speedFactor = 4;
supportedFeatures = [ "nixos-test" "benchmark" "big-parallel" "kvm" ];
mandatoryFeatures = [ ];
}
];
nix.distributedBuilds = true;
# optional, useful when the builder has a faster internet connection than yours
nix.extraOptions = ''
builders-use-substitutes = true
'';
boot.binfmt.emulatedSystems = [ "aarch64-linux" ];
}

View file

@ -0,0 +1,22 @@
{ lib, config, ... }:
lib.mkIf config.desktop.enable {
services.openssh = {
enable = true;
ports = [ 22 ];
settings = {
PasswordAuthentication = false;
AllowUsers = null; # Allows all users by default. Can be [ "user1" "user2" ]
UseDns = true;
X11Forwarding = false;
PermitRootLogin = "prohibit-password"; # "yes", "without-password", "prohibit-password", "forced-commands-only", "no"
};
};
users.users.willifan.openssh.authorizedKeys.keys = [
"ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQDMRriQfw3pusl04fGhCNVoRRpye71ZwkDXAtKB/FP1DLXA4cYrwjLzv/fG1hXi7lAMp2vLiABAg/UaTE8roGzlt62XsFNwc1TI5M8m67J0kLkCtz3MkIixe/3GOFXr03g80DPncLyoIYPvvNd/TftTBK4yrrZPvMJaRrZhW/QdLPQpdHalcNRZ4bnBOCtCoqQ6RGrRi2EeKaJDYIFNl13b9FxrXEJcXnbSDdr1KI3q7a+vkefI2knUf2Uk7ufOWTQ1aqc0heGtCNlHzwZUzW/dfrpPmoVPq3Fqxqd9uXqxMk1Z3VnOwWcK3VXfzzBXKTsX0MaUgF1EqxibkYs9bDZqLEXoRucBqk3wwMPy8RJXqQOupoqa2xEOoduBf1qDHEEm69coHCpPm2mQVUrwsPrmTHmOjh9ir0mkVBDRgHvhq/ctQTVO5/SE2NCgPdlvUV5s44LLsUyxBp5JWwXZWlVys+7Dhil6mtRDcH4CXceJn0VZ61Zv2jrCTxQjKsroitSkNbpAkKajQ9moLMAblsSwJzl3uvJJ3ydlxjZefwTO/GjyuJMY2sIU2Tu0YbIVgMyq5L782LduVlyWj+RLWoEu19OfMqQvTWhJnQPAbR82qGzlfTGRLUxoY+G5MYipJwgrBQ2TnpWvfpTrZxFrglSfekz0v54lWzNZpW+irImh4w== willifan@proton.me"
];
nix.settings.trusted-users = [ "willifan" ];
}

View file

@ -0,0 +1,19 @@
{ lib, config, pkgs, ... }:
lib.mkIf config.desktop.enable {
services.gvfs.enable = true;
services.tumbler.enable = true;
programs.file-roller.enable = true;
programs.thunar = {
enable = true;
plugins = with pkgs.xfce; [
thunar-archive-plugin
thunar-volman
];
};
}

View file

@ -0,0 +1,2 @@
{ ... }:
{ }