New configuration initial commit

This commit is contained in:
EsVagy42 2025-04-13 15:27:48 +00:00
commit f44f0550cd
17 changed files with 3211 additions and 0 deletions

1
commit_text Normal file
View file

@ -0,0 +1 @@
New configuration initial commit

268
configuration.nix Normal file
View file

@ -0,0 +1,268 @@
# Edit this configuration file to define what should be installed on
# your system. Help is available in the configuration.nix(5) man page
# and in the NixOS manual (accessible by running nixos-help).
{ config, pkgs, lib, ... }:
{
nixpkgs.config.allowUnfree = false;
nix.settings.experimental-features = [ "nix-command" "flakes" ];
nix.settings.auto-optimise-store = true;
nix.gc = {
automatic = true;
options = "--delete-older-than 14d";
};
# Bootloader.
boot.loader.systemd-boot.enable = false;
boot.loader.grub.enable = true;
boot.loader.grub.device = "nodev";
boot.loader.grub.efiSupport = true;
boot.loader.efi.canTouchEfiVariables = true;
boot.loader.grub.useOSProber = true;
system.nixos.label = builtins.replaceStrings [ "\n" " " ] [ "" "_" ]
(builtins.readFile ./commit_text);
# Needed for audio to work
boot.kernelPackages = pkgs.linuxPackagesFor pkgs.linux_latest;
boot.kernel.sysctl."kernel.yama.ptrace_scope" = lib.mkOverride 500 0;
services.power-profiles-daemon.enable = true;
networking.hostName = "nixos"; # Define your hostname.
# networking.wireless.enable = true; # Enables wireless support via wpa_supplicant.
# Configure network proxy if necessary
# networking.proxy.default = "http://user:password@proxy:port/";
# networking.proxy.noProxy = "127.0.0.1,localhost,internal.domain";
# Enable networking
networking.networkmanager.enable = true;
# Set your time zone.
time.timeZone = "UTC";
# Select internationalisation properties.
i18n.defaultLocale = "en_US.UTF-8";
# Enable the X11 windowing system.
services.xserver.enable = true;
services.displayManager.sddm.enable = true;
services.desktopManager.plasma6.enable = true;
# Configure keymap in X11
services.xserver.xkb = {
layout = "us";
variant = "";
};
# Enable CUPS to print documents.
services.printing.enable = true;
# Enable sound with pipewire.
hardware.pulseaudio.enable = false;
security.rtkit.enable = true;
services.pipewire = {
enable = true;
alsa.enable = true;
alsa.support32Bit = true;
pulse.enable = true;
# If you want to use JACK applications, uncomment this
# jack.enable = true;
# use the example session manager (no others are packaged yet so this is enabled by default,
# no need to redefine it in your config for now)
# media-session.enable = true;
};
hardware.bluetooth.enable = true;
home-manager.backupFileExtension = "backup";
# Enable touchpad support (enabled default in most desktopManager).
# services.xserver.libinput.enable = true;
# Define a user account. Don't forget to set a password with passwd.
users.users.esvagy = {
isNormalUser = true;
description = "EsVagy";
extraGroups = [ "networkmanager" "wheel" ];
initialPassword = "initialPassword";
};
programs.kdeconnect.enable = true;
programs.steam = {
enable = true;
remotePlay.openFirewall = true;
dedicatedServer.openFirewall = true;
localNetworkGameTransfers.openFirewall = true;
};
nixpkgs.config.allowUnfreePredicate = pkg:
builtins.elem (pkgs.lib.getName pkg) [
"beeper"
"steam"
"steam-original"
"steam-unwrapped"
];
services.flatpak.enable = true;
services.flatpak.packages =
[ "flathub:app/org.opensurge2d.OpenSurge//stable" ];
services.flatpak.remotes = {
"flathub" = "https://dl.flathub.org/repo/flathub.flatpakrepo";
};
services.keyd = {
enable = true;
keyboards = {
default = {
ids = [ "*" ];
extraConfig = ''
[main]
capslock = layer(capslock)
[capslock]
h = left
j = down
k = up
l = right
e = C-right
b = C-left
u = pageup
d = pagedown
0 = home
4 = end
w = C-s
p = C-v
y = C-c
'';
};
};
};
# List packages installed in system profile. To search, run:
# $ nix search wget
environment.systemPackages = with pkgs; [
# vim # Do not forget to add an editor to edit configuration.nix! The Nano editor is also installed by default.
# wget
kdePackages.krecorder
kdePackages.kweather
kdePackages.kcharselect
kdePackages.filelight
kdePackages.kcalc
kdePackages.cantor
kdePackages.kclock
kdePackages.kholidays
kdePackages.libkdepim
kdePackages.kdepim-addons
kdePackages.kdepim-runtime
brave
kdePackages.zanshin
kdePackages.korganizer
kdePackages.merkuro
kdePackages.francis
yt-dlp
wl-clipboard
lldb
kdePackages.kompare
kdePackages.kdevelop
kdePackages.kcachegrind
gcc
gdb
clang-tools
bash-language-server
nixd
nixfmt
marksman
kdePackages.markdownpart
lua
lua-language-server
cppcheck
nixos-shell
kdePackages.qtwebengine
kdePackages.qtlocation
kdePackages.ksystemstats # needed for the resource widgets
aspell # needed for spell checking
aspellDicts.en
aspellDicts.hu
kdePackages.qtmultimedia
gimp
inkscape
kdePackages.kdenlive
srb2
superTuxKart
kdePackages.kjumpingcube
kdePackages.kigo
gnugo
crawlTiles
prismlauncher
mindustry
openttd-jgrpp
( retroarch.withCores
(cores: with cores; [ blastem ]) )
wineWowPackages.stable
winetricks
beeper
libreoffice
pandoc
texliveFull
];
fonts.packages = with pkgs; [ nerd-fonts.hack ];
services.ollama.enable = true;
# Some programs need SUID wrappers, can be configured further or are
# started in user sessions.
# programs.mtr.enable = true;
# programs.gnupg.agent = {
# enable = true;
# enableSSHSupport = true;
# };
# List services that you want to enable:
# Enable the OpenSSH daemon.
# services.openssh.enable = true;
# Open ports in the firewall.
networking.firewall.allowedTCPPorts = [ 2350 3450 ]; # needed for tmnf
networking.firewall.allowedUDPPorts = [ 2350 3450 ]; # needed for tmnf
# Or disable the firewall altogether.
# networking.firewall.enable = false;
virtualisation.vmVariant = {
# following configuration is added only when building VM with build-vm
virtualisation = {
memorySize = 8192; # Use 8GiB memory.
cores = 4;
graphics = true;
};
};
# This value determines the NixOS release from which the default
# settings for stateful data, like file locations and database versions
# on your system were taken. Its perfectly fine and recommended to leave
# this value at the release version of the first install of this system.
# Before changing this value read the documentation for this option
# (e.g. man configuration.nix or on https://nixos.org/nixos/options.html).
system.stateVersion = "24.05"; # Did you read the comment?
}

View file

@ -0,0 +1,39 @@
# 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 + "/installer/scan/not-detected.nix")
];
boot.initrd.availableKernelModules = [ "xhci_pci" "thunderbolt" "vmd" "ahci" "nvme" "rtsx_pci_sdmmc" ];
boot.initrd.kernelModules = [ ];
boot.kernelModules = [ "kvm-intel" ];
boot.extraModulePackages = [ ];
fileSystems."/" =
{ device = "/dev/disk/by-uuid/b3b5b00d-8cbd-4566-8849-494ef36a226b";
fsType = "ext4";
};
fileSystems."/boot" =
{ device = "/dev/disk/by-uuid/42F8-3997";
fsType = "vfat";
options = [ "fmask=0077" "dmask=0077" ];
};
swapDevices = [ ];
# 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.enp0s31f6.useDHCP = lib.mkDefault true;
# networking.interfaces.wlp0s20f3.useDHCP = lib.mkDefault true;
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
}

20
devices/alt/alt.nix Normal file
View file

@ -0,0 +1,20 @@
# Edit this configuration file to define what should be installed on
# your system. Help is available in the configuration.nix(5) man page
# and in the NixOS manual (accessible by running nixos-help).
{ config, pkgs, lib, ... }:
{
imports = [ # Include the results of the hardware scan.
./alt-hardware-configuration.nix
];
swapDevices = [{
device = "/var/lib/swapfile";
size = 16 * 1024;
}];
boot.initrd.systemd.enable = true;
}

View file

@ -0,0 +1,33 @@
# Edit this configuration file to define what should be installed on
# your system. Help is available in the configuration.nix(5) man page
# and in the NixOS manual (accessible by running nixos-help).
{ config, pkgs, lib, ... }:
{
imports = [ # Include the results of the hardware scan.
./hardware-configuration.nix
];
systemd.services.limitbat0 = let bat0_charge_limit = 80;
in {
enable = true;
description = "Limit battry charge to 80%";
unitConfig = { After = "multi-user.target"; };
serviceConfig = {
Type = "oneshot";
ExecStart = "/bin/sh -c 'echo ${
toString bat0_charge_limit
} > /sys/class/power_supply/BAT0/charge_control_end_threshold'";
};
wantedBy = [ "multi-user.target" ];
};
swapDevices = [{
device = "/var/lib/swapfile";
size = 16 * 1024;
}];
boot.initrd.systemd.enable = true;
}

View file

@ -0,0 +1,38 @@
# 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 + "/installer/scan/not-detected.nix")
];
boot.initrd.availableKernelModules = [ "xhci_pci" "thunderbolt" "vmd" "nvme" ];
boot.initrd.kernelModules = [ ];
boot.kernelModules = [ "kvm-intel" ];
boot.extraModulePackages = [ ];
fileSystems."/" =
{ device = "/dev/disk/by-uuid/8bad3503-15d2-42e6-b209-1e8cfb1293d1";
fsType = "ext4";
};
fileSystems."/boot" =
{ device = "/dev/disk/by-uuid/7CCF-2070";
fsType = "vfat";
options = [ "fmask=0022" "dmask=0022" ];
};
swapDevices = [ ];
# 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.wlo1.useDHCP = lib.mkDefault true;
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
}

361
flake.lock generated Normal file
View file

@ -0,0 +1,361 @@
{
"nodes": {
"flake-parts": {
"inputs": {
"nixpkgs-lib": "nixpkgs-lib"
},
"locked": {
"lastModified": 1743550720,
"narHash": "sha256-hIshGgKZCgWh6AYJpJmRgFdR3WUbkY04o82X05xqQiY=",
"owner": "hercules-ci",
"repo": "flake-parts",
"rev": "c621e8422220273271f52058f618c94e405bb0f5",
"type": "github"
},
"original": {
"owner": "hercules-ci",
"repo": "flake-parts",
"type": "github"
}
},
"flake-parts_2": {
"inputs": {
"nixpkgs-lib": [
"nixvim",
"nixvim",
"nixpkgs"
]
},
"locked": {
"lastModified": 1743550720,
"narHash": "sha256-hIshGgKZCgWh6AYJpJmRgFdR3WUbkY04o82X05xqQiY=",
"owner": "hercules-ci",
"repo": "flake-parts",
"rev": "c621e8422220273271f52058f618c94e405bb0f5",
"type": "github"
},
"original": {
"owner": "hercules-ci",
"repo": "flake-parts",
"type": "github"
}
},
"flake-utils": {
"inputs": {
"systems": "systems_2"
},
"locked": {
"lastModified": 1731533236,
"narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "11707dc2f618dd54ca8739b309ec4fc024de578b",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"flatpaks": {
"inputs": {
"home-manager": "home-manager",
"nixpkgs": "nixpkgs_2",
"systems": "systems"
},
"locked": {
"lastModified": 1733581530,
"narHash": "sha256-W+orHmF+XpZosrBFAFRs7sS1iVKYveg9SutkzSXMVsI=",
"owner": "GermanBread",
"repo": "declarative-flatpak",
"rev": "b88bd5b65f8e7c35eec0a90cfd6e096b2e7f79c0",
"type": "github"
},
"original": {
"owner": "GermanBread",
"ref": "stable-v3",
"repo": "declarative-flatpak",
"type": "github"
}
},
"home-manager": {
"inputs": {
"nixpkgs": "nixpkgs"
},
"locked": {
"lastModified": 1733572789,
"narHash": "sha256-zjO6m5BqxXIyjrnUziAzk4+T4VleqjstNudSqWcpsHI=",
"owner": "nix-community",
"repo": "home-manager",
"rev": "c7ffc9727d115e433fd884a62dc164b587ff651d",
"type": "github"
},
"original": {
"owner": "nix-community",
"ref": "release-24.11",
"repo": "home-manager",
"type": "github"
}
},
"home-manager_2": {
"inputs": {
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1744498625,
"narHash": "sha256-pL52uCt9CUoTTmysGG91c2FeU7XUvpB7Cep6yon2vDk=",
"owner": "nix-community",
"repo": "home-manager",
"rev": "db56335ca8942d86f2200664acdbd5b9212b26ad",
"type": "github"
},
"original": {
"owner": "nix-community",
"repo": "home-manager",
"type": "github"
}
},
"ixx": {
"inputs": {
"flake-utils": [
"nixvim",
"nixvim",
"nuschtosSearch",
"flake-utils"
],
"nixpkgs": [
"nixvim",
"nixvim",
"nuschtosSearch",
"nixpkgs"
]
},
"locked": {
"lastModified": 1729958008,
"narHash": "sha256-EiOq8jF4Z/zQe0QYVc3+qSKxRK//CFHMB84aYrYGwEs=",
"owner": "NuschtOS",
"repo": "ixx",
"rev": "9fd01aad037f345350eab2cd45e1946cc66da4eb",
"type": "github"
},
"original": {
"owner": "NuschtOS",
"ref": "v0.0.6",
"repo": "ixx",
"type": "github"
}
},
"nixpkgs": {
"locked": {
"lastModified": 1731755305,
"narHash": "sha256-v5P3dk5JdiT+4x69ZaB18B8+Rcu3TIOrcdG4uEX7WZ8=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "057f63b6dc1a2c67301286152eb5af20747a9cb4",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixos-24.11",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs-lib": {
"locked": {
"lastModified": 1743296961,
"narHash": "sha256-b1EdN3cULCqtorQ4QeWgLMrd5ZGOjLSLemfa00heasc=",
"owner": "nix-community",
"repo": "nixpkgs.lib",
"rev": "e4822aea2a6d1cdd36653c134cacfd64c97ff4fa",
"type": "github"
},
"original": {
"owner": "nix-community",
"repo": "nixpkgs.lib",
"type": "github"
}
},
"nixpkgs_2": {
"locked": {
"lastModified": 1733412085,
"narHash": "sha256-FillH0qdWDt/nlO6ED7h4cmN+G9uXwGjwmCnHs0QVYM=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "4dc2fc4e62dbf62b84132fe526356fbac7b03541",
"type": "github"
},
"original": {
"owner": "nixos",
"ref": "nixos-24.11",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs_3": {
"locked": {
"lastModified": 1744232761,
"narHash": "sha256-gbl9hE39nQRpZaLjhWKmEu5ejtQsgI5TWYrIVVJn30U=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "f675531bc7e6657c10a18b565cfebd8aa9e24c14",
"type": "github"
},
"original": {
"owner": "nixos",
"ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs_4": {
"locked": {
"lastModified": 1743538100,
"narHash": "sha256-Bl/ynRPIb4CdtbEw3gfJYpKiHmRmrKltXc8zipqpO0o=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "b9d43b3fe5152d1dc5783a2ba865b2a03388b741",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixpkgs-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"nixvim": {
"inputs": {
"flake-parts": "flake-parts",
"nixpkgs": [
"nixpkgs"
],
"nixvim": "nixvim_2"
},
"locked": {
"lastModified": 1744182111,
"narHash": "sha256-ZBtJDwcjG2LWmsp7X6fTYxwYzW2mee9B1iZjSAe1cK8=",
"owner": "EsVagy42",
"repo": "nixvim",
"rev": "2d99dcd63807de3616e35e5e81d5143da8cfbfc4",
"type": "github"
},
"original": {
"owner": "EsVagy42",
"repo": "nixvim",
"type": "github"
}
},
"nixvim_2": {
"inputs": {
"flake-parts": "flake-parts_2",
"nixpkgs": "nixpkgs_4",
"nuschtosSearch": "nuschtosSearch"
},
"locked": {
"lastModified": 1743723573,
"narHash": "sha256-yxONmoimNU0hy0s8pF5lKCSZNqxVmbIHuag3sdk3R30=",
"owner": "nix-community",
"repo": "nixvim",
"rev": "9f495dda930ceca1653813ded11859d6b1342803",
"type": "github"
},
"original": {
"owner": "nix-community",
"repo": "nixvim",
"type": "github"
}
},
"nuschtosSearch": {
"inputs": {
"flake-utils": "flake-utils",
"ixx": "ixx",
"nixpkgs": [
"nixvim",
"nixvim",
"nixpkgs"
]
},
"locked": {
"lastModified": 1743201766,
"narHash": "sha256-bb/dqoIjtIWtJRzASOe8g4m8W2jUIWtuoGPXdNjM/Tk=",
"owner": "NuschtOS",
"repo": "search",
"rev": "2651dbfad93d6ef66c440cbbf23238938b187bde",
"type": "github"
},
"original": {
"owner": "NuschtOS",
"repo": "search",
"type": "github"
}
},
"plasma-manager": {
"inputs": {
"home-manager": [
"home-manager"
],
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1742765550,
"narHash": "sha256-2vVIh2JrL6GAGfgCeY9e6iNKrBjs0Hw3bGQEAbwVs68=",
"owner": "nix-community",
"repo": "plasma-manager",
"rev": "b70be387276e632fe51232887f9e04e2b6ef8c16",
"type": "github"
},
"original": {
"owner": "nix-community",
"repo": "plasma-manager",
"type": "github"
}
},
"root": {
"inputs": {
"flatpaks": "flatpaks",
"home-manager": "home-manager_2",
"nixpkgs": "nixpkgs_3",
"nixvim": "nixvim",
"plasma-manager": "plasma-manager"
}
},
"systems": {
"locked": {
"lastModified": 1689347949,
"narHash": "sha256-12tWmuL2zgBgZkdoB6qXZsgJEH9LR3oUgpaQq2RbI80=",
"owner": "nix-systems",
"repo": "default-linux",
"rev": "31732fcf5e8fea42e59c2488ad31a0e651500f68",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default-linux",
"type": "github"
}
},
"systems_2": {
"locked": {
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
"owner": "nix-systems",
"repo": "default",
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default",
"type": "github"
}
}
},
"root": "root",
"version": 7
}

73
flake.nix Normal file
View file

@ -0,0 +1,73 @@
{
description = "NixOS build";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-unstable";
flatpaks.url = "github:GermanBread/declarative-flatpak/stable-v3";
home-manager = {
url = "github:nix-community/home-manager";
inputs.nixpkgs.follows = "nixpkgs";
};
plasma-manager = {
url = "github:nix-community/plasma-manager";
inputs.nixpkgs.follows = "nixpkgs";
inputs.home-manager.follows = "home-manager";
};
nixvim = {
url = "github:EsVagy42/nixvim";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs =
{ nixpkgs, home-manager, plasma-manager, flatpaks, nixvim, ... }@inputs:
let
system = "x86_64-linux";
pkgs = import nixpkgs {
inherit system;
config.allowUnfree = false;
};
lib = nixpkgs.lib;
in {
nixosConfigurations = {
nixos = lib.nixosSystem {
inherit system;
modules = [
{
environment.systemPackages =
[ inputs.nixvim.packages.${system}.default ];
}
./configuration.nix
./devices/default/default.nix
home-manager.nixosModules.home-manager
{
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
home-manager.sharedModules =
[ plasma-manager.homeManagerModules.plasma-manager ];
home-manager.users.esvagy = { imports = [ ./home.nix ]; };
}
flatpaks.nixosModules.declarative-flatpak
];
};
alt = lib.nixosSystem {
inherit system;
modules = [
./configuration.nix
./devices/alt/alt.nix
home-manager.nixosModules.home-manager
{
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
home-manager.sharedModules =
[ plasma-manager.homeManagerModules.plasma-manager ];
home-manager.users.esvagy = { imports = [ ./home.nix ]; };
}
flatpaks.nixosModules.declarative-flatpak
];
};
};
};
}

52
home.nix Normal file
View file

@ -0,0 +1,52 @@
{ config, pkgs, lib, ... }:
{
# Home Manager needs a bit of information about you and the
# paths it should manage.
home.username = "esvagy";
home.homeDirectory = "/home/esvagy";
imports = [ ./plasma-configuration.nix ];
# This value determines the Home Manager release that your
# configuration is compatible with. This helps avoid breakage
# when a new Home Manager release introduces backwards
# incompatible changes.
#
# You can update Home Manager without changing this value. See
# the Home Manager release notes for a list of state version
# changes in each release.
home.stateVersion = "24.05";
# Let Home Manager install and manage itself.
programs.home-manager.enable = true;
programs.git = {
enable = true;
userName = "EsVagy42";
userEmail = "sltamagotchi@gmail.com";
};
home.file."Games/roms" = {
source = ./roms;
recursive = true;
};
home.file.".config/konsolerc" = { source = ./konsole/konsolerc; };
home.file.".local/share/konsole/Konsole.profile" = {
source = ./konsole/Konsole.profile;
};
home.file.".local/share/kxmlgui5/konsole" = {
source = ./konsole/toolbars;
recursive = true;
};
home.file.".config/autostart" = {
source = ./startup;
recursive = true;
};
home.file.".config/mimeapps.list" = { source = ./mimeapps/mimeapps.list; };
}

6
konsole/Konsole.profile Normal file
View file

@ -0,0 +1,6 @@
[Appearance]
Font=Hack Nerd Font,16,-1,5,400,0,0,0,0,0,0,0,0,0,0,1
[General]
Name=Konsole
Parent=FALLBACK/

10
konsole/konsolerc Normal file
View file

@ -0,0 +1,10 @@
MenuBar=Disabled
[Desktop Entry]
DefaultProfile=Konsole.profile
[General]
ConfigVersion=1
[UiSettings]
ColorScheme=

View file

@ -0,0 +1,103 @@
<!DOCTYPE gui>
<gui name="konsole" translationDomain="kxmlgui6" version="20">
<MenuBar alreadyVisited="1">
<Menu alreadyVisited="1" name="file" noMerge="1">
<text translationDomain="kxmlgui6">&amp;File</text>
<Action name="new-window"/>
<Action name="new-tab"/>
<Action name="clone-tab"/>
<Separator/>
<DefineGroup name="session-operations"/>
<Separator/>
<DefineGroup name="session-tab-operations"/>
<Action name="close-window"/>
</Menu>
<Menu alreadyVisited="1" name="edit" noMerge="1">
<text translationDomain="kxmlgui6">&amp;Edit</text>
<DefineGroup name="session-edit-operations"/>
</Menu>
<Menu alreadyVisited="1" name="view" noMerge="1">
<text translationDomain="kxmlgui6">&amp;View</text>
<Menu name="view-split" noMerge="1">
<text translationDomain="konsole">Split View</text>
<Action name="split-view-left-right"/>
<Action name="split-view-top-bottom"/>
<Action name="split-view-left-right-next-tab"/>
<Action name="split-view-top-bottom-next-tab"/>
<Action name="close-active-view"/>
<Action name="close-other-views"/>
<Action name="expand-active-view"/>
<Action name="shrink-active-view"/>
<Action name="toggle-maximize-current-view"/>
<Action name="equal-size-view"/>
</Menu>
<Separator/>
<Action name="detach-tab"/>
<Action name="detach-view"/>
<Action name="save-layout"/>
<Action name="load-layout"/>
<Separator/>
<DefineGroup name="session-view-operations"/>
<Separator weakSeparator="1"/>
<Action name="fullscreen"/>
</Menu>
<Action name="bookmark"/>
<Menu name="plugins" noMerge="1">
<text translationDomain="konsole">Plugins</text>
<ActionList name="plugin-submenu"/>
</Menu>
<Menu alreadyVisited="1" name="settings" noMerge="1">
<text translationDomain="kxmlgui6">&amp;Settings</text>
<DefineGroup name="session-settings"/>
<Action name="manage-profiles"/>
<Action name="show-menubar"/>
<Action name="window-colorscheme-menu"/>
<Separator/>
<Action name="view-full-screen"/>
<Separator/>
<Action name="configure-shortcuts"/>
<Action name="configure-notifications"/>
<Action name="configure-settings"/>
<Separator weakSeparator="1"/>
<Action name="options_show_menubar"/>
<Merge name="StandardToolBarMenuHandler"/>
<Merge name="KMDIViewActions"/>
<Separator weakSeparator="1"/>
<Action name="switch_application_language"/>
<Action name="options_configure_keybinding"/>
<Action name="options_configure_toolbars"/>
<Action name="options_configure_notifications"/>
<Action name="options_configure"/>
</Menu>
<Separator weakSeparator="1"/>
<Menu alreadyVisited="1" name="help" noMerge="1">
<text translationDomain="kxmlgui6">&amp;Help</text>
<Action name="help_contents"/>
<Action name="help_whats_this"/>
<Action name="open_kcommand_bar"/>
<Separator weakSeparator="1"/>
<Action name="help_report_bug"/>
<Separator weakSeparator="1"/>
<Action name="help_donate"/>
<Separator weakSeparator="1"/>
<Action name="help_about_app"/>
<Action name="help_about_kde"/>
</Menu>
</MenuBar>
<ToolBar alreadyVisited="1" name="mainToolBar" noMerge="1">
<text translationDomain="kxmlgui6">Main Toolbar</text>
<index>0</index>
</ToolBar>
<ActionProperties scheme="Default">
<Action name="detach-view" shortcut="; "/>
<Action name="fullscreen" shortcut=""/>
<Action name="next-tab" shortcut="Ctrl+Alt+Shift+L; Ctrl+PgDown"/>
<Action name="previous-tab" shortcut="Ctrl+Alt+Shift+H; Ctrl+PgUp"/>
<Action name="focus-view-above" shortcut="Ctrl+Shift+K"/>
<Action name="focus-view-below" shortcut="Ctrl+Shift+J"/>
<Action name="focus-view-left" shortcut="Ctrl+Shift+H"/>
<Action name="focus-view-right" shortcut="Ctrl+Shift+L"/>
<Action name="move-tab-to-right" shortcut="Ctrl+Alt+Shift+J"/>
<Action name="move-tab-to-left" shortcut="Ctrl+Alt+Shift+K"/>
</ActionProperties>
</gui>

View file

@ -0,0 +1,88 @@
<!DOCTYPE gui>
<gui name="session" translationDomain="kxmlgui6" version="36">
<MenuBar alreadyVisited="1">
<Menu alreadyVisited="1" name="file" noMerge="1">
<Action group="session-operations" name="file_save_as"/>
<Action group="session-operations" name="file-autosave"/>
<Action group="session-operations" name="stop-autosave"/>
<Separator group="session-operations"/>
<Action group="session-operations" name="file_print"/>
<Separator group="session-operations"/>
<Action group="session-operations" name="open-browser"/>
<Action group="session-tab-operations" name="close-session"/>
</Menu>
<Menu alreadyVisited="1" name="edit" noMerge="1">
<Action group="session-edit-operations" name="edit_copy"/>
<Action group="session-edit-operations" name="edit_paste"/>
<Separator group="session-edit-operations"/>
<Action group="session-edit-operations" name="select-all"/>
<Action group="session-edit-operations" name="select-mode"/>
<Separator group="session-edit-operations"/>
<Action group="session-edit-operations" name="copy-input-to"/>
<Action group="session-edit-operations" name="send-signal"/>
<Action group="session-edit-operations" name="rename-session"/>
<Action group="session-edit-operations" name="zmodem-upload"/>
<Separator group="session-edit-operations"/>
<Action group="session-edit-operations" name="edit_find"/>
<Action group="session-edit-operations" name="edit_find_next"/>
<Action group="session-edit-operations" name="edit_find_prev"/>
</Menu>
<Menu alreadyVisited="1" name="view" noMerge="1">
<Action group="session-view-operations" name="monitor-once"/>
<Action group="session-view-operations" name="monitor-prompt"/>
<Action group="session-view-operations" name="monitor-silence"/>
<Action group="session-view-operations" name="monitor-activity"/>
<Action group="session-view-operations" name="monitor-process-finish"/>
<Separator group="session-view-operations"/>
<Action group="session-view-operations" name="view-readonly"/>
<Action group="session-view-operations" name="allow-mouse-tracking"/>
<Separator group="session-view-operations"/>
<Action group="session-view-operations" name="enlarge-font"/>
<Action group="session-view-operations" name="reset-font-size"/>
<Action group="session-view-operations" name="shrink-font"/>
<Action group="session-view-operations" name="set-encoding"/>
<Separator group="session-view-operations"/>
<Action group="session-view-operations" name="clear-history"/>
<Action group="session-view-operations" name="clear-history-and-reset"/>
</Menu>
<Menu alreadyVisited="1" name="settings" noMerge="1">
<Action group="session-settings" name="edit-current-profile"/>
<Action group="session-settings" name="switch-profile"/>
</Menu>
</MenuBar>
<ToolBar name="mainToolBar" noMerge="1">
<text translationDomain="kxmlgui6">Main Toolbar</text>
</ToolBar>
<Menu name="session-popup-menu" noMerge="1">
<Action name="edit_copy_contextmenu"/>
<Action name="edit_copy_contextmenu_in"/>
<Action name="edit_copy_contextmenu_out"/>
<Action name="edit_copy_contextmenu_in_out"/>
<Action name="edit_paste"/>
<Action name="web-search"/>
<Action name="open-browser"/>
<Separator/>
<Menu name="view-split" noMerge="1">
<text translationDomain="konsole">Split View</text>
<Action name="split-view-left-right"/>
<Action name="split-view-top-bottom"/>
</Menu>
<Separator/>
<Action name="set-encoding"/>
<Action name="clear-history"/>
<Action name="adjust-history"/>
<Separator/>
<Action name="view-readonly"/>
<Action name="allow-mouse-tracking"/>
<Separator/>
<Action name="switch-profile"/>
<Action name="edit-current-profile"/>
</Menu>
<ToolBar name="sessionToolbar" noMerge="1">
<text translationDomain="konsole">Session Toolbar</text>
<index>1</index>
</ToolBar>
<ActionProperties scheme="Default">
<Action name="clear-history-and-reset" shortcut="; "/>
</ActionProperties>
</gui>

20
mimeapps/mimeapps.list Normal file
View file

@ -0,0 +1,20 @@
[Added Associations]
application/json=nvim.desktop;
application/x-docbook+xml=nvim.desktop;
application/x-yaml=nvim.desktop;
text/markdown=nvim.desktop;
text/plain=nvim.desktop;
text/x-cmake=nvim.desktop;
x-scheme-handler/http=brave-browser.desktop;
x-scheme-handler/https=brave-browser.desktop;
[Default Applications]
application/json=nvim.desktop;
application/x-docbook+xml=nvim.desktop;
application/x-yaml=nvim.desktop;
text/markdown=nvim.desktop;
text/plain=nvim.desktop;
text/x-cmake=nvim.desktop;
x-scheme-handler/element=Beeper.desktop
x-scheme-handler/http=brave-browser.desktop;
x-scheme-handler/https=brave-browser.desktop;

1792
plasma-configuration.nix Normal file

File diff suppressed because it is too large Load diff

290
rc2nix.py Executable file
View file

@ -0,0 +1,290 @@
#!/usr/bin/env python
# https://github.com/nix-community/plasma-manager/blob/trunk/script/rc2nix.py
# https://github.com/mcdonc/plasma-manager/blob/enable-look-and-feel-settings/script/rc2nix.rb
################################################################################
#
# This file is part of the package Plasma Manager. It is subject to
# the license terms in the LICENSE file found in the top-level
# directory of this distribution and at:
#
# https://github.com/nix-community/plasma-manager
#
# No part of this package, including this file, may be copied,
# modified, propagated, or distributed except according to the terms
# contained in the LICENSE file.
#
################################################################################
import os
import re
import sys
from pathlib import Path
from typing import Callable, Dict, List, Optional, Tuple
# The root directory where configuration files are stored.
XDG_CONFIG_HOME: str = os.path.expanduser(os.getenv("XDG_CONFIG_HOME", "~/.config"))
XDG_DATA_HOME: str = os.path.expanduser(os.getenv("XDG_DATA_HOME", "~/.local/share"))
class Rc2Nix:
# Files that we'll scan by default.
KNOWN_CONFIG_FILES: List[str] = [
os.path.join(XDG_CONFIG_HOME, f)
for f in [
"kcminputrc",
"kglobalshortcutsrc",
"kactivitymanagerdrc",
"ksplashrc",
"kwin_rules_dialogrc",
"kmixrc",
"kwalletrc",
"kgammarc",
"krunnerrc",
"klaunchrc",
"plasmanotifyrc",
"systemsettingsrc",
"kscreenlockerrc",
"kwinrulesrc",
"khotkeysrc",
"ksmserverrc",
"kded5rc",
"plasmarc",
"kwinrc",
"kdeglobals",
"baloofilerc",
"dolphinrc",
"klipperrc",
"plasma-localerc",
"kxkbrc",
"ffmpegthumbsrc",
"kservicemenurc",
"kiorc",
"ktrashrc",
"kuriikwsfilterrc",
"plasmaparc",
"spectaclerc",
"katerc",
"plasma-org.kde.plasma.desktop-appletsrc",
]
]
KNOWN_DATA_FILES: List[str] = [
os.path.join(XDG_DATA_HOME, f)
for f in [
"kate/anonymous.katesession",
"dolphin/view_properties/global/.directory",
]
]
class RcFile:
# Any group that matches a listed regular expression is blocked
GROUP_BLOCK_LIST: List[str] = [
r"^(ConfigDialog|FileDialogSize|ViewPropertiesDialog|KPropertiesDialog)$",
r"^\$Version$",
r"^ColorEffects:",
r"^Colors:",
r"^DoNotDisturb$",
r"^LegacySession:",
r"^MainWindow$",
r"^PlasmaViews",
r"^ScreenConnectors$",
r"^Session:",
r"^Recent (Files|URLs)",
]
# Similar to the GROUP_BLOCK_LIST but for setting keys.
KEY_BLOCK_LIST: List[str] = [
r"^activate widget \d+$", # Depends on state :(
r"^ColorScheme(Hash)?$",
r"^History Items",
# r"^LookAndFeelPackage$",
r"^Recent (Files|URLs)",
r"^Theme$i",
r"^Version$",
r"State$",
r"Timestamp$",
]
# List of functions that get called with a group name and a key name.
BLOCK_LIST_LAMBDA: List[Callable[[str, str], bool]] = [
lambda group, key: group == "org.kde.kdecoration2" and key == "library"
]
def __init__(self, file_name: str):
self.file_name: str = file_name
self.settings: Dict[str, Dict[str, str]] = {}
self.last_group: Optional[str] = None
def parse(self):
def is_group_line(line: str) -> bool:
return re.match(r"^\s*(\[[^\]]+\])+\s*$", line) is not None
def is_setting_line(line: str) -> bool:
return re.match(r"^\s*([^=]+)=?(.*)\s*$", line) is not None
def parse_group(line: str) -> str:
return re.sub(
r"\s*\[([^\]]+)\]\s*", r"\1/", line.replace("/", "\\\\/")
).rstrip("/")
def parse_setting(line: str) -> Tuple[str, str]:
match = re.match(r"^\s*([^=]+)=?(.*)\s*$", line)
if match:
return match.groups() # type: ignore
raise Exception(f"{self.file_name}: can't parse setting line: {line}")
with open(self.file_name, "r") as file:
for line in file:
line = line.strip()
if not line:
continue
if is_group_line(line):
self.last_group = parse_group(line)
elif is_setting_line(line):
key, val = parse_setting(line)
self.process_setting(key, val)
else:
raise Exception(f"{self.file_name}: can't parse line: {line}")
def process_setting(self, key: str, val: str):
def should_skip_group(group: str) -> bool:
return any(re.match(reg, group) for reg in self.GROUP_BLOCK_LIST)
def should_skip_key(key: str) -> bool:
return any(re.match(reg, key) for reg in self.KEY_BLOCK_LIST)
def should_skip_by_lambda(group: str, key: str) -> bool:
return any(fn(group, key) for fn in self.BLOCK_LIST_LAMBDA)
key = key.strip()
val = val.strip()
if self.last_group is None:
raise Exception(
f"{self.file_name}: setting outside of group: {key}={val}"
)
if (
should_skip_group(self.last_group)
or should_skip_key(key)
or should_skip_by_lambda(self.last_group, key)
):
return
if self.last_group not in self.settings:
self.settings[self.last_group] = {}
self.settings[self.last_group][key] = val
class App:
def __init__(self, args: List[str]):
self.config_files: List[str] = Rc2Nix.KNOWN_CONFIG_FILES.copy()
self.data_files: List[str] = Rc2Nix.KNOWN_DATA_FILES.copy()
self.config_settings: Dict[str, Dict[str, Dict[str, str]]] = {}
self.data_settings: Dict[str, Dict[str, Dict[str, str]]] = {}
def run(self):
for file in self.config_files:
if not os.path.exists(file):
continue
rc = Rc2Nix.RcFile(file)
rc.parse()
path = Path(file).relative_to(XDG_CONFIG_HOME)
self.config_settings[str(path)] = rc.settings
for file in self.data_files:
if not os.path.exists(file):
continue
rc = Rc2Nix.RcFile(file)
rc.parse()
path = Path(file).relative_to(XDG_DATA_HOME)
self.data_settings[str(path)] = rc.settings
self.print_output()
def print_output(self):
print("{")
print(" programs.plasma = {")
print(" enable = true;")
print(" shortcuts = {")
print(
self.pp_shortcuts(self.config_settings.get("kglobalshortcutsrc", {}), 6)
)
print(" };")
print(" configFile = {")
print(self.pp_settings(self.config_settings, 6))
print(" };")
print(" dataFile = {")
print(self.pp_settings(self.data_settings, 6))
print(" };")
print(" };")
print("}")
def pp_settings(
self, settings: Dict[str, Dict[str, Dict[str, str]]], indent: int
) -> str:
result: List[str] = []
for file in sorted(settings.keys()):
if file != "kglobalshortcutsrc":
for group in sorted(settings[file].keys()):
for key in sorted(settings[file][group].keys()):
if key != "_k_friendly_name":
result.append(
f"{' ' * indent}\"{file}\".\"{group}\".\"{key}\" = {nix_val(settings[file][group][key])};"
)
return "\n".join(result)
def pp_shortcuts(self, groups: Dict[str, Dict[str, str]], indent: int) -> str:
if not groups:
return ""
result: List[str] = []
for group in sorted(groups.keys()):
for action in sorted(groups[group].keys()):
if action != "_k_friendly_name":
keys = (
groups[group][action]
.split(r"(?<!\\),")[0]
.replace(r"\?", ",")
.replace(r"\t", "\t")
.split("\t")
)
if not keys or keys[0] == "none":
keys_str = "[ ]"
elif len(keys) > 1:
keys_str = (
f"[{' '.join(nix_val(k.rstrip(',')) for k in keys)}]"
)
else:
ks = keys[0].split(",")
k = ks[0] if len(ks) == 3 and ks[0] == ks[1] else keys[0]
keys_str = (
"[ ]"
if k == "" or k == "none"
else nix_val(k.rstrip(","))
)
result.append(
f"{' ' * indent}\"{group}\".\"{action}\" = {keys_str};"
)
return "\n".join(result)
def nix_val(s: Optional[str]) -> str:
if s is None:
return "null"
if re.match(r"^(true|false)$", s, re.IGNORECASE):
return s.lower()
if re.match(r"^[0-9]+(\.[0-9]+)?$", s):
return s
return '"' + re.sub(r'(?<!\\)"', r'\\"', s) + '"'
Rc2Nix.App(sys.argv[1:]).run()

17
startup/Beeper.desktop Executable file
View file

@ -0,0 +1,17 @@
[Desktop Entry]
Comment[en_US]=
Comment=
Exec=beeper --hidden
GenericName[en_US]=
GenericName=
Icon=system-run
MimeType=
Name[en_US]=Beeper
Name=Beeper
Path=
StartupNotify=true
Terminal=false
TerminalOptions=
Type=Application
X-KDE-SubstituteUID=false
X-KDE-Username=