Compare commits
9 Commits
574e91135f
...
2675e4077e
| Author | SHA1 | Date | |
|---|---|---|---|
| 2675e4077e | |||
| 65ab024e29 | |||
| dd81c4f902 | |||
|
3b73704165
|
|||
|
d6b6751ebd
|
|||
|
fc166785ee
|
|||
|
cf289c8c48
|
|||
|
5e6abe53f2
|
|||
|
0df3b7ebde
|
@@ -43,8 +43,13 @@
|
||||
imports = [
|
||||
inputs.home-manager.flakeModules.home-manager
|
||||
./hosts/comfy-station
|
||||
./hosts/monolith
|
||||
./hosts/harbor
|
||||
(./home + "/jonas@comfy-station")
|
||||
(./home + "/jonas@monolith")
|
||||
(./home + "/jonas@harbor")
|
||||
(import-tree ./modules)
|
||||
(import-tree ./templates)
|
||||
];
|
||||
};
|
||||
}
|
||||
|
||||
@@ -22,13 +22,12 @@
|
||||
keys = ["borg" "passgit"];
|
||||
};
|
||||
hive.yubikey.withCCID = false;
|
||||
#hive.doom.enable = true;
|
||||
#hive.doom.asDefaultEditor = true;
|
||||
#hive.doom.enableCopilot = true;
|
||||
#hive.doom.withNixPkgs = true;
|
||||
#hive.doom.withShellPkgs = true;
|
||||
#hive.doom.withPythonPkgs = true;
|
||||
#hive.jj.enable = true;
|
||||
hive.doom.enable = true;
|
||||
hive.doom.asDefaultEditor = true;
|
||||
hive.doom.enableCopilot = true;
|
||||
hive.doom.withNixPkgs = true;
|
||||
hive.doom.withShellPkgs = true;
|
||||
hive.doom.withPythonPkgs = true;
|
||||
|
||||
# Make session variables available in systemd units
|
||||
# SEE: https://github.com/nix-community/home-manager/pull/5543
|
||||
|
||||
@@ -27,6 +27,8 @@
|
||||
self.homeModules.yubikey
|
||||
self.homeModules.zsh
|
||||
self.homeModules.nix-scripts
|
||||
self.homeModules.doom
|
||||
self.homeModules.jj
|
||||
];
|
||||
};
|
||||
}
|
||||
|
||||
41
home/jonas@harbor/configuration.nix
Normal file
@@ -0,0 +1,41 @@
|
||||
{lib, ...}: {
|
||||
# Home Manager needs a bit of information about you and the paths it should
|
||||
# manage.
|
||||
home.username = "jonas";
|
||||
home.homeDirectory = "/home/jonas";
|
||||
|
||||
# hive modules
|
||||
hive.doom.enable = true;
|
||||
hive.doom.asDefaultEditor = true;
|
||||
hive.doom.withNixPkgs = true;
|
||||
hive.doom.withShellPkgs = true;
|
||||
|
||||
# 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 should not change this value, even if you update Home Manager. If you do
|
||||
# want to update the value, then make sure to first check the Home Manager
|
||||
# release notes.
|
||||
home.stateVersion = "24.11"; # Please read the comment before changing.
|
||||
|
||||
home.sessionVariables = {
|
||||
EDITOR = lib.mkDefault "vim";
|
||||
};
|
||||
|
||||
# Let Home Manager install and manage itself.
|
||||
programs.home-manager.enable = true;
|
||||
|
||||
# Git
|
||||
programs.difftastic.enable = true;
|
||||
programs.difftastic.git.enable = true;
|
||||
programs.git = {
|
||||
enable = true;
|
||||
settings.user.name = "Jonas Röger";
|
||||
settings.user.email = "jonas.roeger@tu-dortmund.de";
|
||||
signing = {
|
||||
signByDefault = true;
|
||||
key = "4000EB35E1AE0F07";
|
||||
};
|
||||
};
|
||||
}
|
||||
21
home/jonas@harbor/default.nix
Normal file
@@ -0,0 +1,21 @@
|
||||
{
|
||||
self,
|
||||
inputs,
|
||||
...
|
||||
}: {
|
||||
flake.homeConfigurations."jonas@harbor" = inputs.home-manager.lib.homeManagerConfiguration {
|
||||
pkgs = import inputs.nixpkgs {system = "x86_64-linux";};
|
||||
modules = [
|
||||
({...}: {nixpkgs.config.allowUnfree = true;})
|
||||
|
||||
./configuration.nix
|
||||
|
||||
inputs.sops-nix.homeManagerModules.sops
|
||||
self.homeModules.ranger
|
||||
self.homeModules.zsh
|
||||
self.homeModules.nix-scripts
|
||||
self.homeModules.doom
|
||||
self.homeModules.jj
|
||||
];
|
||||
};
|
||||
}
|
||||
90
home/jonas@monolith/configuration.nix
Normal file
@@ -0,0 +1,90 @@
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
...
|
||||
}: rec {
|
||||
# Home Manager needs a bit of information about you and the paths it should
|
||||
# manage.
|
||||
home.username = "jonas";
|
||||
home.homeDirectory = "/home/jonas";
|
||||
|
||||
sops = {
|
||||
age.keyFile = "${home.homeDirectory}/.config/sops/age/keys.txt";
|
||||
};
|
||||
sops.secrets.gotifyDaemonToken = {
|
||||
sopsFile = ../../secrets/jonas/gotify.yaml;
|
||||
key = "monolithDesktopToken";
|
||||
};
|
||||
sops.secrets.gotifyCLIToken = {
|
||||
sopsFile = ../../secrets/jonas/gotify.yaml;
|
||||
key = "cliToken";
|
||||
};
|
||||
|
||||
# hive moduless
|
||||
hive.doom.enable = true;
|
||||
hive.doom.asDefaultEditor = true;
|
||||
hive.doom.enableCopilot = false;
|
||||
hive.doom.enableTidal = false;
|
||||
hive.doom.withNixPkgs = true;
|
||||
hive.doom.withShellPkgs = true;
|
||||
hive.doom.withPythonPkgs = true;
|
||||
hive.gotify = {
|
||||
daemon.enable = true;
|
||||
cli.tokenSopsKey = config.sops.secrets.gotifyCLIToken.name;
|
||||
daemon.tokenSopsKey = config.sops.secrets.gotifyDaemonToken.name;
|
||||
host = "gotify.jroeger.de";
|
||||
};
|
||||
|
||||
# Make session variables available in systemd units
|
||||
# SEE: https://github.com/nix-community/home-manager/pull/5543
|
||||
# systemd.user.settings.Manager.DefaultEnvironment =
|
||||
# lib.mapAttrs (_: lib.mkDefault) config.home.sessionVariables;
|
||||
|
||||
xdg.mimeApps = {
|
||||
enable = true;
|
||||
|
||||
defaultApplications = {
|
||||
"text/html" = "firefox.desktop";
|
||||
"x-scheme-handler/http" = "firefox.desktop";
|
||||
"x-scheme-handler/https" = "firefox.desktop";
|
||||
"x-scheme-handler/about" = "firefox.desktop";
|
||||
"x-scheme-handler/unknown" = "firefox.desktop";
|
||||
};
|
||||
};
|
||||
xdg.userDirs.enable = true;
|
||||
xdg.userDirs.createDirectories = true;
|
||||
xdg.userDirs.extraConfig = {
|
||||
XDG_WORKSPACES_DIR = "${config.home.homeDirectory}/Workspaces";
|
||||
XDG_NEXTCLOUD_DIR = "${config.home.homeDirectory}/Nextcloud";
|
||||
XDG_NOTES_DIR = "${config.home.homeDirectory}/Notes";
|
||||
};
|
||||
|
||||
# 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 should not change this value, even if you update Home Manager. If you do
|
||||
# want to update the value, then make sure to first check the Home Manager
|
||||
# release notes.
|
||||
home.stateVersion = "24.11"; # Please read the comment before changing.
|
||||
|
||||
home.sessionVariables = {
|
||||
EDITOR = lib.mkDefault "vim";
|
||||
};
|
||||
|
||||
# Let Home Manager install and manage itself.
|
||||
programs.home-manager.enable = true;
|
||||
|
||||
# Git
|
||||
programs.difftastic.enable = true;
|
||||
programs.difftastic.git.enable = true;
|
||||
programs.git = {
|
||||
enable = true;
|
||||
settings.user.name = "Jonas Röger";
|
||||
settings.user.email = "jonas.roeger@tu-dortmund.de";
|
||||
signing = {
|
||||
signByDefault = true;
|
||||
key = "4000EB35E1AE0F07";
|
||||
};
|
||||
};
|
||||
}
|
||||
27
home/jonas@monolith/default.nix
Normal file
@@ -0,0 +1,27 @@
|
||||
{
|
||||
self,
|
||||
inputs,
|
||||
...
|
||||
}: {
|
||||
flake.homeConfigurations."jonas@monolith" = inputs.home-manager.lib.homeManagerConfiguration {
|
||||
pkgs = import inputs.nixpkgs {system = "x86_64-linux";};
|
||||
modules = [
|
||||
({...}: {nixpkgs.config.allowUnfree = true;})
|
||||
|
||||
./configuration.nix
|
||||
|
||||
inputs.sops-nix.homeManagerModules.sops
|
||||
self.homeModules.layan
|
||||
self.homeModules.nextcloud-client
|
||||
self.homeModules.firefox
|
||||
self.homeModules.kdeconnect
|
||||
self.homeModules.ranger
|
||||
self.homeModules.yubikey
|
||||
self.homeModules.zsh
|
||||
self.homeModules.nix-scripts
|
||||
self.homeModules.doom
|
||||
self.homeModules.jj
|
||||
self.homeModules.gotify
|
||||
];
|
||||
};
|
||||
}
|
||||
152
hosts/harbor/configuration.nix
Normal file
@@ -0,0 +1,152 @@
|
||||
{
|
||||
config,
|
||||
pkgs,
|
||||
...
|
||||
}: {
|
||||
imports = [
|
||||
./hardware-configuration.nix
|
||||
./disko.nix
|
||||
];
|
||||
|
||||
# Secret management
|
||||
sops.age.keyFile = "/var/lib/sops-nix/key.txt";
|
||||
sops.secrets."nextcloud-admin-pass" = {
|
||||
sopsFile = ../../secrets/harbor/nextcloud.yaml;
|
||||
owner = "nextcloud";
|
||||
key = "admin-pass";
|
||||
};
|
||||
sops.secrets."wg-priv" = {
|
||||
sopsFile = ../../secrets/harbor/wg.yaml;
|
||||
key = "privateKey";
|
||||
};
|
||||
sops.secrets."gitea-db-pass" = {
|
||||
sopsFile = ../../secrets/harbor/gitea.yaml;
|
||||
owner = config.services.gitea.user;
|
||||
key = "databasePassword";
|
||||
};
|
||||
sops.secrets."gotify-admin-pass" = {
|
||||
sopsFile = ../../secrets/harbor/gotify.yaml;
|
||||
owner = config.hive.gotify-instance.user;
|
||||
key = "adminPassword";
|
||||
};
|
||||
|
||||
# gc settings and binary caches
|
||||
nix = {
|
||||
settings = {
|
||||
substituters = [
|
||||
"https://aseipp-nix-cache.freetls.fastly.net"
|
||||
"https://nix-community.cachix.org"
|
||||
"https://cache.nixos.org/"
|
||||
];
|
||||
experimental-features = ["nix-command" "flakes"];
|
||||
auto-optimise-store = true;
|
||||
};
|
||||
gc = {
|
||||
automatic = true;
|
||||
dates = "weekly";
|
||||
options = "--delete-older-than 30d";
|
||||
};
|
||||
};
|
||||
|
||||
# user with ssh access
|
||||
users.users.jonas = {
|
||||
isNormalUser = true;
|
||||
description = "Jonas";
|
||||
extraGroups = ["wheel"];
|
||||
openssh.authorizedKeys.keys = [
|
||||
"ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQCyCyYsMSiy7shcehlzJEbCyRiHk+cicFB35Bc2uc4PjjkCjswLh01fRAV2QcplrNkH/5F4GBTbOoZHHc7/AVLyUxgwDC9ffD2i7fevuGpfBFy9D30uz6jDekxXkmRmIlidXLdG1Fh4zwVejGlwdhUu/Zb7PonO/dktx3EFdf1SpnW+y75anN85zoGsld7KQk42wEd0zXtCgx4CKI6Vvt6heWCEiJ9wyw1sLpTJr4H8In236CUj1/r1qY9Gfa8n9NA0J9XCpcwSCEWGRKQNicoQIpnp5txrgzaUq4r6qBKHmImYXmSTVnDZ9dJLRYNu2lDvBtTXP4ztlR6Lpxs873fPg51qgaX9rRVMMo/gGjq8fOFWsDVaJZab9VY3hZYNCKIbWFqo4GKyCQs9Xfzr2AUACm09HWiYMTefwEypOzvUb4z+LF2B/0c5XmghLF/TOzLVgDXzAgWMH4mCnPh9EDLHTtoJaGNURler9VRV8yQyLH6oK9UpHZovCFs7HpFN+WPv2QVFfkK8aHg7tnklFsT78z154bjuspiEI/fFGmTxoQUGufmHlRy/9GQDusgNfe24ZEB2hHBVjKv29XdIfvFAhoPVpA6+O/N3feSlmVISaU+8QraVQEf/TuQjopDUWpJTmqSxKvQSTPwcyWDy6NtcJ85bGAu6jSUGC3ouH4Rb2Q== cardno:000609618602"
|
||||
];
|
||||
};
|
||||
users.defaultUserShell = pkgs.zsh;
|
||||
programs.zsh.enable = true;
|
||||
services.openssh = {
|
||||
enable = true;
|
||||
settings.PasswordAuthentication = false;
|
||||
settings.KbdInteractiveAuthentication = false;
|
||||
};
|
||||
|
||||
# hive modules
|
||||
hive.virt-manager.enable = true;
|
||||
hive.virt-manager.forUsers = ["jonas"];
|
||||
hive.gitea-instance.enable = true;
|
||||
hive.gitea-instance.nativeRunner = true;
|
||||
hive.gitea-instance.instanceFQDN = "git.jroeger.de";
|
||||
hive.gitea-instance.databasePasswordFile = config.sops.secrets.gitea-db-pass.path;
|
||||
hive.gotify-instance.enable = true;
|
||||
hive.gotify-instance.instanceFQDN = "gotify.jroeger.de";
|
||||
hive.gotify-instance.adminPasswordSopsKey = config.sops.secrets.gotify-admin-pass.name;
|
||||
hive.nextcloud-instance.enable = true;
|
||||
hive.nextcloud-instance.ssl = true;
|
||||
hive.nextcloud-instance.adminPasswordFile = config.sops.secrets.nextcloud-admin-pass.path;
|
||||
hive.nextcloud-instance.instanceFQDN = "nextcloud.jroeger.de";
|
||||
hive.minecraft-server.enable = true;
|
||||
hive.borg-server.enable = true;
|
||||
hive.borg-server.repositories.comfy-station.ssh_public_key = builtins.readFile (../../static/keys + "/borg-jonas@comfy-station.pub");
|
||||
hive.wg.server.enable = true;
|
||||
hive.wg.server.privateKeyFile = config.sops.secrets.wg-priv.path;
|
||||
|
||||
# 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. It‘s 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 = "25.11"; # Did you read the comment?
|
||||
|
||||
# VPS compat
|
||||
boot.loader.grub.enable = true;
|
||||
boot.loader.grub.device = "/dev/sda";
|
||||
boot.loader.grub.version = 2;
|
||||
boot.kernelParams = [
|
||||
"net.ifnames=0" # ensure iface is called eth0
|
||||
"ip=173.249.42.252::173.249.42.1:255.255.255.0:harbor:eth0:none:8.8.8.8"
|
||||
];
|
||||
networking.networkmanager.enable = true;
|
||||
networking = {
|
||||
# Static network configuration
|
||||
hostName = "harbor";
|
||||
domain = "jroeger.de";
|
||||
defaultGateway = "173.249.42.1";
|
||||
nameservers = ["8.8.8.8"];
|
||||
interfaces.eth0.ipv4.addresses = [
|
||||
{
|
||||
address = "173.249.42.252";
|
||||
prefixLength = 24;
|
||||
}
|
||||
];
|
||||
};
|
||||
# Temporary ssh server for disk unlock
|
||||
boot.initrd = {
|
||||
availableKernelModules = ["virtio_pci"];
|
||||
network = {
|
||||
enable = true;
|
||||
ssh = {
|
||||
enable = true;
|
||||
port = 2222;
|
||||
authorizedKeys = [
|
||||
"ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQCyCyYsMSiy7shcehlzJEbCyRiHk+cicFB35Bc2uc4PjjkCjswLh01fRAV2QcplrNkH/5F4GBTbOoZHHc7/AVLyUxgwDC9ffD2i7fevuGpfBFy9D30uz6jDekxXkmRmIlidXLdG1Fh4zwVejGlwdhUu/Zb7PonO/dktx3EFdf1SpnW+y75anN85zoGsld7KQk42wEd0zXtCgx4CKI6Vvt6heWCEiJ9wyw1sLpTJr4H8In236CUj1/r1qY9Gfa8n9NA0J9XCpcwSCEWGRKQNicoQIpnp5txrgzaUq4r6qBKHmImYXmSTVnDZ9dJLRYNu2lDvBtTXP4ztlR6Lpxs873fPg51qgaX9rRVMMo/gGjq8fOFWsDVaJZab9VY3hZYNCKIbWFqo4GKyCQs9Xfzr2AUACm09HWiYMTefwEypOzvUb4z+LF2B/0c5XmghLF/TOzLVgDXzAgWMH4mCnPh9EDLHTtoJaGNURler9VRV8yQyLH6oK9UpHZovCFs7HpFN+WPv2QVFfkK8aHg7tnklFsT78z154bjuspiEI/fFGmTxoQUGufmHlRy/9GQDusgNfe24ZEB2hHBVjKv29XdIfvFAhoPVpA6+O/N3feSlmVISaU+8QraVQEf/TuQjopDUWpJTmqSxKvQSTPwcyWDy6NtcJ85bGAu6jSUGC3ouH4Rb2Q== cardno:000609618602"
|
||||
];
|
||||
hostKeys = ["/etc/secrets/initrd/ssh_host_rsa_key"];
|
||||
shell = "/bin/cryptsetup-askpass";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
# Set your time zone.
|
||||
time.timeZone = "Europe/Berlin";
|
||||
|
||||
# Select internationalisation properties.
|
||||
i18n.defaultLocale = "en_US.UTF-8";
|
||||
i18n.extraLocaleSettings = {
|
||||
LC_ADDRESS = "de_DE.UTF-8";
|
||||
LC_IDENTIFICATION = "de_DE.UTF-8";
|
||||
LC_MEASUREMENT = "de_DE.UTF-8";
|
||||
LC_MONETARY = "de_DE.UTF-8";
|
||||
LC_NAME = "de_DE.UTF-8";
|
||||
LC_NUMERIC = "de_DE.UTF-8";
|
||||
LC_PAPER = "de_DE.UTF-8";
|
||||
LC_TELEPHONE = "de_DE.UTF-8";
|
||||
LC_TIME = "de_DE.UTF-8";
|
||||
};
|
||||
console.keyMap = "de";
|
||||
}
|
||||
25
hosts/harbor/default.nix
Normal file
@@ -0,0 +1,25 @@
|
||||
{
|
||||
inputs,
|
||||
self,
|
||||
...
|
||||
}: {
|
||||
flake.nixosConfigurations.harbor = inputs.nixpkgs.lib.nixosSystem {
|
||||
modules = [
|
||||
({...}: {
|
||||
nixpkgs.config.allowUnfree = true;
|
||||
})
|
||||
|
||||
./configuration.nix
|
||||
|
||||
inputs.sops-nix.nixosModules.sops
|
||||
inputs.disko.nixosModules.disko
|
||||
self.nixosModules.nix-scripts
|
||||
self.nixosModules.gitea-instance
|
||||
self.nixosModules.gotify-instance
|
||||
self.nixosModules.nextcloud-instance
|
||||
self.nixosModules.minecraft-server
|
||||
self.nixosModules.borg-server
|
||||
self.nixosModules.wireguard-server
|
||||
];
|
||||
};
|
||||
}
|
||||
71
hosts/harbor/disko.nix
Normal file
@@ -0,0 +1,71 @@
|
||||
let
|
||||
btrfsopt = [
|
||||
"compress=zstd"
|
||||
"noatime"
|
||||
"ssd"
|
||||
"space_cache=v2"
|
||||
"user_subvol_rm_allowed"
|
||||
];
|
||||
in {
|
||||
disko.devices = {
|
||||
disk = {
|
||||
main = {
|
||||
type = "disk";
|
||||
device = "/dev/sda";
|
||||
content = {
|
||||
type = "gpt";
|
||||
partitions = {
|
||||
boot = {
|
||||
name = "boot";
|
||||
size = "1M";
|
||||
type = "ef02";
|
||||
};
|
||||
esp = {
|
||||
name = "esp";
|
||||
size = "500M";
|
||||
type = "ef00";
|
||||
content = {
|
||||
type = "filesystem";
|
||||
format = "vfat";
|
||||
mountpoint = "/boot";
|
||||
};
|
||||
};
|
||||
luks = {
|
||||
size = "100%";
|
||||
content = {
|
||||
type = "luks";
|
||||
name = "nixos";
|
||||
passwordFile = "/tmp/pass";
|
||||
additionalKeyFiles = ["/nixos-enc.key"];
|
||||
extraFormatArgs = [
|
||||
"--type luks1"
|
||||
"--iter-time 3000"
|
||||
];
|
||||
settings = {
|
||||
allowDiscards = true;
|
||||
};
|
||||
content = {
|
||||
type = "btrfs";
|
||||
subvolumes = {
|
||||
"@root" = {
|
||||
mountpoint = "/";
|
||||
mountOptions = btrfsopt;
|
||||
};
|
||||
"@home" = {
|
||||
mountpoint = "/home";
|
||||
mountOptions = btrfsopt;
|
||||
};
|
||||
"@nix" = {
|
||||
mountpoint = "/nix";
|
||||
mountOptions = btrfsopt;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
21
hosts/harbor/hardware-configuration.nix
Normal file
@@ -0,0 +1,21 @@
|
||||
# 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 = ["ata_piix" "uhci_hcd" "virtio_pci" "virtio_scsi" "sd_mod" "sr_mod"];
|
||||
boot.initrd.kernelModules = [];
|
||||
boot.kernelModules = [];
|
||||
boot.extraModulePackages = [];
|
||||
|
||||
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
|
||||
}
|
||||
210
hosts/monolith/configuration.nix
Normal file
@@ -0,0 +1,210 @@
|
||||
# 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,
|
||||
...
|
||||
}: {
|
||||
imports = [
|
||||
# Include the results of the hardware scan.
|
||||
./hardware-configuration.nix
|
||||
];
|
||||
|
||||
# Secret management
|
||||
sops.age.keyFile = "/var/lib/sops-nix/key.txt";
|
||||
sops.secrets.wg-priv = {
|
||||
sopsFile = ../../secrets/monolith/wg.yaml;
|
||||
key = "privateKey";
|
||||
};
|
||||
sops.secrets.spotifyShortcutsClientId = {
|
||||
sopsFile = ../../secrets/spotify-shortcuts.yaml;
|
||||
key = "clientId";
|
||||
};
|
||||
sops.secrets.spotifyShortcutsClientSecret = {
|
||||
sopsFile = ../../secrets/spotify-shortcuts.yaml;
|
||||
key = "clientSecret";
|
||||
};
|
||||
|
||||
# Users
|
||||
users.users.jonas = {
|
||||
isNormalUser = true;
|
||||
description = "Jonas";
|
||||
hashedPassword = ""; # passwordless login (sudo is now unusable without specifying NOPASSWD)
|
||||
extraGroups = ["networkmanager" "wheel" "docker" "dialout"];
|
||||
};
|
||||
security.sudo.wheelNeedsPassword = false;
|
||||
users.groups.data = {
|
||||
gid = 1001;
|
||||
members = ["jonas"];
|
||||
};
|
||||
users.defaultUserShell = pkgs.zsh;
|
||||
programs.zsh.enable = true;
|
||||
|
||||
# fonts
|
||||
fonts.packages = with pkgs; [
|
||||
fira
|
||||
fira-code-symbols
|
||||
nerd-fonts.fira-code
|
||||
];
|
||||
|
||||
# hive modules
|
||||
hive.kwallet.forUsers = ["jonas"];
|
||||
hive.virt-manager.enable = true;
|
||||
hive.virt-manager.forUsers = ["jonas"];
|
||||
hive.sound.noisetorch = true;
|
||||
hive.wg.client.privateKeyFile = config.sops.secrets.wg-priv.path;
|
||||
hive.wg.client.peer = "monolith";
|
||||
hive.programs.games.dayz = true;
|
||||
hive.programs.games.lutris = true;
|
||||
hive.programs.games.steam = true;
|
||||
hive.programs.games.wine = true;
|
||||
hive.programs.creative = {
|
||||
image-management = true;
|
||||
image-editing = true;
|
||||
image-raw-processing = true;
|
||||
video-editing-light = true;
|
||||
video-editing-heavy = true;
|
||||
};
|
||||
hive.programs.spotify-shortcuts = {
|
||||
enable = true;
|
||||
clientIdSopsKey = config.sops.secrets.spotifyShortcutsClientId.name;
|
||||
clientSecretSopsKey = config.sops.secrets.spotifyShortcutsClientSecret.name;
|
||||
};
|
||||
|
||||
# system packages
|
||||
environment.systemPackages = with pkgs; [
|
||||
age
|
||||
alejandra
|
||||
arduino
|
||||
borgbackup
|
||||
borgmatic
|
||||
chromium
|
||||
discord
|
||||
docker
|
||||
docker-compose
|
||||
feh
|
||||
firefox
|
||||
git
|
||||
gramps
|
||||
insomnia
|
||||
libreoffice
|
||||
mosquitto
|
||||
mpv
|
||||
mupdf
|
||||
nextcloud-client
|
||||
nh
|
||||
nix-index
|
||||
nix-output-monitor
|
||||
obsidian
|
||||
qalculate-qt
|
||||
qdirstat
|
||||
qtpass
|
||||
ranger
|
||||
sops
|
||||
spotify
|
||||
vim
|
||||
vlc
|
||||
vscode
|
||||
wget
|
||||
zoom
|
||||
zotero
|
||||
];
|
||||
nixpkgs.config.permittedInsecurePackages = [
|
||||
"electron-25.9.0" # required by obsidian
|
||||
];
|
||||
virtualisation.docker.enable = true;
|
||||
|
||||
# dpi correction
|
||||
services.xserver.dpi = 91;
|
||||
environment.variables = {
|
||||
## Used by GTK 3
|
||||
# `GDK_SCALE` is limited to integer values
|
||||
GDK_SCALE = "1";
|
||||
# Inverse of GDK_SCALE
|
||||
GDK_DPI_SCALE = "1";
|
||||
|
||||
# Used by Qt 5
|
||||
QT_AUTO_SCREEN_SCALE_FACTOR = "1";
|
||||
|
||||
_JAVA_OPTIONS = "-Dsun.java2d.uiScale=1";
|
||||
};
|
||||
# Expose variables to graphical systemd user services
|
||||
services.xserver.displayManager.importedVariables = [
|
||||
"GDK_SCALE"
|
||||
"GDK_DPI_SCALE"
|
||||
"QT_AUTO_SCREEN_SCALE_FACTOR"
|
||||
];
|
||||
|
||||
# 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. It‘s 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.11"; # Did you read the comment?
|
||||
|
||||
# gc settings and binary caches
|
||||
nix = {
|
||||
settings = {
|
||||
substituters = [
|
||||
"https://aseipp-nix-cache.freetls.fastly.net"
|
||||
"https://nix-community.cachix.org"
|
||||
"https://cache.nixos.org/"
|
||||
];
|
||||
experimental-features = ["nix-command" "flakes"];
|
||||
auto-optimise-store = true;
|
||||
};
|
||||
gc = {
|
||||
automatic = true;
|
||||
dates = "weekly";
|
||||
options = "--delete-older-than 30d";
|
||||
};
|
||||
};
|
||||
|
||||
# boot
|
||||
boot.loader.systemd-boot.enable = true;
|
||||
boot.loader.efi.canTouchEfiVariables = true;
|
||||
boot.plymouth.enable = true;
|
||||
boot.initrd.systemd.enable = true;
|
||||
boot.supportedFilesystems = ["ntfs"];
|
||||
|
||||
# Configure console keymap
|
||||
console.keyMap = "de";
|
||||
|
||||
# Set your time zone.
|
||||
time.timeZone = "Europe/Berlin";
|
||||
|
||||
# Select internationalisation properties.
|
||||
i18n.defaultLocale = "en_US.UTF-8";
|
||||
i18n.extraLocaleSettings = {
|
||||
LC_ADDRESS = "de_DE.UTF-8";
|
||||
LC_IDENTIFICATION = "de_DE.UTF-8";
|
||||
LC_MEASUREMENT = "de_DE.UTF-8";
|
||||
LC_MONETARY = "de_DE.UTF-8";
|
||||
LC_NAME = "de_DE.UTF-8";
|
||||
LC_NUMERIC = "de_DE.UTF-8";
|
||||
LC_PAPER = "de_DE.UTF-8";
|
||||
LC_TELEPHONE = "de_DE.UTF-8";
|
||||
LC_TIME = "de_DE.UTF-8";
|
||||
};
|
||||
|
||||
networking.firewall.enable = true;
|
||||
networking.hostName = "monolith"; # Define your hostname.
|
||||
networking.extraHosts = ''
|
||||
127.0.0.1 monolith
|
||||
'';
|
||||
|
||||
# Enable networking
|
||||
networking.networkmanager.enable = true;
|
||||
|
||||
# printing
|
||||
services.printing.enable = true;
|
||||
|
||||
# ld-fix
|
||||
programs.nix-ld.enable = true;
|
||||
programs.nix-ld.libraries = [
|
||||
# Add any missing dynamic libraries for unpackaged programs
|
||||
# here, NOT in environment.systemPackages
|
||||
];
|
||||
}
|
||||
37
hosts/monolith/default.nix
Normal file
@@ -0,0 +1,37 @@
|
||||
{
|
||||
inputs,
|
||||
self,
|
||||
...
|
||||
}: {
|
||||
flake.nixosConfigurations.monolith = inputs.nixpkgs.lib.nixosSystem {
|
||||
modules = [
|
||||
({...}: {
|
||||
nixpkgs.config.allowUnfree = true;
|
||||
nixpkgs.config.nvidia.acceptLicense = true;
|
||||
})
|
||||
|
||||
./configuration.nix
|
||||
|
||||
inputs.nixos-hardware.nixosModules.msi-b550-a-pro
|
||||
inputs.sops-nix.nixosModules.sops
|
||||
self.nixosModules.nvidia
|
||||
self.nixosModules.ckb-next
|
||||
self.nixosModules.plasma
|
||||
self.nixosModules.plasma-fix
|
||||
self.nixosModules.layan
|
||||
self.nixosModules.nix-scripts
|
||||
self.nixosModules.kwallet
|
||||
self.nixosModules.virt-manager
|
||||
self.nixosModules.bluetooth
|
||||
self.nixosModules.sound
|
||||
self.nixosModules.yubikey
|
||||
self.nixosModules.wireguard-client
|
||||
self.nixosModules.games
|
||||
self.nixosModules.creative
|
||||
self.nixosModules.openhantek
|
||||
self.nixosModules.firefox
|
||||
self.nixosModules.kdeconnect
|
||||
self.nixosModules.spotify-shortcuts
|
||||
];
|
||||
};
|
||||
}
|
||||
57
hosts/monolith/hardware-configuration.nix
Normal file
@@ -0,0 +1,57 @@
|
||||
# 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 = ["nvme" "xhci_pci" "ahci" "usbhid" "usb_storage" "sd_mod" "sr_mod"];
|
||||
boot.initrd.kernelModules = [];
|
||||
boot.kernelModules = ["kvm-amd"];
|
||||
boot.extraModulePackages = [];
|
||||
|
||||
fileSystems."/" = {
|
||||
device = "/dev/disk/by-uuid/11d59216-2e76-499f-853f-9801486e330a";
|
||||
fsType = "ext4";
|
||||
};
|
||||
|
||||
fileSystems."/boot" = {
|
||||
device = "/dev/disk/by-uuid/0892-649B";
|
||||
fsType = "vfat";
|
||||
options = ["fmask=0022" "dmask=0022"];
|
||||
};
|
||||
|
||||
fileSystems."/data1" = {
|
||||
device = "/dev/disk/by-uuid/8426515e-2be1-4c51-8b5f-d1850aa17270";
|
||||
fsType = "ext4";
|
||||
};
|
||||
|
||||
fileSystems."/data2" = {
|
||||
device = "/dev/disk/by-uuid/4f39ed6d-74ed-420b-b542-89d432459f79";
|
||||
fsType = "ext4";
|
||||
};
|
||||
|
||||
swapDevices = [
|
||||
{
|
||||
device = "/.swapfile";
|
||||
size = 24 * 1024;
|
||||
}
|
||||
];
|
||||
|
||||
# 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.enp42s0.useDHCP = lib.mkDefault true;
|
||||
|
||||
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
|
||||
hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
|
||||
}
|
||||
58
modules/desktop/plasma-fix.nix
Normal file
@@ -0,0 +1,58 @@
|
||||
{
|
||||
# https://github.com/NixOS/nixpkgs/issues/126590#issuecomment-3194531220
|
||||
flake.nixosModules.plasma-fix = {
|
||||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}: {
|
||||
nixpkgs.overlays = lib.singleton (final: prev: {
|
||||
kdePackages =
|
||||
prev.kdePackages
|
||||
// {
|
||||
plasma-workspace = let
|
||||
# the package we want to override
|
||||
basePkg = prev.kdePackages.plasma-workspace;
|
||||
|
||||
# a helper package that merges all the XDG_DATA_DIRS into a single directory
|
||||
xdgdataPkg = pkgs.stdenv.mkDerivation {
|
||||
name = "${basePkg.name}-xdgdata";
|
||||
buildInputs = [basePkg];
|
||||
dontUnpack = true;
|
||||
dontFixup = true;
|
||||
dontWrapQtApps = true;
|
||||
installPhase = ''
|
||||
mkdir -p $out/share
|
||||
( IFS=:
|
||||
for DIR in $XDG_DATA_DIRS; do
|
||||
if [[ -d "$DIR" ]]; then
|
||||
cp -r $DIR/. $out/share/
|
||||
chmod -R u+w $out/share
|
||||
fi
|
||||
done
|
||||
)
|
||||
'';
|
||||
};
|
||||
|
||||
# undo the XDG_DATA_DIRS injection that is usually done in the qt wrapper
|
||||
# script and instead inject the path of the above helper package
|
||||
derivedPkg = basePkg.overrideAttrs {
|
||||
preFixup = ''
|
||||
for index in "''${!qtWrapperArgs[@]}"; do
|
||||
if [[ ''${qtWrapperArgs[$((index+0))]} == "--prefix" ]] && [[ ''${qtWrapperArgs[$((index+1))]} == "XDG_DATA_DIRS" ]]; then
|
||||
unset -v "qtWrapperArgs[$((index+0))]"
|
||||
unset -v "qtWrapperArgs[$((index+1))]"
|
||||
unset -v "qtWrapperArgs[$((index+2))]"
|
||||
unset -v "qtWrapperArgs[$((index+3))]"
|
||||
fi
|
||||
done
|
||||
qtWrapperArgs=("''${qtWrapperArgs[@]}")
|
||||
qtWrapperArgs+=(--prefix XDG_DATA_DIRS : "${xdgdataPkg}/share")
|
||||
qtWrapperArgs+=(--prefix XDG_DATA_DIRS : "$out/share")
|
||||
'';
|
||||
};
|
||||
in
|
||||
derivedPkg;
|
||||
};
|
||||
});
|
||||
};
|
||||
}
|
||||
22
modules/desktop/plasma.nix
Normal file
@@ -0,0 +1,22 @@
|
||||
{
|
||||
flake.nixosModules.plasma = {pkgs, ...}: {
|
||||
services.xserver.enable = true;
|
||||
services.xserver = {
|
||||
xkb.layout = "de";
|
||||
xkb.variant = "";
|
||||
xkb.options = "caps:ctrl_modifier";
|
||||
};
|
||||
services.displayManager.sddm = {
|
||||
enable = true;
|
||||
wayland.enable = true;
|
||||
};
|
||||
services.desktopManager.plasma6.enable = true;
|
||||
xdg.portal = {
|
||||
enable = true;
|
||||
extraPortals = with pkgs; [
|
||||
kdePackages.xdg-desktop-portal-kde
|
||||
xdg-desktop-portal-gtk
|
||||
];
|
||||
};
|
||||
};
|
||||
}
|
||||
290
modules/doom/doom.nix
Normal file
@@ -0,0 +1,290 @@
|
||||
{
|
||||
flake.homeModules.doom = {
|
||||
config,
|
||||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}: let
|
||||
cfg = config.hive.doom;
|
||||
doom-pkgs = with pkgs; [
|
||||
cmake
|
||||
emacs-all-the-icons-fonts
|
||||
fira
|
||||
fira-code-symbols
|
||||
fontconfig
|
||||
gcc
|
||||
nerd-fonts.fira-code
|
||||
];
|
||||
default-core-pkgs = with pkgs; [
|
||||
(ripgrep.override {withPCRE2 = true;})
|
||||
(aspellWithDicts (d: [d.en d.de d.en-computers d.en-science]))
|
||||
binutils
|
||||
editorconfig-core-c
|
||||
fd
|
||||
git
|
||||
gnumake
|
||||
gnutls
|
||||
ispell
|
||||
libtool
|
||||
vscode-langservers-extracted
|
||||
(pkgs.stdenvNoCC.mkDerivation {
|
||||
name = "epdfinfo";
|
||||
phases = "installPhase";
|
||||
installPhase = ''
|
||||
mkdir -p $out/bin
|
||||
ln -s $(${pkgs.findutils}/bin/find ${pkgs.emacsPackages.pdf-tools}/ -name epdfinfo) $out/bin/
|
||||
'';
|
||||
})
|
||||
];
|
||||
default-shell-pkgs = with pkgs; [
|
||||
bash-language-server
|
||||
];
|
||||
default-nix-pkgs = with pkgs; [
|
||||
alejandra
|
||||
nixd
|
||||
];
|
||||
default-latex-pkgs = with pkgs; [
|
||||
pandoc
|
||||
poppler
|
||||
texlab
|
||||
texlive.combined.scheme-medium
|
||||
];
|
||||
default-cxx-pkgs = with pkgs; [
|
||||
clang
|
||||
clang-tools
|
||||
cmake
|
||||
cppcheck
|
||||
doxygen
|
||||
gdb
|
||||
ninja
|
||||
];
|
||||
default-python-pkgs = with pkgs; [
|
||||
python312
|
||||
python312Packages.black
|
||||
pyright
|
||||
];
|
||||
doom-path-pkgs =
|
||||
lib.optionals cfg.withLatexPkgs (cfg.overrideLatexPkgs default-latex-pkgs)
|
||||
++ lib.optionals cfg.withShellPkgs (cfg.overrideShellPkgs default-shell-pkgs)
|
||||
++ lib.optionals cfg.withNixPkgs (cfg.overrideNixPkgs default-nix-pkgs)
|
||||
++ lib.optionals cfg.withCXXPkgs (cfg.overrideCXXPkgs default-cxx-pkgs)
|
||||
++ lib.optionals cfg.withPythonPkgs (cfg.overridePythonPkgs default-python-pkgs)
|
||||
++ lib.optional cfg.enableCopilot pkgs.unstable.copilot-language-server
|
||||
++ default-core-pkgs;
|
||||
doom-socket-name = "main";
|
||||
wrapped-emacs = pkgs.symlinkJoin {
|
||||
name = "wrapped-emacs";
|
||||
paths = [pkgs.emacs30];
|
||||
nativeBuildInputs = [pkgs.makeBinaryWrapper];
|
||||
postBuild = ''
|
||||
wrapProgram $out/bin/emacs \
|
||||
--prefix PATH : ${lib.makeBinPath doom-path-pkgs} \
|
||||
--add-flags "--init-directory=${config.xdg.configHome}/doom-emacs" \
|
||||
--set DOOMDIR "${config.home.sessionVariables.DOOMDIR}" \
|
||||
--set DOOMLOCALDIR "${config.home.sessionVariables.DOOMLOCALDIR}"
|
||||
|
||||
wrapProgram $out/bin/emacsclient \
|
||||
--prefix PATH : ${lib.makeBinPath doom-path-pkgs} \
|
||||
--set DOOMDIR "${config.home.sessionVariables.DOOMDIR}" \
|
||||
--set DOOMLOCALDIR "${config.home.sessionVariables.DOOMLOCALDIR}"
|
||||
'';
|
||||
};
|
||||
doom-setup = pkgs.writeShellScript "doom-setup" ''
|
||||
export PATH="${lib.makeBinPath doom-path-pkgs}:$PATH"
|
||||
export EMACS="${wrapped-emacs}/bin/emacs"
|
||||
export DOOMDIR="${config.home.sessionVariables.DOOMDIR}"
|
||||
export DOOMLOCALDIR="${config.home.sessionVariables.DOOMLOCALDIR}"
|
||||
if [ ! -d "$DOOMLOCALDIR" ]; then
|
||||
${config.xdg.configHome}/doom-emacs/bin/doom install --force --no-env
|
||||
else
|
||||
${config.xdg.configHome}/doom-emacs/bin/doom "$@"
|
||||
fi
|
||||
'';
|
||||
doom-open = pkgs.writeShellScriptBin "doom-open" ''
|
||||
export EMACS_SOCKET_NAME="$XDG_RUNTIME_DIR/emacs/${doom-socket-name}"
|
||||
if [ -t 0 ]; then
|
||||
exec ${wrapped-emacs}/bin/emacsclient -t "$@"
|
||||
else
|
||||
exec ${wrapped-emacs}/bin/emacsclient -c "$@"
|
||||
fi
|
||||
'';
|
||||
in {
|
||||
options.hive.doom = {
|
||||
enable = lib.mkEnableOption "Enable Doom Emacs";
|
||||
asDefaultEditor = lib.mkEnableOption "set the EDITOR variable to use the current emacs server (graphical/non-graphical)";
|
||||
enableCopilot = lib.mkEnableOption "Enable Copilot in Doom Emacs";
|
||||
enableTidal = lib.mkEnableOption "Enable TidalCycles";
|
||||
withLatexPkgs = lib.mkEnableOption "Enable LaTeX packages in doom path";
|
||||
withShellPkgs = lib.mkEnableOption "Enable shell packages in doom path";
|
||||
withNixPkgs = lib.mkEnableOption "Enable LaTeX packages in doom path";
|
||||
withCXXPkgs = lib.mkEnableOption "Enable CXX packages in doom path";
|
||||
withPythonPkgs = lib.mkEnableOption "Enable python packages in doom path";
|
||||
overrideLatexPkgs = lib.mkOption {
|
||||
type = lib.types.functionTo (lib.types.listOf lib.types.package);
|
||||
default = pkgs: pkgs;
|
||||
example = ''
|
||||
prev: with pkgs; [
|
||||
texlive.combined.scheme-full
|
||||
]
|
||||
'';
|
||||
description = "Override the default LaTeX packages in the doom path.";
|
||||
};
|
||||
overrideShellPkgs = lib.mkOption {
|
||||
type = lib.types.functionTo (lib.types.listOf lib.types.package);
|
||||
default = pkgs: pkgs;
|
||||
example = ''
|
||||
prev: with pkgs; [
|
||||
shellcheck
|
||||
]
|
||||
'';
|
||||
description = "Override the default shell packages in the doom path.";
|
||||
};
|
||||
overrideNixPkgs = lib.mkOption {
|
||||
type = lib.types.functionTo (lib.types.listOf lib.types.package);
|
||||
default = pkgs: pkgs;
|
||||
example = ''
|
||||
prev: with pkgs; [
|
||||
nixpkgs-fmt
|
||||
]
|
||||
'';
|
||||
description = "Override the default Nix packages in the doom path.";
|
||||
};
|
||||
overrideCXXPkgs = lib.mkOption {
|
||||
type = lib.types.functionTo (lib.types.listOf lib.types.package);
|
||||
default = pkgs: pkgs;
|
||||
example = ''
|
||||
prev: with pkgs; [
|
||||
openmp
|
||||
]
|
||||
'';
|
||||
description = "Override the default C++ packages in the doom path.";
|
||||
};
|
||||
overridePythonPkgs = lib.mkOption {
|
||||
type = lib.types.functionTo (lib.types.listOf lib.types.package);
|
||||
default = pkgs: pkgs;
|
||||
example = ''
|
||||
prev: with pkgs; [
|
||||
pythonPackages.black
|
||||
]
|
||||
'';
|
||||
description = "Override the default Python packages in the doom path.";
|
||||
};
|
||||
};
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
fonts.fontconfig.enable = true;
|
||||
|
||||
programs.emacs = {
|
||||
enable = true;
|
||||
package = wrapped-emacs;
|
||||
};
|
||||
|
||||
home = {
|
||||
sessionPath = ["${config.xdg.configHome}/doom-emacs/bin"];
|
||||
sessionVariables =
|
||||
{
|
||||
DOOMDIR = "${config.xdg.configHome}/doom-config";
|
||||
DOOMLOCALDIR = "${config.xdg.configHome}/doom-local";
|
||||
}
|
||||
// lib.optionalAttrs cfg.asDefaultEditor {
|
||||
EDITOR = "${doom-open.name}";
|
||||
};
|
||||
packages = doom-pkgs ++ lib.optional cfg.asDefaultEditor doom-open;
|
||||
};
|
||||
|
||||
systemd.user.services.doom-emacs-server = {
|
||||
Unit = {
|
||||
Description = "Doom Emacs Server";
|
||||
};
|
||||
Service = {
|
||||
ExecStart = "${wrapped-emacs}/bin/emacs --fg-daemon=${doom-socket-name}";
|
||||
SuccessExitStatus = 15;
|
||||
};
|
||||
Install = {
|
||||
WantedBy = []; # Lazy start by socket
|
||||
};
|
||||
};
|
||||
systemd.user.sockets.doom-emacs-server = {
|
||||
Socket = {
|
||||
ListenStream = "/run/user/%U/emacs/${doom-socket-name}";
|
||||
DirectoryMode = "0700";
|
||||
};
|
||||
Install = {
|
||||
WantedBy = ["sockets.target"];
|
||||
};
|
||||
};
|
||||
|
||||
xdg = {
|
||||
enable = true;
|
||||
configFile = {
|
||||
"doom-config/splash.png" = {
|
||||
source = ./static/splash.png;
|
||||
};
|
||||
"doom-config/config.el" = {
|
||||
source = ./static/config.el;
|
||||
};
|
||||
"doom-config/config.d/copilot.el" = {
|
||||
enable = cfg.enableCopilot;
|
||||
source = ./static/config.d/copilot.el;
|
||||
};
|
||||
"doom-config/packages/treesit-docgen.el" = {
|
||||
source = ./static/packages/treesit-docgen.el;
|
||||
};
|
||||
"doom-config/init.el" = {
|
||||
source = ./static/init.el;
|
||||
onChange = "${doom-setup} sync --force -e";
|
||||
};
|
||||
"doom-config/packages.el" = {
|
||||
source = ./static/packages.el;
|
||||
onChange = "${doom-setup} sync --force -u -e";
|
||||
};
|
||||
"doom-config/packages.d/copilot.el" = {
|
||||
enable = cfg.enableCopilot;
|
||||
source = ./static/packages.d/copilot.el;
|
||||
onChange = "${doom-setup} sync --force -u -e";
|
||||
};
|
||||
"doom-config/packages.d/tidal.el" = {
|
||||
enable = cfg.enableTidal;
|
||||
source = ./static/packages.d/tidal.el;
|
||||
onChange = "${doom-setup} sync --force -u -e";
|
||||
};
|
||||
"doom-emacs" = {
|
||||
source = builtins.fetchGit {
|
||||
url = "https://github.com/doomemacs/doomemacs";
|
||||
rev = "a0d6aac43fc94def29c98826e2f0088bcb703d13";
|
||||
};
|
||||
onChange = "${doom-setup} --force sync -u -e";
|
||||
};
|
||||
};
|
||||
desktopEntries = {
|
||||
emacs = {
|
||||
name = "Doom Emacs";
|
||||
genericName = "Text Editor";
|
||||
icon = ./static/icon.png;
|
||||
exec = "${wrapped-emacs}/bin/emacs %F";
|
||||
terminal = false;
|
||||
categories = ["Application" "Development" "TextEditor"];
|
||||
mimeType = ["text/*"];
|
||||
settings = {
|
||||
StartupWMClass = "Doom Emacs";
|
||||
};
|
||||
};
|
||||
emacsclient = {
|
||||
name = "Doom Emacs (Client)";
|
||||
genericName = "Text Editor";
|
||||
icon = ./static/icon.png;
|
||||
exec = ''
|
||||
sh -c "if [ -n \\"\\$*\\" ]; then exec ${wrapped-emacs}/bin/emacsclient --alternate-editor= --display=\\"\\$DISPLAY\\" \\"\\$@\\"; else exec emacsclient --alternate-editor= --create-frame; fi" sh %F
|
||||
'';
|
||||
terminal = false;
|
||||
categories = ["Application" "Development" "TextEditor"];
|
||||
mimeType = ["text/*"];
|
||||
settings = {
|
||||
StartupWMClass = "Doom Emacs";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
Before Width: | Height: | Size: 126 KiB After Width: | Height: | Size: 126 KiB |
|
Before Width: | Height: | Size: 165 KiB After Width: | Height: | Size: 165 KiB |
17
modules/hardware/ckb-next.nix
Normal file
@@ -0,0 +1,17 @@
|
||||
{
|
||||
flake.nixosModules.ckb-next = {pkgs, ...}: {
|
||||
# Corsair drivers
|
||||
hardware.ckb-next = {
|
||||
enable = true;
|
||||
# Workarount until https://github.com/NixOS/nixpkgs/issues/444209
|
||||
# is fixed
|
||||
package = pkgs.ckb-next.overrideAttrs (prev: {
|
||||
cmakeFlags =
|
||||
(prev.cmakeFlags or [])
|
||||
++ [
|
||||
"-DUSE_DBUS_MENU=0"
|
||||
];
|
||||
});
|
||||
};
|
||||
};
|
||||
}
|
||||
47
modules/hardware/nvidia.nix
Normal file
@@ -0,0 +1,47 @@
|
||||
{
|
||||
flake.nixosModules.nvidia = {
|
||||
config,
|
||||
pkgs,
|
||||
...
|
||||
}: {
|
||||
# Enable OpenGL
|
||||
hardware.graphics = {
|
||||
enable = true;
|
||||
enable32Bit = true;
|
||||
extraPackages = [pkgs.rocmPackages.clr];
|
||||
};
|
||||
|
||||
# Load nvidia driver for Xorg and Wayland
|
||||
services.xserver.videoDrivers = ["nvidia"];
|
||||
|
||||
hardware.nvidia = {
|
||||
# Modesetting is required.
|
||||
modesetting.enable = true;
|
||||
|
||||
# Nvidia power management. Experimental, and can cause sleep/suspend to fail.
|
||||
# Enable this if you have graphical corruption issues or application crashes after waking
|
||||
# up from sleep. This fixes it by saving the entire VRAM memory to /tmp/ instead
|
||||
# of just the bare essentials.
|
||||
powerManagement.enable = false;
|
||||
|
||||
# Fine-grained power management. Turns off GPU when not in use.
|
||||
# Experimental and only works on modern Nvidia GPUs (Turing or newer).
|
||||
powerManagement.finegrained = false;
|
||||
|
||||
# Use the NVidia open source kernel module (not to be confused with the
|
||||
# independent third-party "nouveau" open source driver).
|
||||
# Support is limited to the Turing and later architectures. Full list of
|
||||
# supported GPUs is at:
|
||||
# https://github.com/NVIDIA/open-gpu-kernel-modules#compatible-gpus
|
||||
# Only available from driver 515.43.04+
|
||||
open = false;
|
||||
|
||||
# Enable the Nvidia settings menu,
|
||||
# accessible via `nvidia-settings`.
|
||||
nvidiaSettings = true;
|
||||
|
||||
# Optionally, you may need to select the appropriate driver version for your specific GPU.
|
||||
package = config.boot.kernelPackages.nvidiaPackages.stable;
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -9,6 +9,7 @@
|
||||
peers = import ./peers.nix {inherit lib;};
|
||||
in {
|
||||
options.hive.wg.server = {
|
||||
enable = lib.mkEnableOption "Enable WireGuard server";
|
||||
port = lib.mkOption {
|
||||
type = lib.types.port;
|
||||
default = 51820;
|
||||
@@ -20,7 +21,7 @@
|
||||
};
|
||||
};
|
||||
|
||||
config = {
|
||||
config = lib.mkIf cfg.enable {
|
||||
# Firewall rule
|
||||
networking.firewall.allowedUDPPorts = [cfg.port];
|
||||
|
||||
|
||||
@@ -1,7 +1,10 @@
|
||||
{
|
||||
{self, ...}: {
|
||||
flake.overlays.crossover = final: prev: {
|
||||
crossover = final.callPackage ./_derivation.nix {};
|
||||
};
|
||||
flake.nixosModules.crossover-overlay = {
|
||||
nixpkgs.overlays = [self.overlays.crossover];
|
||||
};
|
||||
perSystem = {pkgs, ...}: {
|
||||
packages.crossover = pkgs.callPackage ./_derivation.nix {};
|
||||
};
|
||||
|
||||
@@ -1,9 +1,56 @@
|
||||
{
|
||||
{self, ...}: {
|
||||
flake.overlays.spotify-shortcuts = final: prev: {
|
||||
bulk-transcode = final.callPackage ./_derivation.nix {};
|
||||
spotify-shortcuts = final.callPackage ./_derivation.nix {};
|
||||
};
|
||||
perSystem = {pkgs, ...}: {
|
||||
packages.spotify-shortcuts = pkgs.callPackage ./_derivation.nix {};
|
||||
devShells.spotify-shortcuts = import ./_shell.nix {inherit pkgs;};
|
||||
};
|
||||
|
||||
flake.nixosModules.spotify-shortcuts-overlay = {
|
||||
nixpkgs.overlays = [
|
||||
self.overlays.spotify-shortcuts
|
||||
];
|
||||
};
|
||||
|
||||
flake.nixosModules.spotify-shortcuts = {
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}: let
|
||||
cfg = config.hive.programs.spotify-shortcuts;
|
||||
in {
|
||||
options.hive.programs.spotify-shortcuts = {
|
||||
enable = lib.mkEnableOption "Enable Spotify Shortcuts";
|
||||
clientIdSopsKey = lib.mkOption {
|
||||
type = lib.types.singleLineStr;
|
||||
description = "Spotify API Client ID sops secret name";
|
||||
};
|
||||
clientSecretSopsKey = lib.mkOption {
|
||||
type = lib.types.singleLineStr;
|
||||
description = "Spotify API Client Secret Path sops secret name";
|
||||
};
|
||||
};
|
||||
|
||||
imports = [
|
||||
self.nixosModules.spotify-shortcuts-overlay
|
||||
];
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
environment.systemPackages = [pkgs.spotify-shortcuts];
|
||||
environment.variables = {
|
||||
SPOTIFY_SHORTCUTS_CONFIG = config.sops.templates."spotify-shortcuts-client.json".path;
|
||||
};
|
||||
sops.templates."spotify-shortcuts-client.json" = {
|
||||
mode = "444";
|
||||
content = ''
|
||||
{
|
||||
"clientId": "${config.sops.placeholder.${cfg.clientIdSopsKey}}",
|
||||
"clientSecret": "${config.sops.placeholder.${cfg.clientSecretSopsKey}}"
|
||||
}
|
||||
'';
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
{
|
||||
{self, ...}: {
|
||||
flake.nixosModules.creative = {
|
||||
config,
|
||||
lib,
|
||||
@@ -52,15 +52,12 @@
|
||||
Enable heavy video editing tools.
|
||||
'';
|
||||
};
|
||||
daws = lib.mkOption {
|
||||
type = lib.types.bool;
|
||||
default = false;
|
||||
description = ''
|
||||
Enable DAWs (currently bitwig beta)
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
||||
imports = [
|
||||
self.nixosModules.bulk-transcode-overlay
|
||||
];
|
||||
|
||||
config = {
|
||||
environment.systemPackages = with pkgs;
|
||||
lib.optionals cfg.image-editing [gimp krita drawio]
|
||||
@@ -83,8 +80,7 @@
|
||||
davinci-resolve
|
||||
kdePackages.kdenlive
|
||||
obs-studio
|
||||
]
|
||||
++ lib.optional cfg.daws bitwig-studio-latest;
|
||||
];
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
@@ -1,7 +1,10 @@
|
||||
{
|
||||
self,
|
||||
inputs,
|
||||
...
|
||||
}: {
|
||||
flake.nixosModules.games = {
|
||||
config,
|
||||
inputs,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
@@ -46,6 +49,10 @@
|
||||
};
|
||||
};
|
||||
|
||||
imports = [
|
||||
self.nixosModules.crossover-overlay
|
||||
];
|
||||
|
||||
config = {
|
||||
environment.systemPackages =
|
||||
lib.optional cfg.lutris
|
||||
@@ -57,7 +64,7 @@
|
||||
})
|
||||
++ lib.optional cfg.r2modman pkgs.r2modman
|
||||
++ lib.optionals cfg.dayz [
|
||||
pkgs.hive.crossover
|
||||
pkgs.crossover
|
||||
inputs.dzgui-nix.packages.${pkgs.stdenv.system}.default
|
||||
]
|
||||
++ lib.optionals cfg.wine [
|
||||
|
||||
155
modules/programs/gotify.nix
Normal file
@@ -0,0 +1,155 @@
|
||||
{
|
||||
flake.homeModules.gotify = {
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}: let
|
||||
cfg = config.hive.gotify;
|
||||
cli-config = {
|
||||
token = config.sops.placeholder.${cfg.cli.tokenSopsKey};
|
||||
inherit (cfg.cli) url defaultPriority;
|
||||
};
|
||||
daemon-config = {
|
||||
gotify =
|
||||
{
|
||||
inherit (cfg.daemon) url;
|
||||
token = config.sops.placeholder.${cfg.daemon.tokenSopsKey};
|
||||
auto_delete = cfg.daemon.autoDelete;
|
||||
min_priority = cfg.daemon.minPriority;
|
||||
}
|
||||
// lib.optionalAttrs (cfg.daemon.onMsgCommand != null) {
|
||||
on_msg_command = cfg.daemon.onMsgCommand;
|
||||
};
|
||||
};
|
||||
|
||||
valueToString = val:
|
||||
if (builtins.typeOf val == "string")
|
||||
then "\"${val}\""
|
||||
else
|
||||
(
|
||||
if (builtins.typeOf val == "int")
|
||||
then "${toString val}"
|
||||
else
|
||||
(
|
||||
if (builtins.typeOf val == "bool")
|
||||
then
|
||||
(
|
||||
if val
|
||||
then "true"
|
||||
else "false"
|
||||
)
|
||||
else (abort "Expected string int or bool, got ${builtins.typeOf val} with value ${toString val}")
|
||||
)
|
||||
);
|
||||
|
||||
toTOML = attrs:
|
||||
lib.concatStrings (
|
||||
lib.attrValues (
|
||||
lib.mapAttrs (
|
||||
name: config: ''
|
||||
[${name}]
|
||||
${lib.concatStringsSep "\n" (lib.attrValues (lib.mapAttrs (k: v: "${k} = ${valueToString v}") config))}
|
||||
''
|
||||
)
|
||||
attrs
|
||||
)
|
||||
);
|
||||
in {
|
||||
options.hive.gotify = {
|
||||
cli = {
|
||||
enable = lib.mkEnableOption "Enable Gotify cli tool";
|
||||
url = lib.mkOption {
|
||||
type = lib.types.singleLineStr;
|
||||
default = "https://${cfg.host}:${toString cfg.port}";
|
||||
example = "http://gotify.example.com";
|
||||
description = "The http url of the gotify server (for the cli tool)";
|
||||
};
|
||||
tokenSopsKey = lib.mkOption {
|
||||
type = lib.types.singleLineStr;
|
||||
description = "The sops key of the token secret";
|
||||
};
|
||||
defaultPriority = lib.mkOption {
|
||||
type = lib.types.int;
|
||||
default = 0;
|
||||
example = 3;
|
||||
description = "The default priority of the dispatched messages";
|
||||
};
|
||||
};
|
||||
daemon = {
|
||||
enable = lib.mkEnableOption "Enable the Gotify desktop notification daemon";
|
||||
url = lib.mkOption {
|
||||
type = lib.types.singleLineStr;
|
||||
default = "wss://${cfg.host}:${toString cfg.port}";
|
||||
example = "ws://gotify.example.com";
|
||||
description = "The websocket url of the gotify server (for the desktop tool)";
|
||||
};
|
||||
tokenSopsKey = lib.mkOption {
|
||||
type = lib.types.singleLineStr;
|
||||
description = "The sops key of the token secret";
|
||||
};
|
||||
autoDelete = lib.mkOption {
|
||||
type = lib.types.bool;
|
||||
default = false;
|
||||
example = true;
|
||||
description = "Delete messages that have been handled";
|
||||
};
|
||||
minPriority = lib.mkOption {
|
||||
type = lib.types.int;
|
||||
default = 0;
|
||||
example = 1;
|
||||
description = "Ignore messages with priority lower than given value";
|
||||
};
|
||||
onMsgCommand = lib.mkOption {
|
||||
type = lib.types.nullOr lib.types.singleLineStr;
|
||||
default = null;
|
||||
example = "/usr/bin/beep";
|
||||
description = '' A command to tun for each message with env vars
|
||||
GOTIFY_MSG_PRIORITY, GOTIFY_MSG_TITLE and GOTIFY_MSG_TEXTs
|
||||
If unset use the standard desktop notification passing
|
||||
'';
|
||||
};
|
||||
};
|
||||
host = lib.mkOption {
|
||||
type = lib.types.singleLineStr;
|
||||
example = "example.com";
|
||||
description = "The hostname of the gotify server";
|
||||
};
|
||||
port = lib.mkOption {
|
||||
type = lib.types.int;
|
||||
default = 443;
|
||||
example = 443;
|
||||
description = "The port of the gotify server";
|
||||
};
|
||||
};
|
||||
|
||||
config = let
|
||||
cli = lib.mkIf cfg.cli.enable {
|
||||
home.packages = [pkgs.gotify-cli];
|
||||
sops.templates."gotify-cli-json" = {
|
||||
content = lib.generators.toJSON {} cli-config;
|
||||
path = "${config.xdg.configHome}/gotify/cli.json";
|
||||
};
|
||||
};
|
||||
daemon = lib.mkIf cfg.daemon.enable {
|
||||
systemd.user.services.gotify-desktop = {
|
||||
Unit = {
|
||||
Description = "Gotify Desktop notification service";
|
||||
After = ["sops-nix.service"]; # After the secrets have been rendered
|
||||
};
|
||||
Service = {
|
||||
ExecStart = "${pkgs.gotify-desktop}/bin/gotify-desktop";
|
||||
};
|
||||
Install = {
|
||||
WantedBy = ["multi-user.target"];
|
||||
};
|
||||
};
|
||||
sops.templates."gotify-daemon-toml" = {
|
||||
content = toTOML daemon-config;
|
||||
path = "${config.xdg.configHome}/gotify-desktop/config.toml";
|
||||
};
|
||||
};
|
||||
in
|
||||
lib.mkMerge [cli daemon];
|
||||
};
|
||||
}
|
||||
37
modules/programs/jj.nix
Normal file
@@ -0,0 +1,37 @@
|
||||
{
|
||||
flake.homeModules.jj = {
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}: let
|
||||
cfg = config.hive.jj;
|
||||
in {
|
||||
options.hive.jj = {
|
||||
followGit = lib.mkOption {
|
||||
type = lib.types.bool;
|
||||
default = true;
|
||||
description = "Follow the current git configuration";
|
||||
};
|
||||
};
|
||||
|
||||
config = {
|
||||
home.packages = with pkgs; [
|
||||
jujutsu
|
||||
];
|
||||
|
||||
programs.jujutsu = {
|
||||
enable = true;
|
||||
settings = {
|
||||
user = lib.optionalAttrs cfg.followGit {
|
||||
name = config.programs.git.settings.user.name;
|
||||
email = config.programs.git.settings.user.email;
|
||||
};
|
||||
ui = lib.optionalAttrs (cfg.followGit && config.programs.difftastic.enable) {
|
||||
diff-formatter = ["${pkgs.difftastic}/bin/difft" "--color=always" "$left" "$right"];
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
63
modules/services/borg-server.nix
Normal file
@@ -0,0 +1,63 @@
|
||||
{
|
||||
flake.nixosModules.borg-server = {
|
||||
lib,
|
||||
config,
|
||||
pkgs,
|
||||
...
|
||||
}: let
|
||||
cfg = config.hive.borg-server;
|
||||
in {
|
||||
options.hive.borg-server = {
|
||||
enable = lib.mkEnableOption "Enable the borg server";
|
||||
package = lib.mkOption {
|
||||
type = lib.types.package;
|
||||
default = pkgs.borgbackup;
|
||||
example = "pkgs.borgbackup";
|
||||
description = "The borg package to use";
|
||||
};
|
||||
borg_user = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
example = "borg";
|
||||
default = "borg";
|
||||
description = "The user for the borg repository home.";
|
||||
};
|
||||
repositories_path = lib.mkOption {
|
||||
type = lib.types.path;
|
||||
example = "/var/lib/borg-repositories";
|
||||
default = "/var/lib/borg-repositories";
|
||||
description = "The user for the borg repository home.";
|
||||
};
|
||||
repositories = lib.mkOption {
|
||||
type = lib.types.attrsOf (lib.types.submodule {
|
||||
options = {
|
||||
name = lib.mkOption {
|
||||
type = lib.types.nullOr (lib.types.strMatching "^[a-zA-Z0-9._-]+$");
|
||||
default = null;
|
||||
example = "borg-repo";
|
||||
description = "The name of the borg repository. If null, use key of attrset";
|
||||
};
|
||||
ssh_public_key = lib.mkOption {
|
||||
type = lib.types.singleLineStr;
|
||||
example = "ssh-rsa AAAA...";
|
||||
description = "The path to the public key for the borg repository.";
|
||||
};
|
||||
};
|
||||
});
|
||||
};
|
||||
};
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
users.users.${cfg.borg_user} = {
|
||||
isNormalUser = true;
|
||||
description = "Borg user";
|
||||
home = cfg.repositories_path;
|
||||
createHome = true;
|
||||
extraGroups = ["borg"];
|
||||
openssh.authorizedKeys.keys =
|
||||
lib.attrsets.mapAttrsToList
|
||||
(key: repo: "command=\"${cfg.package}/bin/borg serve --restrict-to-path=${cfg.repositories_path}/${lib.defaultTo key repo.name}\",restrict ${repo.ssh_public_key}")
|
||||
cfg.repositories;
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
125
modules/services/gitea-instance.nix
Normal file
@@ -0,0 +1,125 @@
|
||||
{
|
||||
flake.nixosModules.gitea-instance = {
|
||||
config,
|
||||
lib,
|
||||
...
|
||||
}: let
|
||||
cfg = config.hive.gitea-instance;
|
||||
in {
|
||||
options.hive.gitea-instance = {
|
||||
enable = lib.mkEnableOption "Enable the Gitea instance";
|
||||
|
||||
instanceFQDN = lib.mkOption {
|
||||
type = lib.types.singleLineStr;
|
||||
example = "git.example.com";
|
||||
description = "Fully qualified domain name of the Gitea instance";
|
||||
};
|
||||
|
||||
databasePasswordFile = lib.mkOption {
|
||||
type = lib.types.path;
|
||||
example = "/etc/gitea-db-pass.txt";
|
||||
description = "Path to the file containing the Gitea database password";
|
||||
};
|
||||
nativeRunner = lib.mkOption {
|
||||
type = lib.types.bool;
|
||||
description = "Install a gitea act_runner using the native nix store";
|
||||
default = false;
|
||||
};
|
||||
};
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
# Gitea instance
|
||||
services.gitea = {
|
||||
enable = true;
|
||||
lfs.enable = true;
|
||||
appName = "Git yourself some Tea!";
|
||||
database = {
|
||||
name = "gitea";
|
||||
type = "postgres";
|
||||
passwordFile = cfg.databasePasswordFile;
|
||||
};
|
||||
settings = {
|
||||
server.PROTOCOL = "http+unix";
|
||||
server.ROOT_URL = "https://${cfg.instanceFQDN}/";
|
||||
server.DOMAIN = cfg.instanceFQDN;
|
||||
service.DISABLE_REGISTRATION = true;
|
||||
};
|
||||
};
|
||||
|
||||
# Fallback server with only 403
|
||||
services.nginx.virtualHosts.${config.networking.domain} = lib.mkDefault {
|
||||
default = true;
|
||||
locations."/".return = 403;
|
||||
forceSSL = true;
|
||||
enableACME = true;
|
||||
};
|
||||
|
||||
# Virtual host for gitea
|
||||
services.nginx.virtualHosts."${cfg.instanceFQDN}" = {
|
||||
forceSSL = true;
|
||||
enableACME = true;
|
||||
locations."/" = {
|
||||
proxyPass = "http://unix:/run/gitea/gitea.sock";
|
||||
};
|
||||
};
|
||||
|
||||
# Database setup
|
||||
services.postgresql = {
|
||||
enable = true;
|
||||
ensureDatabases = [config.services.gitea.user];
|
||||
ensureUsers = [
|
||||
{
|
||||
name = config.services.gitea.database.user;
|
||||
ensureDBOwnership = true;
|
||||
}
|
||||
];
|
||||
};
|
||||
|
||||
# act_runner
|
||||
services.gitea-actions-runner = lib.mkIf cfg.nativeRunner {
|
||||
instances.nixos-host = {
|
||||
enable = true;
|
||||
name = "nixos-host-runner";
|
||||
url = "https://${cfg.instanceFQDN}";
|
||||
tokenFile = "/var/lib/gitea-registration/nixos-host";
|
||||
|
||||
labels = ["nixos:host"];
|
||||
|
||||
settings = {
|
||||
runner = {
|
||||
capacity = 1;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
systemd.services.gitea-runner-nixos-host = lib.mkIf cfg.nativeRunner {
|
||||
after = ["gitea-runner-gen-token.service"];
|
||||
requires = ["gitea-runner-gen-token.service"];
|
||||
serviceConfig.Environment = ''
|
||||
PATH=/run/current-system/sw/bin:/usr/bin:/bin
|
||||
'';
|
||||
};
|
||||
systemd.services.gitea-runner-gen-token = lib.mkIf cfg.nativeRunner {
|
||||
wantedBy = ["multi-user.target"];
|
||||
after = ["gitea.service"];
|
||||
environment = {
|
||||
GITEA_CUSTOM = "/var/lib/gitea/custom";
|
||||
GITEA_WORK_DIR = "/var/lib/gitea";
|
||||
};
|
||||
script = ''
|
||||
set -euo pipefail
|
||||
token=$(${config.services.gitea.package}/bin/gitea actions generate-runner-token)
|
||||
echo "TOKEN=$token" > /var/lib/gitea-registration/nixos-host
|
||||
'';
|
||||
unitConfig.ConditionPathExists = ["!/var/lib/gitea-registration/nixos-host"];
|
||||
serviceConfig = {
|
||||
User = "gitea";
|
||||
Group = "gitea";
|
||||
StateDirectory = "gitea-registration";
|
||||
Type = "oneshot";
|
||||
RemainAfterExit = true;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
133
modules/services/gotify-instance.nix
Normal file
@@ -0,0 +1,133 @@
|
||||
{
|
||||
flake.nixosModules.gotify-instance = {
|
||||
config,
|
||||
lib,
|
||||
...
|
||||
}: let
|
||||
cfg = config.hive.gotify-instance;
|
||||
server-config = {
|
||||
server = {
|
||||
listenaddr = "localhost";
|
||||
port = 54545;
|
||||
ssl.enabled = false;
|
||||
ssl.redirecttohttps = false;
|
||||
cors.alloworigins = ["${cfg.instanceFQDN}"];
|
||||
stream.allowedorigins = ["${cfg.instanceFQDN}"];
|
||||
};
|
||||
database = {
|
||||
dialect = "postgres";
|
||||
connection = "host=/run/postgresql dbname=${cfg.user} user=${cfg.user}";
|
||||
};
|
||||
defaultuser = {
|
||||
name = "admin";
|
||||
pass = config.sops.placeholder.${cfg.adminPasswordSopsKey};
|
||||
};
|
||||
registration = false;
|
||||
};
|
||||
server-config-yaml = lib.generators.toYAML {} server-config;
|
||||
in {
|
||||
options.hive.gotify-instance = {
|
||||
enable = lib.mkEnableOption "Enable the Gotify instance";
|
||||
instanceFQDN = lib.mkOption {
|
||||
type = lib.types.singleLineStr;
|
||||
example = "gotify.example.com";
|
||||
description = "Fully qualified domain name of the Gotify instance";
|
||||
};
|
||||
user = lib.mkOption {
|
||||
type = lib.types.singleLineStr;
|
||||
default = "gotify";
|
||||
description = "The user to run the service as";
|
||||
};
|
||||
group = lib.mkOption {
|
||||
type = lib.types.singleLineStr;
|
||||
default = "gotify";
|
||||
description = "The group to run the service as";
|
||||
};
|
||||
adminPasswordSopsKey = lib.mkOption {
|
||||
type = lib.types.singleLineStr;
|
||||
description = "The SOPS key for the default admin user";
|
||||
};
|
||||
};
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
services.gotify.enable = true;
|
||||
|
||||
# Config setup
|
||||
sops.templates."gotify-server-config.yml" = {
|
||||
owner = cfg.user;
|
||||
content = server-config-yaml;
|
||||
};
|
||||
environment.etc."gotify/config.yml".source = config.sops.templates."gotify-server-config.yml".path;
|
||||
|
||||
# User setup
|
||||
users.users = lib.mkIf (cfg.user == "gotify") {
|
||||
gotify = {
|
||||
description = "Gotify service";
|
||||
useDefaultShell = true;
|
||||
group = cfg.group;
|
||||
isSystemUser = true;
|
||||
};
|
||||
};
|
||||
|
||||
users.groups = lib.mkIf (cfg.group == "gotify") {
|
||||
gotify = {};
|
||||
};
|
||||
|
||||
# Configure gotify to run as the specified user (for postgres authentication)
|
||||
systemd.services.gotify-server = {
|
||||
serviceConfig = {
|
||||
DynamicUser = lib.mkForce false;
|
||||
User = cfg.user;
|
||||
RuntimeDirectory = "gotify";
|
||||
};
|
||||
};
|
||||
|
||||
# Fallback server with only 403
|
||||
services.nginx.virtualHosts.${config.networking.domain} = lib.mkDefault {
|
||||
default = true;
|
||||
locations."/".return = 403;
|
||||
forceSSL = true;
|
||||
enableACME = true;
|
||||
};
|
||||
|
||||
# Virtual host for gotify
|
||||
services.nginx.virtualHosts."${cfg.instanceFQDN}" = {
|
||||
forceSSL = true;
|
||||
enableACME = true;
|
||||
locations."/" = {
|
||||
proxyPass = "http://${server-config.server.listenaddr}:${toString server-config.server.port}";
|
||||
extraConfig = ''
|
||||
# Ensuring it can use websockets
|
||||
proxy_set_header Upgrade $http_upgrade;
|
||||
proxy_set_header Connection "upgrade";
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
proxy_set_header X-Forwarded-Proto http;
|
||||
proxy_redirect http:// $scheme://;
|
||||
|
||||
# The proxy must preserve the host because gotify verifies the host with the origin
|
||||
# for WebSocket connections
|
||||
proxy_set_header Host $host;
|
||||
|
||||
# These sets the timeout so that the websocket can stay alive
|
||||
proxy_connect_timeout 1m;
|
||||
proxy_send_timeout 1m;
|
||||
proxy_read_timeout 1m;
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
||||
# Database setup
|
||||
services.postgresql = {
|
||||
enable = true;
|
||||
ensureDatabases = [cfg.user];
|
||||
ensureUsers = [
|
||||
{
|
||||
name = cfg.user;
|
||||
ensureDBOwnership = true;
|
||||
}
|
||||
];
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
46
modules/services/minecraft-server/minecraft-server.nix
Normal file
@@ -0,0 +1,46 @@
|
||||
{
|
||||
flake.nixosModules.minecraft-server = {
|
||||
config,
|
||||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}: let
|
||||
cfg = config.hive.minecraft-server;
|
||||
|
||||
modpack = pkgs.callPackage ./_loadCurseForge.nix {
|
||||
url = "https://mediafilez.forgecdn.net/files/7765/203/BMC3_Server_Pack_v44.zip";
|
||||
hash = "sha256-doqPzo9fhYM9ng/3RO6OPqhKA2ibfoaKx3Es7M0lpuU=";
|
||||
};
|
||||
|
||||
mcVersion = modpack.variables.MINECRAFT_VERSION;
|
||||
loader = lib.toLower modpack.variables.MODLOADER;
|
||||
loaderVersion = modpack.variables.MODLOADER_VERSION;
|
||||
serverVersion = lib.replaceStrings ["."] ["_"] "${loader}-${mcVersion}";
|
||||
in {
|
||||
options.hive.minecraft-server = {
|
||||
enable = lib.mkEnableOption "Enable BMC3 server";
|
||||
};
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
services.minecraft-servers = {
|
||||
enable = true;
|
||||
eula = true;
|
||||
openFirewall = true;
|
||||
|
||||
servers.bmc3 = lib.optionalAttrs cfg.enable {
|
||||
enable = true;
|
||||
autoStart = false;
|
||||
package = pkgs."${loader}Servers".${serverVersion}.override {inherit loaderVersion;};
|
||||
jvmOpts = modpack.variables.JAVA_ARGS;
|
||||
symlinks = {
|
||||
"mods" = "${modpack.root}/mods";
|
||||
};
|
||||
serverProperties = {
|
||||
motd = "Woher kommt der Stein?";
|
||||
white-list = true;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
136
modules/services/nextcloud-instance.nix
Normal file
@@ -0,0 +1,136 @@
|
||||
{
|
||||
flake.nixosModules.nextcloud-instance = {
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}: let
|
||||
cfg = config.hive.nextcloud-instance;
|
||||
in {
|
||||
options.hive.nextcloud-instance = {
|
||||
enable = lib.mkEnableOption "Enable the Nextcloud instance";
|
||||
|
||||
instanceFQDN = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
example = "nextcloud.example.com";
|
||||
description = "Fully qualified domain name of the Nextcloud instance";
|
||||
};
|
||||
|
||||
ssl = lib.mkOption {
|
||||
type = lib.types.bool;
|
||||
default = true;
|
||||
description = "Use SSL and auto-update certificates";
|
||||
};
|
||||
|
||||
adminPasswordFile = lib.mkOption {
|
||||
type = lib.types.path;
|
||||
example = "/etc/nc-admin-pass.txt";
|
||||
description = "Path to the file containing the Nextcloud admin password";
|
||||
};
|
||||
};
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
services.nextcloud = {
|
||||
# Instance
|
||||
enable = true;
|
||||
package = pkgs.nextcloud33;
|
||||
hostName = cfg.instanceFQDN;
|
||||
https = cfg.ssl;
|
||||
configureRedis = true;
|
||||
|
||||
# DB
|
||||
config.dbtype = "pgsql";
|
||||
config.dbhost = "/run/postgresql";
|
||||
config.adminpassFile = cfg.adminPasswordFile;
|
||||
|
||||
#Mail
|
||||
settings = {
|
||||
mail_smtpmode = "sendmail";
|
||||
mail_sendmailmode = "pipe";
|
||||
};
|
||||
|
||||
# Apps
|
||||
extraAppsEnable = true;
|
||||
extraApps = {
|
||||
inherit
|
||||
(config.services.nextcloud.package.packages.apps)
|
||||
calendar
|
||||
contacts
|
||||
tasks
|
||||
;
|
||||
drop_account = pkgs.fetchNextcloudApp {
|
||||
sha256 = "sha256-J+bZVNIb/MokuTYQu8RBKdnZFakh180pa1pW5KHlC80=";
|
||||
url = "https://packages.framasoft.org/projects/nextcloud-apps/drop-account/drop_account-3.0.0.tar.gz";
|
||||
license = "agpl3Only";
|
||||
};
|
||||
};
|
||||
|
||||
# Raise Upload limit
|
||||
maxUploadSize = "20G";
|
||||
|
||||
# Preview settings (video may be a security risk)
|
||||
settings = {
|
||||
enable_previews = true;
|
||||
enabledPreviewProviders = [
|
||||
"OC\\Preview\\BMP"
|
||||
"OC\\Preview\\GIF"
|
||||
"OC\\Preview\\JPEG"
|
||||
"OC\\Preview\\Krita"
|
||||
"OC\\Preview\\MarkDown"
|
||||
"OC\\Preview\\MP3"
|
||||
"OC\\Preview\\OpenDocument"
|
||||
"OC\\Preview\\PNG"
|
||||
"OC\\Preview\\TXT"
|
||||
"OC\\Preview\\XBitmap"
|
||||
"OC\\Preview\\Movie"
|
||||
"OC\\Preview\\MP4"
|
||||
"OC\\Preview\\AVI"
|
||||
"OC\\Preview\\MKV"
|
||||
];
|
||||
preview_ffmpeg_path = "${pkgs.ffmpeg}/bin/ffmpeg";
|
||||
};
|
||||
};
|
||||
|
||||
# Fallback server with only 403
|
||||
services.nginx.virtualHosts.${config.networking.domain} = lib.mkDefault {
|
||||
default = true;
|
||||
locations."/".return = 403;
|
||||
forceSSL = cfg.ssl;
|
||||
enableACME = cfg.ssl;
|
||||
};
|
||||
|
||||
# Webserver setup with optional SSL
|
||||
services.nginx.virtualHosts.${cfg.instanceFQDN} =
|
||||
if cfg.ssl
|
||||
then {
|
||||
forceSSL = true;
|
||||
enableACME = true;
|
||||
}
|
||||
else {
|
||||
listen = [
|
||||
{
|
||||
addr = "0.0.0.0";
|
||||
port = 80;
|
||||
}
|
||||
];
|
||||
};
|
||||
security.acme = lib.mkIf cfg.ssl {
|
||||
acceptTerms = true;
|
||||
defaults.email = "jonas.roeger+acme@gmail.com";
|
||||
};
|
||||
networking.firewall.allowedTCPPorts = [80] ++ lib.optional cfg.ssl 443;
|
||||
|
||||
# DB setup
|
||||
services.postgresql = {
|
||||
enable = true;
|
||||
ensureDatabases = ["nextcloud"];
|
||||
ensureUsers = [
|
||||
{
|
||||
name = "nextcloud";
|
||||
ensureDBOwnership = true;
|
||||
}
|
||||
];
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -1,4 +1,18 @@
|
||||
{self, ...}: {
|
||||
flake.nixosModules.layan = {pkgs, ...}: {
|
||||
imports = [
|
||||
self.nixosModules.unstable-overlay
|
||||
self.nixosModules.layan-qt6-overlay
|
||||
];
|
||||
environment.systemPackages = [
|
||||
pkgs.layan-qt6
|
||||
pkgs.kdePackages.qtstyleplugin-kvantum
|
||||
pkgs.unstable.layan-cursors
|
||||
pkgs.layan-gtk-theme
|
||||
pkgs.tela-circle-icon-theme
|
||||
];
|
||||
};
|
||||
|
||||
flake.homeModules.layan = {
|
||||
lib,
|
||||
pkgs,
|
||||
|
||||
@@ -1,57 +0,0 @@
|
||||
# https://github.com/NixOS/nixpkgs/issues/126590#issuecomment-3194531220
|
||||
{
|
||||
config,
|
||||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}: {
|
||||
nixpkgs.overlays = lib.singleton (final: prev: {
|
||||
kdePackages =
|
||||
prev.kdePackages
|
||||
// {
|
||||
plasma-workspace = let
|
||||
# the package we want to override
|
||||
basePkg = prev.kdePackages.plasma-workspace;
|
||||
|
||||
# a helper package that merges all the XDG_DATA_DIRS into a single directory
|
||||
xdgdataPkg = pkgs.stdenv.mkDerivation {
|
||||
name = "${basePkg.name}-xdgdata";
|
||||
buildInputs = [basePkg];
|
||||
dontUnpack = true;
|
||||
dontFixup = true;
|
||||
dontWrapQtApps = true;
|
||||
installPhase = ''
|
||||
mkdir -p $out/share
|
||||
( IFS=:
|
||||
for DIR in $XDG_DATA_DIRS; do
|
||||
if [[ -d "$DIR" ]]; then
|
||||
cp -r $DIR/. $out/share/
|
||||
chmod -R u+w $out/share
|
||||
fi
|
||||
done
|
||||
)
|
||||
'';
|
||||
};
|
||||
|
||||
# undo the XDG_DATA_DIRS injection that is usually done in the qt wrapper
|
||||
# script and instead inject the path of the above helper package
|
||||
derivedPkg = basePkg.overrideAttrs {
|
||||
preFixup = ''
|
||||
for index in "''${!qtWrapperArgs[@]}"; do
|
||||
if [[ ''${qtWrapperArgs[$((index+0))]} == "--prefix" ]] && [[ ''${qtWrapperArgs[$((index+1))]} == "XDG_DATA_DIRS" ]]; then
|
||||
unset -v "qtWrapperArgs[$((index+0))]"
|
||||
unset -v "qtWrapperArgs[$((index+1))]"
|
||||
unset -v "qtWrapperArgs[$((index+2))]"
|
||||
unset -v "qtWrapperArgs[$((index+3))]"
|
||||
fi
|
||||
done
|
||||
qtWrapperArgs=("''${qtWrapperArgs[@]}")
|
||||
qtWrapperArgs+=(--prefix XDG_DATA_DIRS : "${xdgdataPkg}/share")
|
||||
qtWrapperArgs+=(--prefix XDG_DATA_DIRS : "$out/share")
|
||||
'';
|
||||
};
|
||||
in
|
||||
derivedPkg;
|
||||
};
|
||||
});
|
||||
}
|
||||
@@ -1,118 +0,0 @@
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
isHM,
|
||||
...
|
||||
}: let
|
||||
cfg = config.hive.nix-scripts;
|
||||
home-rebuild =
|
||||
pkgs.writeShellScriptBin ".home-rebuild"
|
||||
''
|
||||
set -e
|
||||
pushd ~/.hive/
|
||||
${pkgs.alejandra}/bin/alejandra . &>/dev/null
|
||||
${pkgs.git}/bin/git diff -U0
|
||||
echo "NixOS Rebuilding..."
|
||||
home-manager switch --flake ~/.hive -b backup --log-format internal-json |& ${pkgs.nix-output-monitor}/bin/nom --json
|
||||
gen=$(home-manager generations | head -n1 | ${pkgs.gawk}/bin/awk '{print "Gen" $5 " @ " $1 "-" $2}')
|
||||
by="$(${pkgs.coreutils-full}/bin/whoami)@$(${pkgs.nettools}/bin/hostname)"
|
||||
${pkgs.git}/bin/git commit --no-gpg-sign -am "Home $gen by $by"
|
||||
popd
|
||||
'';
|
||||
rebuild =
|
||||
pkgs.writeShellScriptBin ".nixos-rebuild"
|
||||
''
|
||||
set -e
|
||||
pushd ~/.hive/
|
||||
${pkgs.alejandra}/bin/alejandra . &>/dev/null
|
||||
${pkgs.git}/bin/git diff -U0
|
||||
echo "NixOS Rebuilding..."
|
||||
${pkgs.nh}/bin/nh os switch ~/.hive
|
||||
gen=$(sudo nix-env --list-generations --profile /nix/var/nix/profiles/system | ${pkgs.gnugrep}/bin/grep current | ${pkgs.gawk}/bin/awk '{print "Gen" $1 " @ " $2 "-" $3}')
|
||||
by="$(${pkgs.coreutils-full}/bin/whoami)@$(${pkgs.nettools}/bin/hostname)"
|
||||
${pkgs.git}/bin/git commit --no-gpg-sign -am "System $gen by $by"
|
||||
popd
|
||||
'';
|
||||
upgrade =
|
||||
pkgs.writeShellScriptBin ".nixos-upgrade"
|
||||
''
|
||||
set -e
|
||||
pushd ~/.hive/
|
||||
if [ -n "$(${pkgs.git}/bin/git status --porcelain)" ]; then
|
||||
echo ".hive is unclean!"
|
||||
exit 1
|
||||
fi
|
||||
branch_staging="staging-update"
|
||||
|
||||
if ${pkgs.git}/bin/git rev-parse --verify "$branch_staging" >/dev/null 2>&1; then
|
||||
echo "Using staging update branch."
|
||||
else
|
||||
echo "No staging update branch found."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
${pkgs.git}/bin/git checkout "$branch_staging" flake.lock
|
||||
echo "Updating nix-flake..."
|
||||
nix flake update --flake .
|
||||
echo "NixOS Rebuilding..."
|
||||
${pkgs.nh}/bin/nh os switch ~/.hive
|
||||
gen=$(sudo nix-env --list-generations --profile /nix/var/nix/profiles/system | ${pkgs.gnugrep}/bin/grep current | ${pkgs.gawk}/bin/awk '{print "Gen" $1 " @ " $2 "-" $3}')
|
||||
by="$(${pkgs.coreutils-full}/bin/whoami)@$(${pkgs.nettools}/bin/hostname)"
|
||||
${pkgs.git}/bin/git commit --no-gpg-sign -am "Upgrade $gen by $by"
|
||||
${pkgs.git}/bin/git branch -D "$branch_staging"
|
||||
popd
|
||||
'';
|
||||
update =
|
||||
pkgs.writeShellScriptBin ".nixos-update"
|
||||
''
|
||||
set -e
|
||||
pushd ~/.hive/
|
||||
if [ -n "$(${pkgs.git}/bin/git status --porcelain)" ]; then
|
||||
echo ".hive is unclean!"
|
||||
exit 1
|
||||
fi
|
||||
branch_staging="staging-update"
|
||||
branch_current="$(${pkgs.git}/bin/git branch --show-current)"
|
||||
|
||||
if ${pkgs.git}/bin/git rev-parse --verify "$branch_staging" >/dev/null 2>&1; then
|
||||
echo "There is already a staging update branch."
|
||||
else
|
||||
echo "Creating a new staging update branch."
|
||||
${pkgs.git}/bin/git switch -c "$branch_staging"
|
||||
nix flake update --verbose --flake .
|
||||
${pkgs.git}/bin/git add flake.lock
|
||||
${pkgs.git}/bin/git commit --no-gpg-sign -m "staging update"
|
||||
${pkgs.git}/bin/git switch "$branch_current"
|
||||
fi
|
||||
|
||||
nix store --log-format internal-json -v diff-closures \
|
||||
'.?ref='"$branch_current"'#nixosConfigurations.'"$(${pkgs.hostname}/bin/hostname)"'.config.system.build.toplevel' \
|
||||
'.?ref='"$branch_staging"'#nixosConfigurations.'"$(${pkgs.hostname}/bin/hostname)"'.config.system.build.toplevel' \
|
||||
|& ${pkgs.nix-output-monitor}/bin/nom --json
|
||||
|
||||
popd
|
||||
'';
|
||||
in {
|
||||
options = {
|
||||
hive.nix-scripts.enable = lib.mkEnableOption "Enable the nix build/update scripts";
|
||||
};
|
||||
|
||||
config =
|
||||
lib.mkIf cfg.enable
|
||||
(
|
||||
if isHM
|
||||
then {
|
||||
home.packages = [
|
||||
home-rebuild
|
||||
];
|
||||
}
|
||||
else {
|
||||
environment.systemPackages = [
|
||||
rebuild
|
||||
upgrade
|
||||
update
|
||||
];
|
||||
}
|
||||
);
|
||||
}
|
||||
@@ -1,60 +0,0 @@
|
||||
{
|
||||
isHM ? null,
|
||||
lib,
|
||||
...
|
||||
}: {
|
||||
assertions = [
|
||||
{
|
||||
assertion = isHM != null;
|
||||
message = "The \"home-manager\" flag isHM is required.";
|
||||
}
|
||||
];
|
||||
imports =
|
||||
[
|
||||
# modules containing both system and home-manager configs
|
||||
./bin/nix-scripts.nix
|
||||
]
|
||||
++ lib.optionals (! isHM) [
|
||||
# pure system modules
|
||||
./desktop/de
|
||||
./desktop/dm
|
||||
./desktop/themes
|
||||
./hardware/bluetooth.nix
|
||||
./hardware/sound.nix
|
||||
./hardware/yubikey.nix
|
||||
./networking/wireguard
|
||||
./programs/creative.nix
|
||||
./programs/games.nix
|
||||
./programs/spotify-shortcuts.nix
|
||||
./programs/utils.nix
|
||||
./services/borg-server.nix
|
||||
./services/gitea-instance.nix
|
||||
./services/gotify-instance.nix
|
||||
./services/kdeconnect.nix
|
||||
./services/minecraft-server
|
||||
./services/nextcloud-instance.nix
|
||||
./services/virt-manager.nix
|
||||
]
|
||||
++ lib.optionals isHM [
|
||||
# pure home-manager modules
|
||||
./home/doom
|
||||
./home/firefox.nix
|
||||
./home/flameshot.nix
|
||||
./home/gotify.nix
|
||||
./home/hyprland
|
||||
./home/jj.nix
|
||||
./home/kdeconnect.nix
|
||||
./home/kitty
|
||||
./home/nextcloud
|
||||
./home/plasma.nix
|
||||
./home/ranger
|
||||
./home/ssh.nix
|
||||
./home/swaync
|
||||
./home/themes/layan.nix
|
||||
./home/waybar
|
||||
./home/wlogout
|
||||
./home/wofi
|
||||
./home/yubikey.nix
|
||||
./home/zsh
|
||||
];
|
||||
}
|
||||
@@ -1,7 +0,0 @@
|
||||
{...}: {
|
||||
imports = [
|
||||
./hyprland.nix
|
||||
./kwallet.nix
|
||||
./plasma.nix
|
||||
];
|
||||
}
|
||||
@@ -1,39 +0,0 @@
|
||||
{
|
||||
lib,
|
||||
config,
|
||||
pkgs,
|
||||
...
|
||||
}: let
|
||||
cfg = config.hive.hyprland;
|
||||
in {
|
||||
options.hive.hyprland = {
|
||||
enable = lib.mkEnableOption "enable hyprland desktop environment";
|
||||
};
|
||||
config = lib.mkIf cfg.enable {
|
||||
services = {
|
||||
libinput.enable = true;
|
||||
dbus.enable = true;
|
||||
};
|
||||
|
||||
xdg.portal = {
|
||||
enable = true;
|
||||
extraPortals = with pkgs; [
|
||||
xdg-desktop-portal-wlr
|
||||
xdg-desktop-portal-hyprland
|
||||
kdePackages.xdg-desktop-portal-kde
|
||||
];
|
||||
};
|
||||
|
||||
environment.systemPackages = with pkgs; [spaceFM];
|
||||
|
||||
services.udisks2.enable = true;
|
||||
|
||||
programs.hyprland = {
|
||||
enable = true;
|
||||
withUWSM = true;
|
||||
xwayland.enable = true;
|
||||
};
|
||||
programs.hyprlock.enable = true;
|
||||
security.pam.services.hyprlock = {};
|
||||
};
|
||||
}
|
||||
@@ -1,24 +0,0 @@
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}: let
|
||||
cfg = config.hive.plasma;
|
||||
in {
|
||||
options.hive.plasma = {
|
||||
enable = lib.mkEnableOption "Enable Plasma desktop environment with sddm";
|
||||
};
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
services.desktopManager.plasma6.enable = true;
|
||||
|
||||
xdg.portal = {
|
||||
enable = true;
|
||||
extraPortals = with pkgs; [
|
||||
kdePackages.xdg-desktop-portal-kde
|
||||
xdg-desktop-portal-gtk
|
||||
];
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -1,36 +0,0 @@
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
...
|
||||
}: let
|
||||
cfg = config.hive.displayManager;
|
||||
in {
|
||||
options.hive.displayManager = with lib; {
|
||||
name = mkOption {
|
||||
type = types.enum ["sddm" "gdm" "cosmic"];
|
||||
default = "sddm";
|
||||
description = "The display manager to use.";
|
||||
};
|
||||
autologin = mkOption {
|
||||
type = types.nullOr types.str;
|
||||
default = null;
|
||||
description = "The autologin username or null for no autologin.";
|
||||
};
|
||||
};
|
||||
|
||||
imports = [
|
||||
./gdm.nix
|
||||
./sddm.nix
|
||||
];
|
||||
|
||||
config = {
|
||||
services.xserver.enable = true;
|
||||
services.xserver = {
|
||||
xkb.layout = "de";
|
||||
xkb.variant = "";
|
||||
xkb.options = "caps:ctrl_modifier";
|
||||
};
|
||||
services.displayManager.autoLogin.enable = cfg.autologin != null;
|
||||
services.displayManager.autoLogin.user = cfg.autologin;
|
||||
};
|
||||
}
|
||||
@@ -1,14 +0,0 @@
|
||||
{
|
||||
lib,
|
||||
config,
|
||||
...
|
||||
}: let
|
||||
cfg = config.hive.displayManager;
|
||||
in {
|
||||
config = lib.mkIf (cfg.name == "gdm") {
|
||||
services.xserver.displayManager.gdm = {
|
||||
enable = true;
|
||||
wayland = true;
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -1,15 +0,0 @@
|
||||
{
|
||||
lib,
|
||||
config,
|
||||
pkgs,
|
||||
...
|
||||
}: let
|
||||
cfg = config.hive.displayManager;
|
||||
in {
|
||||
config = lib.mkIf (cfg.name == "sddm") {
|
||||
services.displayManager.sddm = {
|
||||
enable = true;
|
||||
wayland.enable = true;
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -1,5 +0,0 @@
|
||||
{...}: {
|
||||
imports = [
|
||||
./layan.nix
|
||||
];
|
||||
}
|
||||
@@ -1,21 +0,0 @@
|
||||
{
|
||||
lib,
|
||||
config,
|
||||
pkgs,
|
||||
...
|
||||
}: let
|
||||
cfg = config.hive.themes.layan;
|
||||
in {
|
||||
options.hive.themes.layan = {
|
||||
enable = lib.mkEnableOption "Layan theme configuration";
|
||||
};
|
||||
config = lib.mkIf cfg.enable {
|
||||
environment.systemPackages = [
|
||||
pkgs.hive.layan-qt6
|
||||
pkgs.kdePackages.qtstyleplugin-kvantum
|
||||
pkgs.unstable.layan-cursors
|
||||
pkgs.layan-gtk-theme
|
||||
pkgs.tela-circle-icon-theme
|
||||
];
|
||||
};
|
||||
}
|
||||
@@ -1,5 +0,0 @@
|
||||
{...}: {
|
||||
imports = [
|
||||
./doom.nix
|
||||
];
|
||||
}
|
||||
@@ -1,288 +0,0 @@
|
||||
{
|
||||
config,
|
||||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}: let
|
||||
cfg = config.hive.doom;
|
||||
doom-pkgs = with pkgs; [
|
||||
cmake
|
||||
emacs-all-the-icons-fonts
|
||||
fira
|
||||
fira-code-symbols
|
||||
fontconfig
|
||||
gcc
|
||||
nerd-fonts.fira-code
|
||||
];
|
||||
default-core-pkgs = with pkgs; [
|
||||
(ripgrep.override {withPCRE2 = true;})
|
||||
(aspellWithDicts (d: [d.en d.de d.en-computers d.en-science]))
|
||||
binutils
|
||||
editorconfig-core-c
|
||||
fd
|
||||
git
|
||||
gnumake
|
||||
gnutls
|
||||
ispell
|
||||
libtool
|
||||
vscode-langservers-extracted
|
||||
(pkgs.stdenvNoCC.mkDerivation {
|
||||
name = "epdfinfo";
|
||||
phases = "installPhase";
|
||||
installPhase = ''
|
||||
mkdir -p $out/bin
|
||||
ln -s $(${pkgs.findutils}/bin/find ${pkgs.emacsPackages.pdf-tools}/ -name epdfinfo) $out/bin/
|
||||
'';
|
||||
})
|
||||
];
|
||||
default-shell-pkgs = with pkgs; [
|
||||
bash-language-server
|
||||
];
|
||||
default-nix-pkgs = with pkgs; [
|
||||
alejandra
|
||||
nixd
|
||||
];
|
||||
default-latex-pkgs = with pkgs; [
|
||||
pandoc
|
||||
poppler
|
||||
texlab
|
||||
texlive.combined.scheme-medium
|
||||
];
|
||||
default-cxx-pkgs = with pkgs; [
|
||||
clang
|
||||
clang-tools
|
||||
cmake
|
||||
cppcheck
|
||||
doxygen
|
||||
gdb
|
||||
ninja
|
||||
];
|
||||
default-python-pkgs = with pkgs; [
|
||||
python312
|
||||
python312Packages.black
|
||||
pyright
|
||||
];
|
||||
doom-path-pkgs =
|
||||
lib.optionals cfg.withLatexPkgs (cfg.overrideLatexPkgs default-latex-pkgs)
|
||||
++ lib.optionals cfg.withShellPkgs (cfg.overrideShellPkgs default-shell-pkgs)
|
||||
++ lib.optionals cfg.withNixPkgs (cfg.overrideNixPkgs default-nix-pkgs)
|
||||
++ lib.optionals cfg.withCXXPkgs (cfg.overrideCXXPkgs default-cxx-pkgs)
|
||||
++ lib.optionals cfg.withPythonPkgs (cfg.overridePythonPkgs default-python-pkgs)
|
||||
++ lib.optional cfg.enableCopilot pkgs.unstable.copilot-language-server
|
||||
++ default-core-pkgs;
|
||||
doom-socket-name = "main";
|
||||
wrapped-emacs = pkgs.symlinkJoin {
|
||||
name = "wrapped-emacs";
|
||||
paths = [pkgs.emacs30];
|
||||
nativeBuildInputs = [pkgs.makeBinaryWrapper];
|
||||
postBuild = ''
|
||||
wrapProgram $out/bin/emacs \
|
||||
--prefix PATH : ${lib.makeBinPath doom-path-pkgs} \
|
||||
--add-flags "--init-directory=${config.xdg.configHome}/doom-emacs" \
|
||||
--set DOOMDIR "${config.home.sessionVariables.DOOMDIR}" \
|
||||
--set DOOMLOCALDIR "${config.home.sessionVariables.DOOMLOCALDIR}"
|
||||
|
||||
wrapProgram $out/bin/emacsclient \
|
||||
--prefix PATH : ${lib.makeBinPath doom-path-pkgs} \
|
||||
--set DOOMDIR "${config.home.sessionVariables.DOOMDIR}" \
|
||||
--set DOOMLOCALDIR "${config.home.sessionVariables.DOOMLOCALDIR}"
|
||||
'';
|
||||
};
|
||||
doom-setup = pkgs.writeShellScript "doom-setup" ''
|
||||
export PATH="${lib.makeBinPath doom-path-pkgs}:$PATH"
|
||||
export EMACS="${wrapped-emacs}/bin/emacs"
|
||||
export DOOMDIR="${config.home.sessionVariables.DOOMDIR}"
|
||||
export DOOMLOCALDIR="${config.home.sessionVariables.DOOMLOCALDIR}"
|
||||
if [ ! -d "$DOOMLOCALDIR" ]; then
|
||||
${config.xdg.configHome}/doom-emacs/bin/doom install --force --no-env
|
||||
else
|
||||
${config.xdg.configHome}/doom-emacs/bin/doom "$@"
|
||||
fi
|
||||
'';
|
||||
doom-open = pkgs.writeShellScriptBin "doom-open" ''
|
||||
export EMACS_SOCKET_NAME="$XDG_RUNTIME_DIR/emacs/${doom-socket-name}"
|
||||
if [ -t 0 ]; then
|
||||
exec ${wrapped-emacs}/bin/emacsclient -t "$@"
|
||||
else
|
||||
exec ${wrapped-emacs}/bin/emacsclient -c "$@"
|
||||
fi
|
||||
'';
|
||||
in {
|
||||
options.hive.doom = {
|
||||
enable = lib.mkEnableOption "Enable Doom Emacs";
|
||||
asDefaultEditor = lib.mkEnableOption "set the EDITOR variable to use the current emacs server (graphical/non-graphical)";
|
||||
enableCopilot = lib.mkEnableOption "Enable Copilot in Doom Emacs";
|
||||
enableTidal = lib.mkEnableOption "Enable TidalCycles";
|
||||
withLatexPkgs = lib.mkEnableOption "Enable LaTeX packages in doom path";
|
||||
withShellPkgs = lib.mkEnableOption "Enable shell packages in doom path";
|
||||
withNixPkgs = lib.mkEnableOption "Enable LaTeX packages in doom path";
|
||||
withCXXPkgs = lib.mkEnableOption "Enable CXX packages in doom path";
|
||||
withPythonPkgs = lib.mkEnableOption "Enable python packages in doom path";
|
||||
overrideLatexPkgs = lib.mkOption {
|
||||
type = lib.types.functionTo (lib.types.listOf lib.types.package);
|
||||
default = pkgs: pkgs;
|
||||
example = ''
|
||||
prev: with pkgs; [
|
||||
texlive.combined.scheme-full
|
||||
]
|
||||
'';
|
||||
description = "Override the default LaTeX packages in the doom path.";
|
||||
};
|
||||
overrideShellPkgs = lib.mkOption {
|
||||
type = lib.types.functionTo (lib.types.listOf lib.types.package);
|
||||
default = pkgs: pkgs;
|
||||
example = ''
|
||||
prev: with pkgs; [
|
||||
shellcheck
|
||||
]
|
||||
'';
|
||||
description = "Override the default shell packages in the doom path.";
|
||||
};
|
||||
overrideNixPkgs = lib.mkOption {
|
||||
type = lib.types.functionTo (lib.types.listOf lib.types.package);
|
||||
default = pkgs: pkgs;
|
||||
example = ''
|
||||
prev: with pkgs; [
|
||||
nixpkgs-fmt
|
||||
]
|
||||
'';
|
||||
description = "Override the default Nix packages in the doom path.";
|
||||
};
|
||||
overrideCXXPkgs = lib.mkOption {
|
||||
type = lib.types.functionTo (lib.types.listOf lib.types.package);
|
||||
default = pkgs: pkgs;
|
||||
example = ''
|
||||
prev: with pkgs; [
|
||||
openmp
|
||||
]
|
||||
'';
|
||||
description = "Override the default C++ packages in the doom path.";
|
||||
};
|
||||
overridePythonPkgs = lib.mkOption {
|
||||
type = lib.types.functionTo (lib.types.listOf lib.types.package);
|
||||
default = pkgs: pkgs;
|
||||
example = ''
|
||||
prev: with pkgs; [
|
||||
pythonPackages.black
|
||||
]
|
||||
'';
|
||||
description = "Override the default Python packages in the doom path.";
|
||||
};
|
||||
};
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
fonts.fontconfig.enable = true;
|
||||
|
||||
programs.emacs = {
|
||||
enable = true;
|
||||
package = wrapped-emacs;
|
||||
};
|
||||
|
||||
home = {
|
||||
sessionPath = ["${config.xdg.configHome}/doom-emacs/bin"];
|
||||
sessionVariables =
|
||||
{
|
||||
DOOMDIR = "${config.xdg.configHome}/doom-config";
|
||||
DOOMLOCALDIR = "${config.xdg.configHome}/doom-local";
|
||||
}
|
||||
// lib.optionalAttrs cfg.asDefaultEditor {
|
||||
EDITOR = "${doom-open.name}";
|
||||
};
|
||||
packages = doom-pkgs ++ lib.optional cfg.asDefaultEditor doom-open;
|
||||
};
|
||||
|
||||
systemd.user.services.doom-emacs-server = {
|
||||
Unit = {
|
||||
Description = "Doom Emacs Server";
|
||||
};
|
||||
Service = {
|
||||
ExecStart = "${wrapped-emacs}/bin/emacs --fg-daemon=${doom-socket-name}";
|
||||
SuccessExitStatus = 15;
|
||||
};
|
||||
Install = {
|
||||
WantedBy = []; # Lazy start by socket
|
||||
};
|
||||
};
|
||||
systemd.user.sockets.doom-emacs-server = {
|
||||
Socket = {
|
||||
ListenStream = "/run/user/%U/emacs/${doom-socket-name}";
|
||||
DirectoryMode = "0700";
|
||||
};
|
||||
Install = {
|
||||
WantedBy = ["sockets.target"];
|
||||
};
|
||||
};
|
||||
|
||||
xdg = {
|
||||
enable = true;
|
||||
configFile = {
|
||||
"doom-config/splash.png" = {
|
||||
source = ./static/splash.png;
|
||||
};
|
||||
"doom-config/config.el" = {
|
||||
source = ./static/config.el;
|
||||
};
|
||||
"doom-config/config.d/copilot.el" = {
|
||||
enable = cfg.enableCopilot;
|
||||
source = ./static/config.d/copilot.el;
|
||||
};
|
||||
"doom-config/packages/treesit-docgen.el" = {
|
||||
source = ./static/packages/treesit-docgen.el;
|
||||
};
|
||||
"doom-config/init.el" = {
|
||||
source = ./static/init.el;
|
||||
onChange = "${doom-setup} sync --force -e";
|
||||
};
|
||||
"doom-config/packages.el" = {
|
||||
source = ./static/packages.el;
|
||||
onChange = "${doom-setup} sync --force -u -e";
|
||||
};
|
||||
"doom-config/packages.d/copilot.el" = {
|
||||
enable = cfg.enableCopilot;
|
||||
source = ./static/packages.d/copilot.el;
|
||||
onChange = "${doom-setup} sync --force -u -e";
|
||||
};
|
||||
"doom-config/packages.d/tidal.el" = {
|
||||
enable = cfg.enableTidal;
|
||||
source = ./static/packages.d/tidal.el;
|
||||
onChange = "${doom-setup} sync --force -u -e";
|
||||
};
|
||||
"doom-emacs" = {
|
||||
source = builtins.fetchGit {
|
||||
url = "https://github.com/doomemacs/doomemacs";
|
||||
rev = "a0d6aac43fc94def29c98826e2f0088bcb703d13";
|
||||
};
|
||||
onChange = "${doom-setup} --force sync -u -e";
|
||||
};
|
||||
};
|
||||
desktopEntries = {
|
||||
emacs = {
|
||||
name = "Doom Emacs";
|
||||
genericName = "Text Editor";
|
||||
icon = ./static/icon.png;
|
||||
exec = "${wrapped-emacs}/bin/emacs %F";
|
||||
terminal = false;
|
||||
categories = ["Application" "Development" "TextEditor"];
|
||||
mimeType = ["text/*"];
|
||||
settings = {
|
||||
StartupWMClass = "Doom Emacs";
|
||||
};
|
||||
};
|
||||
emacsclient = {
|
||||
name = "Doom Emacs (Client)";
|
||||
genericName = "Text Editor";
|
||||
icon = ./static/icon.png;
|
||||
exec = ''
|
||||
sh -c "if [ -n \\"\\$*\\" ]; then exec ${wrapped-emacs}/bin/emacsclient --alternate-editor= --display=\\"\\$DISPLAY\\" \\"\\$@\\"; else exec emacsclient --alternate-editor= --create-frame; fi" sh %F
|
||||
'';
|
||||
terminal = false;
|
||||
categories = ["Application" "Development" "TextEditor"];
|
||||
mimeType = ["text/*"];
|
||||
settings = {
|
||||
StartupWMClass = "Doom Emacs";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -1,96 +0,0 @@
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
inputs,
|
||||
pkgs,
|
||||
...
|
||||
}: let
|
||||
cfg = config.hive.firefox;
|
||||
in {
|
||||
options.hive.firefox = {
|
||||
enable = lib.mkEnableOption "Enable Firefox";
|
||||
plasmaIntegration = lib.mkEnableOption "Enable Plasma Integration";
|
||||
passFF = lib.mkEnableOption "Enable PassFF";
|
||||
};
|
||||
config = lib.mkIf cfg.enable {
|
||||
programs.firefox = {
|
||||
enable = true;
|
||||
nativeMessagingHosts = lib.optional cfg.passFF pkgs.passff-host;
|
||||
|
||||
# Default profile
|
||||
profiles.jonas = {
|
||||
name = "Jonas";
|
||||
id = 0;
|
||||
isDefault = true;
|
||||
|
||||
# Search
|
||||
search = {
|
||||
default = "ddg";
|
||||
order = ["ddg" "google"];
|
||||
force = true;
|
||||
engines = {
|
||||
"Nix Packages" = {
|
||||
urls = [
|
||||
{
|
||||
template = "https://search.nixos.org/packages";
|
||||
params = [
|
||||
{
|
||||
name = "type";
|
||||
value = "packages";
|
||||
}
|
||||
{
|
||||
name = "query";
|
||||
value = "{searchTerms}";
|
||||
}
|
||||
];
|
||||
}
|
||||
];
|
||||
};
|
||||
"Noogle" = {
|
||||
urls = [
|
||||
{
|
||||
template = "https://noogle.dev/q";
|
||||
params = [
|
||||
{
|
||||
name = "term";
|
||||
value = "{searchTerms}";
|
||||
}
|
||||
];
|
||||
}
|
||||
];
|
||||
};
|
||||
"cppreference" = {
|
||||
urls = [
|
||||
{
|
||||
template = "https://en.cppreference.com/mwiki/index.php";
|
||||
params = [
|
||||
{
|
||||
name = "title";
|
||||
value = "Special%3ASearch";
|
||||
}
|
||||
{
|
||||
name = "search";
|
||||
value = "{searchTerms}";
|
||||
}
|
||||
{
|
||||
name = "Go";
|
||||
value = "go";
|
||||
}
|
||||
];
|
||||
}
|
||||
];
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
# Extensions
|
||||
extensions.packages = with inputs.firefox-addons.packages."x86_64-linux"; ([
|
||||
ublock-origin
|
||||
violentmonkey
|
||||
]
|
||||
++ lib.optional cfg.plasmaIntegration plasma-integration
|
||||
++ lib.optional cfg.passFF passff);
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -1,12 +0,0 @@
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
...
|
||||
}: let
|
||||
cfg = config.hive.flameshot;
|
||||
in {
|
||||
options.hive.flameshot.enable = lib.mkEnableOption "Flameshot service.";
|
||||
config = lib.mkIf cfg.enable {
|
||||
services.flameshot.enable = true;
|
||||
};
|
||||
}
|
||||
@@ -1,153 +0,0 @@
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}: let
|
||||
cfg = config.hive.gotify;
|
||||
cli-config = {
|
||||
token = config.sops.placeholder.${cfg.cli.tokenSopsKey};
|
||||
inherit (cfg.cli) url defaultPriority;
|
||||
};
|
||||
daemon-config = {
|
||||
gotify =
|
||||
{
|
||||
inherit (cfg.daemon) url;
|
||||
token = config.sops.placeholder.${cfg.daemon.tokenSopsKey};
|
||||
auto_delete = cfg.daemon.autoDelete;
|
||||
min_priority = cfg.daemon.minPriority;
|
||||
}
|
||||
// lib.optionalAttrs (cfg.daemon.onMsgCommand != null) {
|
||||
on_msg_command = cfg.daemon.onMsgCommand;
|
||||
};
|
||||
};
|
||||
|
||||
valueToString = val:
|
||||
if (builtins.typeOf val == "string")
|
||||
then "\"${val}\""
|
||||
else
|
||||
(
|
||||
if (builtins.typeOf val == "int")
|
||||
then "${toString val}"
|
||||
else
|
||||
(
|
||||
if (builtins.typeOf val == "bool")
|
||||
then
|
||||
(
|
||||
if val
|
||||
then "true"
|
||||
else "false"
|
||||
)
|
||||
else (abort "Expected string int or bool, got ${builtins.typeOf val} with value ${toString val}")
|
||||
)
|
||||
);
|
||||
|
||||
toTOML = attrs:
|
||||
lib.concatStrings (
|
||||
lib.attrValues (
|
||||
lib.mapAttrs (
|
||||
name: config: ''
|
||||
[${name}]
|
||||
${lib.concatStringsSep "\n" (lib.attrValues (lib.mapAttrs (k: v: "${k} = ${valueToString v}") config))}
|
||||
''
|
||||
)
|
||||
attrs
|
||||
)
|
||||
);
|
||||
in {
|
||||
options.hive.gotify = {
|
||||
cli = {
|
||||
enable = lib.mkEnableOption "Enable Gotify cli tool";
|
||||
url = lib.mkOption {
|
||||
type = lib.types.singleLineStr;
|
||||
default = "https://${cfg.host}:${toString cfg.port}";
|
||||
example = "http://gotify.example.com";
|
||||
description = "The http url of the gotify server (for the cli tool)";
|
||||
};
|
||||
tokenSopsKey = lib.mkOption {
|
||||
type = lib.types.singleLineStr;
|
||||
description = "The sops key of the token secret";
|
||||
};
|
||||
defaultPriority = lib.mkOption {
|
||||
type = lib.types.int;
|
||||
default = 0;
|
||||
example = 3;
|
||||
description = "The default priority of the dispatched messages";
|
||||
};
|
||||
};
|
||||
daemon = {
|
||||
enable = lib.mkEnableOption "Enable the Gotify desktop notification daemon";
|
||||
url = lib.mkOption {
|
||||
type = lib.types.singleLineStr;
|
||||
default = "wss://${cfg.host}:${toString cfg.port}";
|
||||
example = "ws://gotify.example.com";
|
||||
description = "The websocket url of the gotify server (for the desktop tool)";
|
||||
};
|
||||
tokenSopsKey = lib.mkOption {
|
||||
type = lib.types.singleLineStr;
|
||||
description = "The sops key of the token secret";
|
||||
};
|
||||
autoDelete = lib.mkOption {
|
||||
type = lib.types.bool;
|
||||
default = false;
|
||||
example = true;
|
||||
description = "Delete messages that have been handled";
|
||||
};
|
||||
minPriority = lib.mkOption {
|
||||
type = lib.types.int;
|
||||
default = 0;
|
||||
example = 1;
|
||||
description = "Ignore messages with priority lower than given value";
|
||||
};
|
||||
onMsgCommand = lib.mkOption {
|
||||
type = lib.types.nullOr lib.types.singleLineStr;
|
||||
default = null;
|
||||
example = "/usr/bin/beep";
|
||||
description = '' A command to tun for each message with env vars
|
||||
GOTIFY_MSG_PRIORITY, GOTIFY_MSG_TITLE and GOTIFY_MSG_TEXTs
|
||||
If unset use the standard desktop notification passing
|
||||
'';
|
||||
};
|
||||
};
|
||||
host = lib.mkOption {
|
||||
type = lib.types.singleLineStr;
|
||||
example = "example.com";
|
||||
description = "The hostname of the gotify server";
|
||||
};
|
||||
port = lib.mkOption {
|
||||
type = lib.types.int;
|
||||
default = 443;
|
||||
example = 443;
|
||||
description = "The port of the gotify server";
|
||||
};
|
||||
};
|
||||
|
||||
config = let
|
||||
cli = lib.mkIf cfg.cli.enable {
|
||||
home.packages = [pkgs.gotify-cli];
|
||||
sops.templates."gotify-cli-json" = {
|
||||
content = lib.generators.toJSON {} cli-config;
|
||||
path = "${config.xdg.configHome}/gotify/cli.json";
|
||||
};
|
||||
};
|
||||
daemon = lib.mkIf cfg.daemon.enable {
|
||||
systemd.user.services.gotify-desktop = {
|
||||
Unit = {
|
||||
Description = "Gotify Desktop notification service";
|
||||
After = ["sops-nix.service"]; # After the secrets have been rendered
|
||||
};
|
||||
Service = {
|
||||
ExecStart = "${pkgs.gotify-desktop}/bin/gotify-desktop";
|
||||
};
|
||||
Install = {
|
||||
WantedBy = ["multi-user.target"];
|
||||
};
|
||||
};
|
||||
sops.templates."gotify-daemon-toml" = {
|
||||
content = toTOML daemon-config;
|
||||
path = "${config.xdg.configHome}/gotify-desktop/config.toml";
|
||||
};
|
||||
};
|
||||
in
|
||||
lib.mkMerge [cli daemon];
|
||||
}
|
||||
@@ -1,362 +0,0 @@
|
||||
{
|
||||
config,
|
||||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}: let
|
||||
cfg = config.hive.hyprland;
|
||||
screenshot = pkgs.writeShellScriptBin "screenshot" ''
|
||||
region=0
|
||||
clip=0
|
||||
while [[ "$#" -gt 0 ]]; do
|
||||
case $1 in
|
||||
--region) region=1; ;;
|
||||
--clip) clip=1; ;;
|
||||
*) echo "Unknown parameter passed: $1"; exit 1 ;;
|
||||
esac
|
||||
shift
|
||||
done
|
||||
|
||||
if [[ $region -eq 1 ]]; then
|
||||
if [[ $clip -eq 1 ]]; then
|
||||
${pkgs.grim}/bin/grim -g "$(${pkgs.slurp}/bin/slurp)" - | ${pkgs.wl-clipboard}/bin/wl-copy
|
||||
else
|
||||
${pkgs.grim}/bin/grim -g "$(${pkgs.slurp}/bin/slurp)" ~/Pictures/Screenshots/$(${pkgs.coreutils}/bin/date +'%Y-%m-%d_%H-%M-%S').png
|
||||
fi
|
||||
else
|
||||
if [[ $clip -eq 1 ]]; then
|
||||
${pkgs.grim}/bin/grim - | ${pkgs.wl-clipboard}/bin/wl-copy
|
||||
else
|
||||
${pkgs.grim}/bin/grim ~/Pictures/Screenshots/$(${pkgs.coreutils}/bin/date +'%Y-%m-%d_%H-%M-%S').png
|
||||
fi
|
||||
fi
|
||||
'';
|
||||
in {
|
||||
config = lib.mkIf cfg.enable {
|
||||
services.hypridle.settings = {
|
||||
general = {
|
||||
# lock_cmd = notify-send "lock!" # dbus/sysd lock command (loginctl lock-session)
|
||||
# unlock_cmd = notify-send "unlock!" # same as above, but unlock
|
||||
ignore_dbus_inhibit = "false"; # whether to ignore dbus-sent idle-inhibit requests (used by e.g. firefox or steam)
|
||||
lock_cmd = "pidof hyprlock || hyprlock"; # avoid starting multiple hyprlock instances.
|
||||
before_sleep_cmd = "loginctl lock-session"; # lock before suspend.
|
||||
after_sleep_cmd = "hyprctl dispatch dpms on"; # to avoid having to press a key twice to turn on the display.
|
||||
};
|
||||
|
||||
listener = [
|
||||
# Screenlock
|
||||
{
|
||||
timeout = 180; # in seconds
|
||||
on-timeout = "hyprlock"; # command to run when timeout has passed
|
||||
# on-resume = notify-send "Welcome back to your desktop!" # command to run when activity is detected after timeout has fired.
|
||||
}
|
||||
# Suspend
|
||||
{
|
||||
timeout = 360; # in seconds
|
||||
on-timeout = "systemctl suspend"; # command to run when timeout has passed
|
||||
# on-resume = notify-send "Welcome back to your desktop!" # command to run when activity is detected after timeout has fired.
|
||||
}
|
||||
];
|
||||
};
|
||||
|
||||
programs.hyprlock = {
|
||||
enable = true;
|
||||
settings = {
|
||||
background = [
|
||||
{
|
||||
path = "screenshot"; # only png supported for now
|
||||
# color = $color1
|
||||
|
||||
# all these options are taken from hyprland, see https://wiki.hyprland.org/Configuring/Variables/#blur for explanations
|
||||
blur_size = 4;
|
||||
blur_passes = 3; # 0 disables blurring
|
||||
noise = 0.0117;
|
||||
contrast = 1.3000; # Vibrant!!!
|
||||
brightness = 0.8000;
|
||||
vibrancy = 0.2100;
|
||||
vibrancy_darkness = 0.0;
|
||||
}
|
||||
];
|
||||
|
||||
# Hours
|
||||
label = [
|
||||
{
|
||||
text = ''cmd[update:1000] echo "<b><big> $(date +"%H") </big></b>"'';
|
||||
#color = $color6
|
||||
font_size = 112;
|
||||
# font_family = Geist Mono 10
|
||||
shadow_passes = 3;
|
||||
shadow_size = 4;
|
||||
|
||||
position = "0, 220";
|
||||
halign = "center";
|
||||
valign = "center";
|
||||
}
|
||||
{
|
||||
text = ''cmd[update:1000] echo "<b><big> $(date +"%M") </big></b>"'';
|
||||
# color = $color6
|
||||
font_size = 112;
|
||||
# font_family = Geist Mono 10
|
||||
shadow_passes = 3;
|
||||
shadow_size = 4;
|
||||
|
||||
position = "0, 80";
|
||||
halign = "center";
|
||||
valign = "center";
|
||||
}
|
||||
{
|
||||
text = ''cmd[update:18000000] echo "<b><big> "$(date +'%A')" </big></b>"'';
|
||||
# color = $color7
|
||||
font_size = 22;
|
||||
# font_family = JetBrainsMono Nerd Font 10
|
||||
|
||||
position = "0, -10";
|
||||
halign = "center";
|
||||
valign = "center";
|
||||
}
|
||||
{
|
||||
text = ''cmd[update:18000000] echo "<b> "$(${pkgs.coreutils-full}/bin/date +'%d %b')" </b>"'';
|
||||
# color = $color7
|
||||
font_size = 18;
|
||||
#font_family = JetBrainsMono Nerd Font 10
|
||||
|
||||
position = "0, -40";
|
||||
halign = "center";
|
||||
valign = "center";
|
||||
}
|
||||
{
|
||||
text = ''cmd[update:18000000] echo "<b>So ca. <big> $(${pkgs.curl}/bin/curl -s 'wttr.in?format=%t' | ${pkgs.coreutils-full}/bin/tr -d '+')</big> oder watt.</b>"'';
|
||||
#color = $color7
|
||||
font_size = 18;
|
||||
# font_family = Geist Mono 10
|
||||
|
||||
position = "0, 40";
|
||||
halign = "center";
|
||||
valign = "bottom";
|
||||
}
|
||||
];
|
||||
|
||||
input-field = [
|
||||
{
|
||||
size = "250, 50";
|
||||
outline_thickness = 3;
|
||||
|
||||
dots_size = 0.26; # Scale of input-field height, 0.2 - 0.8
|
||||
dots_spacing = 0.64; # Scale of dots' absolute size, 0.0 - 1.0
|
||||
dots_center = true;
|
||||
dots_rouding = -1;
|
||||
|
||||
rounding = 22;
|
||||
# outer_color = $color0
|
||||
# inner_color = $color0
|
||||
# font_color = $color6
|
||||
fade_on_empty = true;
|
||||
placeholder_text = ''<i>Password...</i>''; # Text rendered in the input box when it's empty.
|
||||
|
||||
position = "0, 120";
|
||||
halign = "center";
|
||||
valign = "bottom";
|
||||
}
|
||||
];
|
||||
};
|
||||
};
|
||||
|
||||
wayland.windowManager.hyprland = {
|
||||
settings = {
|
||||
exec-once = [
|
||||
"${pkgs.wpaperd}/bin/wpaperd &"
|
||||
];
|
||||
|
||||
"$mod" = "SUPER";
|
||||
bind =
|
||||
[
|
||||
"$mod, RETURN, exec, ${pkgs.kitty}/bin/kitty"
|
||||
"$mod, d, exec, ${pkgs.wofi}/bin/wofi --show drun"
|
||||
"$mod, h, movefocus, l"
|
||||
"$mod, j, movefocus, d"
|
||||
"$mod, k, movefocus, u"
|
||||
"$mod, l, movefocus, r"
|
||||
"$mod, LEFT, movefocus, l"
|
||||
"$mod, DOWN, movefocus, d"
|
||||
"$mod, UP, movefocus, u"
|
||||
"$mod, RIGHT, movefocus, r"
|
||||
"$mod SHIFT, h, movewindow, l"
|
||||
"$mod SHIFT, j, movewindow, d"
|
||||
"$mod SHIFT, k, movewindow, u"
|
||||
"$mod SHIFT, l, movewindow, r"
|
||||
"$mod SHIFT, LEFT, movewindow, l"
|
||||
"$mod SHIFT, DOWN, movewindow, d"
|
||||
"$mod SHIFT, UP, movewindow, u"
|
||||
|
||||
"$mod CTRL SHIFT, LEFT, moveactive, -10 0"
|
||||
"$mod CTRL SHIFT, DOWN, moveactive, 0 10"
|
||||
"$mod CTRL SHIFT, UP, moveactive, 0 -10"
|
||||
"$mod CTRL SHIFT, RIGHT, moveactive, 10 0"
|
||||
"$mod CTRL SHIFT, h, moveactive, -10 0"
|
||||
"$mod CTRL SHIFT, j, moveactive, 0 10"
|
||||
"$mod CTRL SHIFT, k, moveactive, 0 -10"
|
||||
"$mod CTRL SHIFT, l, moveactive, 10 0"
|
||||
"$mod SHIFT, q, killactive"
|
||||
"$mod CTRL, h, resizeactive, -5% 0%"
|
||||
"$mod CTRL, l, resizeactive, 5% 0%"
|
||||
"$mod CTRL, j, resizeactive, 0% -5%"
|
||||
"$mod CTRL, k, resizeactive, 0% 5%"
|
||||
"$mod, SPACE, togglefloating, active"
|
||||
"$mod SHIFT, SPACE, centerwindow"
|
||||
"$mod, f, fullscreen, 1"
|
||||
"$mod SHIFT, f, fullscreen, 0"
|
||||
"$mod CTRL, f, fullscreenstate, -1 2"
|
||||
"$mod SHIFT, s, pin"
|
||||
"$mod SHIFT, x, exec, ${pkgs.hyprland}/bin/hyprctl kill"
|
||||
", XF86AudioRaiseVolume, exec, ${pkgs.pulsemixer}/bin/pulsemixer --change-volume +5"
|
||||
", XF86AudioLowerVolume, exec, ${pkgs.pulsemixer}/bin/pulsemixer --change-volume -5"
|
||||
", XF86AudioMute, exec, ${pkgs.pulsemixer}/bin/pulsemixer --toggle-mute"
|
||||
", XF86AudioMicMute, exec, ${pkgs.pulsemixer}/bin/pulsemixer --toggle-mute --id 1"
|
||||
", XF86MonBrightnessUp, exec, ${pkgs.brightnessctl}/bin/brightnessctl set +5%"
|
||||
", XF86MonBrightnessDown, exec, ${pkgs.brightnessctl}/bin/brightnessctl set 5%-"
|
||||
"$mod, 9, exec, ${pkgs.hyprlock}/bin/hyprlock"
|
||||
"$mod, 0, exec, ${pkgs.wlogout}/bin/wlogout -b 5"
|
||||
"$mod, n, exec, ${pkgs.swaynotificationcenter}/bin/swaync-client -t"
|
||||
", Print, exec, ${screenshot}/bin/screenshot"
|
||||
"CTRL, Print, exec, ${screenshot}/bin/screenshot --region"
|
||||
"SHIFT, Print, exec, ${screenshot}/bin/screenshot --clip"
|
||||
"CTRL SHIFT, Print, exec, ${screenshot}/bin/screenshot --region --clip"
|
||||
]
|
||||
++ (
|
||||
# workspaces
|
||||
# binds $mod + [shift +] {1..10} to [move to] workspace {1..10}
|
||||
builtins.concatLists (builtins.genList (
|
||||
x: let
|
||||
ws = builtins.toString (x + 1);
|
||||
in [
|
||||
"$mod, ${ws}, workspace, ${ws}"
|
||||
"$mod SHIFT, ${ws}, movetoworkspace, ${ws}"
|
||||
"$mod CTRL, ${ws}, movetoworkspacesilent, ${ws}"
|
||||
]
|
||||
)
|
||||
8)
|
||||
);
|
||||
# See https://wiki.hyprland.org/Configuring/Monitors/
|
||||
monitor = ",preferred,auto,1";
|
||||
env = [
|
||||
"GDK_SCALE,1"
|
||||
"XCURSOR_SIZE,12"
|
||||
];
|
||||
|
||||
xwayland = {
|
||||
force_zero_scaling = true;
|
||||
};
|
||||
|
||||
# See https://wiki.hyprland.org/Configuring/Keywords/ for more
|
||||
|
||||
# Execute your favorite apps at launch
|
||||
# exec-once = waybar & hyprpaper & firefox
|
||||
|
||||
# Source a file (multi-file configs)
|
||||
# source = ~/.config/hypr/myColors.conf
|
||||
|
||||
# For all categories, see https://wiki.hyprland.org/Configuring/Variables/
|
||||
input = {
|
||||
kb_layout = "de";
|
||||
kb_variant = "deadacute";
|
||||
kb_model = "";
|
||||
kb_options = "caps:ctrl_modifier";
|
||||
kb_rules = "";
|
||||
repeat_delay = 250;
|
||||
repeat_rate = 30;
|
||||
follow_mouse = 1;
|
||||
|
||||
touchpad = {
|
||||
natural_scroll = "yes";
|
||||
};
|
||||
|
||||
sensitivity = 0; # -1.0 - 1.0, 0 means no modification.
|
||||
};
|
||||
|
||||
general = {
|
||||
# See https://wiki.hyprland.org/Configuring/Variables/ for more
|
||||
|
||||
gaps_in = 5;
|
||||
gaps_out = 10;
|
||||
border_size = 2;
|
||||
"col.active_border" = "rgba(33ccffee) rgba(00ff99ee) 45deg";
|
||||
"col.inactive_border" = "rgba(595959aa)";
|
||||
|
||||
layout = "dwindle";
|
||||
|
||||
# Please see https://wiki.hyprland.org/Configuring/Tearing/ before you turn this on
|
||||
allow_tearing = false;
|
||||
};
|
||||
|
||||
layerrule = [
|
||||
# blur for wlogout
|
||||
"blur, logout_dialog"
|
||||
|
||||
# blur for swaync
|
||||
"blur, swaync-control-center"
|
||||
"blur, swaync-notification-window"
|
||||
"ignorezero, swaync-control-center"
|
||||
"ignorezero, swaync-notification-window"
|
||||
"ignorealpha 0.5, swaync-control-center"
|
||||
"ignorealpha 0.5, swaync-notification-window"
|
||||
];
|
||||
|
||||
decoration = {
|
||||
# See https://wiki.hyprland.org/Configuring/Variables/ for more
|
||||
|
||||
rounding = 10;
|
||||
|
||||
blur = {
|
||||
enabled = true;
|
||||
size = 8;
|
||||
passes = 1;
|
||||
new_optimizations = true;
|
||||
};
|
||||
};
|
||||
|
||||
animations = {
|
||||
enabled = "yes";
|
||||
|
||||
# Some default animations, see https://wiki.hyprland.org/Configuring/Animations/ for more
|
||||
|
||||
bezier = "myBezier, 0.05, 0.9, 0.1, 1.05";
|
||||
|
||||
animation = [
|
||||
"windows, 1, 7, myBezier"
|
||||
"windowsOut, 1, 7, default, popin 80%"
|
||||
"border, 1, 10, default"
|
||||
"borderangle, 1, 8, default"
|
||||
"fade, 1, 7, default"
|
||||
"workspaces, 1, 6, default"
|
||||
];
|
||||
};
|
||||
|
||||
dwindle = {
|
||||
# See https://wiki.hyprland.org/Configuring/Dwindle-Layout/ for more
|
||||
pseudotile = "yes"; # master switch for pseudotiling. Enabling is bound to mainMod + P in the keybinds section below
|
||||
preserve_split = "yes"; # you probably want this
|
||||
};
|
||||
|
||||
master = {
|
||||
# See https://wiki.hyprland.org/Configuring/Master-Layout/ for more
|
||||
# new_is_master = true;
|
||||
};
|
||||
|
||||
ecosystem = {
|
||||
no_update_news = true;
|
||||
};
|
||||
|
||||
misc = {
|
||||
# See https://wiki.hyprland.org/Configuring/Variables/ for more
|
||||
force_default_wallpaper = 0; # Set to 0 to disable the anime mascot wallpapers
|
||||
};
|
||||
|
||||
# Example per-device config
|
||||
# See https://wiki.hyprland.org/Configuring/Keywords/#executing for more
|
||||
# "device:epic-mouse-v1" = {
|
||||
# sensitivity = -0.5;
|
||||
# };
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -1,10 +0,0 @@
|
||||
{lib, ...}: {
|
||||
options.hive.hyprland = {
|
||||
enable = lib.mkEnableOption "Enable Hyprland configuration";
|
||||
};
|
||||
|
||||
imports = [
|
||||
./config.nix
|
||||
./hyprland.nix
|
||||
];
|
||||
}
|
||||
@@ -1,32 +0,0 @@
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}: let
|
||||
cfg = config.hive.hyprland;
|
||||
in {
|
||||
config = lib.mkIf cfg.enable {
|
||||
wayland.windowManager.hyprland = {
|
||||
enable = true;
|
||||
systemd.enable = false;
|
||||
systemd.variables = ["--all"];
|
||||
xwayland.enable = true;
|
||||
};
|
||||
|
||||
home.packages = with pkgs; [
|
||||
wl-clipboard
|
||||
];
|
||||
|
||||
services.hypridle.enable = true;
|
||||
|
||||
services.wpaperd = {
|
||||
enable = true;
|
||||
settings = {
|
||||
default = {
|
||||
path = ../../../static/wallpaper/stones.jpg;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -1,36 +0,0 @@
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}: let
|
||||
cfg = config.hive.jj;
|
||||
in {
|
||||
options.hive.jj = {
|
||||
enable = lib.mkEnableOption "Enable jj vcs";
|
||||
followGit = lib.mkOption {
|
||||
type = lib.types.bool;
|
||||
default = true;
|
||||
description = "Follow the current git configuration";
|
||||
};
|
||||
};
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
home.packages = with pkgs; [
|
||||
jujutsu
|
||||
];
|
||||
|
||||
programs.jujutsu = {
|
||||
enable = true;
|
||||
settings = {
|
||||
user = lib.optionalAttrs cfg.followGit {
|
||||
name = config.programs.git.settings.user.name;
|
||||
email = config.programs.git.settings.user.email;
|
||||
};
|
||||
ui = lib.optionalAttrs (cfg.followGit && config.programs.difftastic.enable) {
|
||||
diff-formatter = ["${pkgs.difftastic}/bin/difft" "--color=always" "$left" "$right"];
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -1,22 +0,0 @@
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
...
|
||||
}: let
|
||||
cfg = config.hive.kdeconnect;
|
||||
in {
|
||||
options.hive.kdeconnect = {
|
||||
enable = lib.mkEnableOption "Enable KDE Connect";
|
||||
indicatorOnly = lib.mkOption {
|
||||
type = lib.types.bool;
|
||||
default = false;
|
||||
description = ''
|
||||
Only enable the incicator service.
|
||||
'';
|
||||
};
|
||||
};
|
||||
config = lib.mkIf cfg.enable {
|
||||
services.kdeconnect.enable = ! cfg.indicatorOnly;
|
||||
services.kdeconnect.indicator = true;
|
||||
};
|
||||
}
|
||||
@@ -1,29 +0,0 @@
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}: let
|
||||
cfg = config.hive.kitty;
|
||||
in {
|
||||
options.hive.kitty = {
|
||||
enable = lib.mkEnableOption "Enable kitty terminal";
|
||||
};
|
||||
config = lib.mkIf cfg.enable {
|
||||
programs.kitty = {
|
||||
enable = true;
|
||||
shellIntegration.enableZshIntegration = true;
|
||||
font = {
|
||||
package = pkgs.nerd-fonts.fira-code;
|
||||
name = "FiraCode Nerd Font";
|
||||
size = 12;
|
||||
};
|
||||
themeFile = "Molokai";
|
||||
settings = {
|
||||
background_opacity = "0.6";
|
||||
enable_audio_bell = false;
|
||||
confirm_os_window_close = 0;
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -1,19 +0,0 @@
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}: let
|
||||
cfg = config.hive.nextcloud;
|
||||
in {
|
||||
options.hive.nextcloud = {
|
||||
enable = lib.mkEnableOption "Enable Nextcloud client";
|
||||
};
|
||||
config = lib.mkIf cfg.enable {
|
||||
services.nextcloud-client = {
|
||||
enable = true;
|
||||
startInBackground = true;
|
||||
package = pkgs.nextcloud-client;
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -1,147 +0,0 @@
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}: let
|
||||
cfg = config.hive.plasma;
|
||||
in {
|
||||
options.hive.plasma.enable = lib.mkEnableOption "Plasma configuration";
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
# load hm-vars in x-session
|
||||
xsession.enable = true;
|
||||
|
||||
# symlink wallpapers
|
||||
home.file.".local/share/wallpaper" = {
|
||||
source = ../../static/wallpaper;
|
||||
recursive = true;
|
||||
};
|
||||
|
||||
# provide kvantum and nord theme
|
||||
home.packages = [
|
||||
pkgs.kdePackages.qtstyleplugin-kvantum
|
||||
pkgs.layan-kde
|
||||
pkgs.nordzy-cursor-theme
|
||||
pkgs.qt6ct
|
||||
pkgs.tela-circle-icon-theme
|
||||
];
|
||||
|
||||
programs.konsole = {
|
||||
enable = true;
|
||||
defaultProfile = "default";
|
||||
profiles = {
|
||||
default = {
|
||||
name = "default";
|
||||
colorScheme = "Layan";
|
||||
font = {
|
||||
name = "Fira Code";
|
||||
size = 10;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
# use kvantum theme
|
||||
qt.enable = true;
|
||||
qt.style.name = "kvantum";
|
||||
home.sessionVariables = {
|
||||
QT_STYLE_OVERRIDE = "kvantum";
|
||||
};
|
||||
|
||||
# add nord like gtk theme
|
||||
gtk = {
|
||||
enable = true;
|
||||
cursorTheme = {
|
||||
package = pkgs.nordzy-cursor-theme;
|
||||
name = "Nordzy-cursors";
|
||||
};
|
||||
theme = {
|
||||
package = pkgs.nordic;
|
||||
name = "Nordic";
|
||||
};
|
||||
iconTheme = {
|
||||
package = pkgs.tela-circle-icon-theme;
|
||||
name = "Tela-circle-nord";
|
||||
};
|
||||
};
|
||||
|
||||
programs.plasma = {
|
||||
enable = true;
|
||||
|
||||
#
|
||||
# Some high-level settings:
|
||||
#
|
||||
workspace = {
|
||||
clickItemTo = "select";
|
||||
lookAndFeel = "com.github.vinceliuice.Layan";
|
||||
cursor = {
|
||||
theme = "Nordzy-cursors";
|
||||
size = 24;
|
||||
};
|
||||
iconTheme = "Tela-circle-nord";
|
||||
wallpaper = "/home/jonas/.local/share/wallpaper/nord.png";
|
||||
};
|
||||
|
||||
hotkeys.commands."launch-konsole" = {
|
||||
name = "Launch Konsole";
|
||||
key = "Meta+Return";
|
||||
command = "konsole";
|
||||
};
|
||||
|
||||
kwin = {
|
||||
edgeBarrier = 0; # Disables the edge-barriers introduced in plasma 6.1
|
||||
cornerBarrier = false;
|
||||
|
||||
scripts.polonium.enable = false;
|
||||
};
|
||||
|
||||
kscreenlocker = {
|
||||
lockOnResume = true;
|
||||
timeout = 10;
|
||||
};
|
||||
|
||||
#
|
||||
# Some mid-level settings:
|
||||
#
|
||||
shortcuts = {
|
||||
ksmserver = {
|
||||
"Lock Session" = ["Screensaver" "Meta+Ctrl+Alt+L"];
|
||||
};
|
||||
|
||||
kwin =
|
||||
{
|
||||
"Expose" = "Meta+,";
|
||||
"Switch Window Down" = "Meta+J";
|
||||
"Switch Window Left" = "Meta+H";
|
||||
"Switch Window Right" = "Meta+L";
|
||||
"Switch Window Up" = "Meta+K";
|
||||
"Window Quick Tile Bottom" = "Meta+Shift+J";
|
||||
"Window Quick Tile Left" = "Meta+Shift+H";
|
||||
"Window Quick Tile Right" = "Meta+Shift+L";
|
||||
"Window Quick Tile Top" = "Meta+Shift+K";
|
||||
"Kill Window" = "Meta+Alt+Q";
|
||||
"Window Close" = "Meta+Shift+Q";
|
||||
}
|
||||
// (
|
||||
with lib; let
|
||||
desktops = map toString (lists.range 1 8);
|
||||
in
|
||||
listToAttrs
|
||||
(map
|
||||
(i: {
|
||||
name = "Switch to Desktop ${i}";
|
||||
value = "Meta+${i}";
|
||||
})
|
||||
desktops)
|
||||
// listToAttrs (map
|
||||
(i: {
|
||||
name = "Window to Desktop ${i}";
|
||||
value = "Meta+Shift+${i}";
|
||||
})
|
||||
desktops)
|
||||
);
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -1,68 +0,0 @@
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
...
|
||||
}: let
|
||||
cfg = config.hive.ranger;
|
||||
in {
|
||||
options.hive.ranger = {
|
||||
enable = lib.mkEnableOption "Enable ranger";
|
||||
};
|
||||
config = lib.mkIf cfg.enable {
|
||||
programs.ranger = {
|
||||
enable = true;
|
||||
settings = {
|
||||
preview_images = true;
|
||||
preview_images_method =
|
||||
if config.programs.kitty.enable
|
||||
then "kitty"
|
||||
else "ueberzug";
|
||||
};
|
||||
extraConfig = lib.strings.concatStringsSep "\n" [
|
||||
"default_linemode devicons"
|
||||
];
|
||||
mappings = {
|
||||
f = "console fzf_filter%space";
|
||||
};
|
||||
plugins =
|
||||
[
|
||||
{
|
||||
name = "ranger_fzf_filter";
|
||||
src = builtins.fetchGit {
|
||||
url = "https://github.com/MuXiu1997/ranger-fzf-filter";
|
||||
rev = "bf16de2e4ace415b685ff7c58306d0c5146f9f43";
|
||||
};
|
||||
}
|
||||
{
|
||||
name = "ranger_archives";
|
||||
src = builtins.fetchGit {
|
||||
url = "https://github.com/maximtrp/ranger-archives";
|
||||
rev = "b4e136b24fdca7670e0c6105fb496e5df356ef25";
|
||||
};
|
||||
}
|
||||
{
|
||||
name = "ranger_devicons";
|
||||
src = builtins.fetchGit {
|
||||
url = "https://github.com/alexanderjeurissen/ranger_devicons";
|
||||
rev = "f227f212e14996fbb366f945ec3ecaf5dc5f44b0";
|
||||
};
|
||||
}
|
||||
]
|
||||
++ (
|
||||
if config.services.kdeconnect.enable
|
||||
then
|
||||
lib.lists.singleton
|
||||
{
|
||||
name = "ranger_kdeconnect.py";
|
||||
src =
|
||||
builtins.fetchGit {
|
||||
url = "https://github.com/bwconrad/ranger-kdeconnect";
|
||||
rev = "710c600bb894fed3e293f6518930c16a494dd154";
|
||||
}
|
||||
+ "/kdeconnect_send.py";
|
||||
}
|
||||
else []
|
||||
);
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -1,46 +0,0 @@
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
...
|
||||
}: let
|
||||
cfg = config.hive.ssh;
|
||||
in {
|
||||
options.hive.ssh = {
|
||||
enable = lib.mkEnableOption "SSH keys and config";
|
||||
keys = lib.mkOption {
|
||||
type = lib.types.listOf (lib.types.str);
|
||||
default = [];
|
||||
description = ''
|
||||
A list of SSH key names. Each one results in a id_<name> file in .ssh
|
||||
'';
|
||||
};
|
||||
sopsFile = lib.mkOption {
|
||||
type = lib.types.path;
|
||||
default = null;
|
||||
description = ''
|
||||
Path to the sops file containing the SSH keys.
|
||||
Requires a config key. And for each private key names in <keys> an keys.<name> entry.
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
sops.secrets =
|
||||
{
|
||||
"ssh/config" = {
|
||||
inherit (cfg) sopsFile;
|
||||
key = "config";
|
||||
path = "${config.home.homeDirectory}/.ssh/config";
|
||||
};
|
||||
}
|
||||
// builtins.listToAttrs (map (name: {
|
||||
name = "ssh/id_${name}";
|
||||
value = {
|
||||
inherit (cfg) sopsFile;
|
||||
key = "keys/${name}";
|
||||
path = "${config.home.homeDirectory}/.ssh/id_${name}";
|
||||
};
|
||||
})
|
||||
cfg.keys);
|
||||
};
|
||||
}
|
||||
@@ -1,121 +0,0 @@
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}: let
|
||||
cfg = config.hive.swaync;
|
||||
in {
|
||||
options.hive.swaync = {
|
||||
enable = lib.mkEnableOption "Enable swaync";
|
||||
};
|
||||
config = lib.mkIf cfg.enable {
|
||||
xdg.enable = true;
|
||||
xdg.configFile = {
|
||||
"swaync/themes" = {
|
||||
source = ./themes;
|
||||
};
|
||||
"swaync/icons" = {
|
||||
source = ./icons;
|
||||
recursive = true;
|
||||
};
|
||||
};
|
||||
services.swaync.enable = true;
|
||||
services.swaync.style = ''
|
||||
@import 'themes/nova-dark/notifications.css';
|
||||
@import 'themes/nova-dark/central_control.css';
|
||||
'';
|
||||
services.swaync.settings = {
|
||||
positionX = "right";
|
||||
positionY = "top";
|
||||
cssPriority = "user";
|
||||
|
||||
control-center-width = 380;
|
||||
control-center-height = 860;
|
||||
control-center-margin-top = 2;
|
||||
control-center-margin-bottom = 2;
|
||||
control-center-margin-right = 1;
|
||||
control-center-margin-left = 0;
|
||||
|
||||
notification-window-width = 400;
|
||||
notification-icon-size = 48;
|
||||
notification-body-image-height = 160;
|
||||
notification-body-image-width = 200;
|
||||
|
||||
timeout = 4;
|
||||
timeout-low = 2;
|
||||
timeout-critical = 6;
|
||||
|
||||
fit-to-screen = false;
|
||||
keyboard-shortcuts = true;
|
||||
image-visibility = "when-available";
|
||||
transition-time = 200;
|
||||
hide-on-clear = false;
|
||||
hide-on-action = false;
|
||||
script-fail-notify = true;
|
||||
scripts = {
|
||||
example-script = {
|
||||
exec = "echo 'Do something...'";
|
||||
urgency = "Normal";
|
||||
};
|
||||
};
|
||||
notification-visibility = {
|
||||
example-name = {
|
||||
state = "muted";
|
||||
urgency = "Low";
|
||||
app-name = "Spotify";
|
||||
};
|
||||
};
|
||||
widgets = [
|
||||
"label"
|
||||
"buttons-grid"
|
||||
"mpris"
|
||||
"title"
|
||||
"dnd"
|
||||
"notifications"
|
||||
];
|
||||
widget-config = {
|
||||
title = {
|
||||
text = "Notifications";
|
||||
clear-all-button = true;
|
||||
button-text = " ";
|
||||
};
|
||||
dnd = {
|
||||
text = "Do not disturb";
|
||||
};
|
||||
label = {
|
||||
max-lines = 1;
|
||||
text = " ";
|
||||
};
|
||||
mpris = {
|
||||
image-size = 96;
|
||||
image-radius = 12;
|
||||
};
|
||||
volume = {
|
||||
label = "";
|
||||
show-per-app = true;
|
||||
};
|
||||
buttons-grid = {
|
||||
actions = [
|
||||
{
|
||||
label = " ";
|
||||
command = "${pkgs.alsa-utils}/bin/amixer set Master toggle";
|
||||
}
|
||||
{
|
||||
label = "";
|
||||
command = "${pkgs.alsa-utils}/bin/amixer set Capture toggle";
|
||||
}
|
||||
{
|
||||
label = " ";
|
||||
command = "${pkgs.networkmanagerapplet}/bin/nm-connection-editor";
|
||||
}
|
||||
{
|
||||
label = "";
|
||||
command = "${pkgs.blueman}/bin/blueman-manager";
|
||||
}
|
||||
];
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
Before Width: | Height: | Size: 13 KiB |
|
Before Width: | Height: | Size: 10 KiB |
|
Before Width: | Height: | Size: 7.3 KiB |
|
Before Width: | Height: | Size: 8.0 KiB |
|
Before Width: | Height: | Size: 9.0 KiB |
|
Before Width: | Height: | Size: 10 KiB |
|
Before Width: | Height: | Size: 11 KiB |
|
Before Width: | Height: | Size: 12 KiB |
|
Before Width: | Height: | Size: 14 KiB |
|
Before Width: | Height: | Size: 14 KiB |
|
Before Width: | Height: | Size: 14 KiB |
|
Before Width: | Height: | Size: 11 KiB |
|
Before Width: | Height: | Size: 6.0 KiB |
|
Before Width: | Height: | Size: 12 KiB |
|
Before Width: | Height: | Size: 28 KiB |
|
Before Width: | Height: | Size: 16 KiB |
|
Before Width: | Height: | Size: 16 KiB |
|
Before Width: | Height: | Size: 18 KiB |
|
Before Width: | Height: | Size: 16 KiB |
@@ -1,258 +0,0 @@
|
||||
@define-color text @foreground;
|
||||
@define-color background-alt alpha(@color1, .4);
|
||||
@define-color selected @color6;
|
||||
@define-color hover alpha(@selected, .4);
|
||||
@define-color urgent @color2;
|
||||
|
||||
/* Temporary color defs */
|
||||
@define-color background rgb(0,10,20);
|
||||
@define-color background-alt rgb(0,20,30);
|
||||
@define-color selected rgb(0,30,130);
|
||||
|
||||
* {
|
||||
color: @text;
|
||||
|
||||
all: unset;
|
||||
font-size: 14px;
|
||||
/*font-family: "JetBrains Mono Nerd Font 10";*/
|
||||
transition: 200ms;
|
||||
|
||||
}
|
||||
|
||||
/* Avoid 'annoying' backgroud */
|
||||
.blank-window {
|
||||
background: transparent;
|
||||
}
|
||||
|
||||
/* CONTROL CENTER ------------------------------------------------------------------------ */
|
||||
|
||||
.control-center {
|
||||
background: alpha(@background, .55);
|
||||
border-radius: 24px;
|
||||
border: 1px solid @selected;
|
||||
box-shadow: 0 0 10px 0 rgba(0,0,0,.6);
|
||||
margin: 18px;
|
||||
padding: 12px;
|
||||
}
|
||||
|
||||
/* Notifications */
|
||||
.control-center .notification-row .notification-background,
|
||||
.control-center .notification-row .notification-background .notification.critical {
|
||||
background-color: @background-alt;
|
||||
border-radius: 16px;
|
||||
margin: 4px 0px;
|
||||
padding: 4px;
|
||||
}
|
||||
|
||||
.control-center .notification-row .notification-background .notification.critical {
|
||||
color: @urgent;
|
||||
}
|
||||
|
||||
.control-center .notification-row .notification-background .notification .notification-content {
|
||||
margin: 6px;
|
||||
padding: 8px 6px 2px 2px;
|
||||
}
|
||||
|
||||
.control-center .notification-row .notification-background .notification > *:last-child > * {
|
||||
min-height: 3.4em;
|
||||
}
|
||||
|
||||
.control-center .notification-row .notification-background .notification > *:last-child > * .notification-action {
|
||||
background: alpha(@selected, .6);
|
||||
color: @text;
|
||||
border-radius: 12px;
|
||||
margin: 6px;
|
||||
}
|
||||
|
||||
.control-center .notification-row .notification-background .notification > *:last-child > * .notification-action:hover {
|
||||
background: @selected;
|
||||
}
|
||||
|
||||
.control-center .notification-row .notification-background .notification > *:last-child > * .notification-action:active {
|
||||
background-color: @selected;
|
||||
}
|
||||
|
||||
/* Buttons */
|
||||
|
||||
.control-center .notification-row .notification-background .close-button {
|
||||
background: transparent;
|
||||
border-radius: 6px;
|
||||
color: @text;
|
||||
margin: 0px;
|
||||
padding: 4px;
|
||||
}
|
||||
|
||||
.control-center .notification-row .notification-background .close-button:hover {
|
||||
background-color: @selected;
|
||||
}
|
||||
|
||||
.control-center .notification-row .notification-background .close-button:active {
|
||||
background-color: @selected;
|
||||
}
|
||||
|
||||
progressbar,
|
||||
progress,
|
||||
trough {
|
||||
border-radius: 12px;
|
||||
}
|
||||
|
||||
progressbar {
|
||||
background-color: rgba(255,255,255,.1);
|
||||
}
|
||||
|
||||
/* Notifications expanded-group */
|
||||
|
||||
.notification-group {
|
||||
margin: 2px 8px 2px 8px;
|
||||
|
||||
}
|
||||
.notification-group-headers {
|
||||
font-weight: bold;
|
||||
font-size: 1.25rem;
|
||||
color: @text;
|
||||
letter-spacing: 2px;
|
||||
}
|
||||
|
||||
.notification-group-icon {
|
||||
color: @text;
|
||||
}
|
||||
|
||||
.notification-group-collapse-button,
|
||||
.notification-group-close-all-button {
|
||||
background: transparent;
|
||||
color: @text;
|
||||
margin: 4px;
|
||||
border-radius: 6px;
|
||||
padding: 4px;
|
||||
}
|
||||
|
||||
.notification-group-collapse-button:hover,
|
||||
.notification-group-close-all-button:hover {
|
||||
background: @hover;
|
||||
}
|
||||
|
||||
/* WIDGETS --------------------------------------------------------------------------- */
|
||||
|
||||
/* Notification clear button */
|
||||
.widget-title {
|
||||
font-size: 1.2em;
|
||||
margin: 6px;
|
||||
}
|
||||
|
||||
.widget-title button {
|
||||
background: @background-alt;
|
||||
border-radius: 6px;
|
||||
padding: 4px 16px;
|
||||
}
|
||||
|
||||
.widget-title button:hover {
|
||||
background-color: @hover;
|
||||
}
|
||||
|
||||
.widget-title button:active {
|
||||
background-color: @selected;
|
||||
}
|
||||
|
||||
/* Do not disturb */
|
||||
.widget-dnd {
|
||||
margin: 6px;
|
||||
font-size: 1.2rem;
|
||||
}
|
||||
|
||||
.widget-dnd > switch {
|
||||
background: @background-alt;
|
||||
font-size: initial;
|
||||
border-radius: 8px;
|
||||
box-shadow: none;
|
||||
padding: 2px;
|
||||
}
|
||||
|
||||
.widget-dnd > switch:hover {
|
||||
background: @hover;
|
||||
}
|
||||
|
||||
.widget-dnd > switch:checked {
|
||||
background: @selected;
|
||||
}
|
||||
|
||||
.widget-dnd > switch:checked:hover {
|
||||
background: @hover;
|
||||
}
|
||||
|
||||
.widget-dnd > switch slider {
|
||||
background: @text;
|
||||
border-radius: 6px;
|
||||
}
|
||||
|
||||
/* Buttons menu */
|
||||
.widget-buttons-grid {
|
||||
font-size: x-large;
|
||||
padding: 6px 2px;
|
||||
margin: 6px;
|
||||
border-radius: 12px;
|
||||
background: @background-alt;
|
||||
}
|
||||
|
||||
.widget-buttons-grid>flowbox>flowboxchild>button {
|
||||
margin: 4px 10px;
|
||||
padding: 6px 12px;
|
||||
background: transparent;
|
||||
border-radius: 8px;
|
||||
}
|
||||
|
||||
.widget-buttons-grid>flowbox>flowboxchild>button:hover {
|
||||
background: @hover;
|
||||
}
|
||||
|
||||
|
||||
/* Music player */
|
||||
.widget-mpris {
|
||||
background: @background-alt;
|
||||
border-radius: 16px;
|
||||
color: @text;
|
||||
margin: 20px 6px;
|
||||
}
|
||||
|
||||
/* NOTE: Background need *opacity 1* otherwise will turn into the album art blurred */
|
||||
.widget-mpris-player {
|
||||
background-color: @background-sec;
|
||||
border-radius: 22px;
|
||||
padding: 6px 14px;
|
||||
margin: 6px;
|
||||
}
|
||||
|
||||
.widget-mpris > box > button {
|
||||
color: @text;
|
||||
border-radius: 20px;
|
||||
}
|
||||
|
||||
.widget-mpris button {
|
||||
color: alpha(@text, .6);
|
||||
}
|
||||
|
||||
.widget-mpris button:hover {
|
||||
color: @text;
|
||||
}
|
||||
|
||||
.widget-mpris-album-art {
|
||||
border-radius: 16px;
|
||||
}
|
||||
|
||||
.widget-mpris-title {
|
||||
font-weight: 700;
|
||||
font-size: 1rem;
|
||||
}
|
||||
|
||||
.widget-mpris-subtitle {
|
||||
font-weight: 500;
|
||||
font-size: 0.8rem;
|
||||
}
|
||||
|
||||
/* Volume */
|
||||
.widget-volume {
|
||||
background: @background-sec;
|
||||
color: @background;
|
||||
padding: 4px;
|
||||
margin: 6px;
|
||||
border-radius: 6px;
|
||||
}
|
||||
@@ -1,115 +0,0 @@
|
||||
@define-color text @foreground;
|
||||
@define-color background-alt @color1;
|
||||
@define-color selected @color3;
|
||||
@define-color hover @color5;
|
||||
@define-color urgent @color2;
|
||||
/* Temporary color defs */
|
||||
@define-color background rgb(0,10,20);
|
||||
@define-color background-alt rgb(0,20,30);
|
||||
@define-color selected rgb(0,30,130);
|
||||
|
||||
* {
|
||||
|
||||
/*background-alt: @color1; Buttons background */
|
||||
/*selected: @color2; Button selected */
|
||||
/*hover: @color5; Hover button */
|
||||
/*urgent: @color6; Urgency critical */
|
||||
/*text-selected: @background; */
|
||||
|
||||
color: @text;
|
||||
|
||||
all: unset;
|
||||
font-size: 14px;
|
||||
font-family: "JetBrains Mono Nerd Font 10";
|
||||
transition: 200ms;
|
||||
|
||||
}
|
||||
|
||||
.notification-row {
|
||||
outline: none;
|
||||
margin: 0;
|
||||
padding: 0px;
|
||||
}
|
||||
|
||||
.floating-notifications.background .notification-row .notification-background {
|
||||
background: alpha(@background, .55);
|
||||
box-shadow: 0 0 8px 0 rgba(0,0,0,.6);
|
||||
border: 1px solid @selected;
|
||||
border-radius: 24px;
|
||||
margin: 16px;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.floating-notifications.background .notification-row .notification-background .notification {
|
||||
padding: 6px;
|
||||
border-radius: 12px;
|
||||
}
|
||||
|
||||
.floating-notifications.background .notification-row .notification-background .notification.critical {
|
||||
border: 2px solid @urgent;
|
||||
}
|
||||
|
||||
.floating-notifications.background .notification-row .notification-background .notification .notification-content {
|
||||
margin: 14px;
|
||||
}
|
||||
|
||||
.floating-notifications.background .notification-row .notification-background .notification > *:last-child > * {
|
||||
min-height: 3.4em;
|
||||
}
|
||||
|
||||
.floating-notifications.background .notification-row .notification-background .notification > *:last-child > * .notification-action {
|
||||
border-radius: 8px;
|
||||
background-color: @background-alt ;
|
||||
margin: 6px;
|
||||
border: 1px solid transparent;
|
||||
}
|
||||
|
||||
.floating-notifications.background .notification-row .notification-background .notification > *:last-child > * .notification-action:hover {
|
||||
background-color: @hover;
|
||||
border: 1px solid @selected;
|
||||
}
|
||||
|
||||
.floating-notifications.background .notification-row .notification-background .notification > *:last-child > * .notification-action:active {
|
||||
background-color: @selected;
|
||||
color: @background;
|
||||
}
|
||||
|
||||
.image {
|
||||
margin: 10px 20px 10px 0px;
|
||||
}
|
||||
|
||||
.summary {
|
||||
font-weight: 800;
|
||||
font-size: 1rem;
|
||||
}
|
||||
|
||||
.body {
|
||||
font-size: 0.8rem;
|
||||
}
|
||||
|
||||
.floating-notifications.background .notification-row .notification-background .close-button {
|
||||
margin: 6px;
|
||||
padding: 2px;
|
||||
border-radius: 6px;
|
||||
background-color: transparent;
|
||||
border: 1px solid transparent;
|
||||
}
|
||||
|
||||
.floating-notifications.background .notification-row .notification-background .close-button:hover {
|
||||
background-color: @selected;
|
||||
}
|
||||
|
||||
.floating-notifications.background .notification-row .notification-background .close-button:active {
|
||||
background-color: @selected;
|
||||
color: @background;
|
||||
}
|
||||
|
||||
.notification.critical progress {
|
||||
background-color: @selected;
|
||||
}
|
||||
|
||||
.notification.low progress,
|
||||
.notification.normal progress {
|
||||
background-color: @selected;
|
||||
}
|
||||
|
||||
@@ -1,56 +0,0 @@
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}: let
|
||||
cfg = config.hive.themes.layan;
|
||||
in {
|
||||
options.hive.themes.layan = {
|
||||
enable = lib.mkEnableOption "Layan theme configuration";
|
||||
pkgsInHome = lib.mkOption {
|
||||
type = lib.types.bool;
|
||||
default = false;
|
||||
description = "Whether to install Layan theme packages in the user's home directory.";
|
||||
};
|
||||
};
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
home.packages = lib.optionals cfg.pkgsInHome [
|
||||
pkgs.hive.layan-qt6
|
||||
pkgs.kdePackages.qtstyleplugin-kvantum
|
||||
pkgs.unstable.layan-cursors
|
||||
pkgs.layan-gtk-theme
|
||||
pkgs.tela-circle-icon-theme
|
||||
];
|
||||
|
||||
qt.enable = false;
|
||||
qt.style.name = "kvantum";
|
||||
qt.style.package = pkgs.kdePackages.qtstyleplugin-kvantum;
|
||||
qt.platformTheme.name = "gtk";
|
||||
systemd.user.settings.Manager.DefaultEnvironment = lib.mapAttrs (_: lib.mkDefault) {
|
||||
QT_STYLE_OVERRIDE = "kvantum";
|
||||
QT_QPA_PLATFORMTHEME = "gtk";
|
||||
};
|
||||
xdg.configFile."Kvantum/kvantum.kvconfig".text = lib.generators.toINI {} {
|
||||
General.theme = "LayanDark";
|
||||
};
|
||||
|
||||
# add nord like gtk theme
|
||||
gtk = {
|
||||
enable = true;
|
||||
cursorTheme = {
|
||||
package = pkgs.unstable.layan-cursors;
|
||||
name = "Layan-cursors";
|
||||
};
|
||||
theme = {
|
||||
package = pkgs.layan-gtk-theme;
|
||||
name = "Layan-Dark";
|
||||
};
|
||||
iconTheme = {
|
||||
package = pkgs.tela-circle-icon-theme;
|
||||
name = "Tela-circle-dark";
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -1,266 +0,0 @@
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}: let
|
||||
cfg = config.hive.waybar;
|
||||
in {
|
||||
options.hive.waybar = {
|
||||
enable = lib.mkEnableOption "Enable Waybar";
|
||||
};
|
||||
config = lib.mkIf cfg.enable {
|
||||
programs.waybar.enable = true;
|
||||
programs.waybar.systemd.enable = true;
|
||||
|
||||
services.blueman-applet.enable = true;
|
||||
services.network-manager-applet.enable = true;
|
||||
services.pasystray.enable = true;
|
||||
|
||||
# is already fixed on latest home-manager rev
|
||||
systemd.user.services = {
|
||||
blueman-applet.Unit.After = lib.mkForce ["graphical-session.target"];
|
||||
network-manager-applet.Unit.After = lib.mkForce ["graphical-session.target"];
|
||||
pasystray.Unit.After = lib.mkForce ["graphical-session.target"];
|
||||
waybar.Unit.After = lib.mkForce ["graphical-session.target"];
|
||||
};
|
||||
|
||||
home.packages = with pkgs; [
|
||||
pulsemixer
|
||||
pavucontrol
|
||||
networkmanagerapplet
|
||||
];
|
||||
|
||||
programs.waybar = {
|
||||
settings.mainBar = {
|
||||
position = "top";
|
||||
layer = "top";
|
||||
height = 5;
|
||||
margin-top = 0;
|
||||
margin-bottom = 0;
|
||||
margin-left = 0;
|
||||
margin-right = 0;
|
||||
modules-left = [
|
||||
"custom/launcher"
|
||||
"hyprland/workspaces"
|
||||
];
|
||||
modules-center = [
|
||||
"hyprland/window"
|
||||
];
|
||||
modules-right = [
|
||||
"clock"
|
||||
"cpu"
|
||||
"memory"
|
||||
"disk"
|
||||
"battery"
|
||||
"network"
|
||||
"tray"
|
||||
];
|
||||
clock = {
|
||||
calendar = {
|
||||
format = {today = "<span color='#b4befe'><b>{}</b></span>";};
|
||||
};
|
||||
format = " {:%H:%M}";
|
||||
tooltip = "true";
|
||||
tooltip-format = "<big>{:%Y %B}</big>\n<tt><small>{calendar}</small></tt>";
|
||||
format-alt = " {:%d/%m}";
|
||||
};
|
||||
"hyprland/workspaces" = {
|
||||
active-only = false;
|
||||
disable-scroll = true;
|
||||
format = "{icon}";
|
||||
on-click = "activate";
|
||||
format-icons = {
|
||||
"1" = "1";
|
||||
"2" = "2";
|
||||
"3" = "3";
|
||||
"4" = "4";
|
||||
"5" = "5";
|
||||
"6" = "6";
|
||||
"7" = "7";
|
||||
"8" = "8";
|
||||
urgent = "";
|
||||
default = "";
|
||||
sort-by-number = true;
|
||||
};
|
||||
persistent-workspaces = {
|
||||
"1" = [];
|
||||
"2" = [];
|
||||
"3" = [];
|
||||
"4" = [];
|
||||
"5" = [];
|
||||
"6" = [];
|
||||
"7" = [];
|
||||
"8" = [];
|
||||
};
|
||||
};
|
||||
memory = {
|
||||
format = " {}%";
|
||||
format-alt = " {used} GiB"; #
|
||||
interval = 2;
|
||||
};
|
||||
cpu = {
|
||||
format = " {usage}%";
|
||||
format-alt = " {avg_frequency} GHz";
|
||||
interval = 2;
|
||||
};
|
||||
disk = {
|
||||
# path = "/";
|
||||
format = " {percentage_used}%";
|
||||
interval = 60;
|
||||
};
|
||||
network = {
|
||||
format-wifi = " {signalStrength}%";
|
||||
format-ethernet = " ";
|
||||
tooltip-format = "Connected to {essid} {ifname} via {gwaddr}";
|
||||
format-linked = "{ifname} (No IP)";
|
||||
format-disconnected = " ";
|
||||
};
|
||||
tray = {
|
||||
icon-size = 20;
|
||||
spacing = 8;
|
||||
};
|
||||
pulseaudio = {
|
||||
format = "{icon} {volume}%";
|
||||
format-muted = " {volume}%";
|
||||
format-icons = {
|
||||
default = [" "];
|
||||
};
|
||||
scroll-step = 5;
|
||||
on-click = "pamixer -t";
|
||||
};
|
||||
battery = {
|
||||
format = "{icon} {capacity}%";
|
||||
format-icons = [" " " " " " " " " "];
|
||||
format-charging = " {capacity}%";
|
||||
format-full = " {capacity}%";
|
||||
format-warning = " {capacity}%";
|
||||
interval = 5;
|
||||
states = {
|
||||
warning = 20;
|
||||
};
|
||||
format-time = "{H}h{M}m";
|
||||
tooltip = true;
|
||||
tooltip-format = "{time}";
|
||||
};
|
||||
"custom/launcher" = {
|
||||
format = "";
|
||||
on-click = "${pkgs.wofi}/bin/wofi --show drun";
|
||||
tooltip = "false";
|
||||
};
|
||||
};
|
||||
style = ''
|
||||
* {
|
||||
border: none;
|
||||
font-family: Font Awesome, Roboto, Arial, sans-serif;
|
||||
font-size: 13px;
|
||||
color: #ffffff;
|
||||
border-radius: 15px;
|
||||
}
|
||||
|
||||
window {
|
||||
/*font-weight: bold;*/
|
||||
}
|
||||
window#waybar {
|
||||
border-style: none;
|
||||
border-width: 1px;
|
||||
border-color: #33ccff;
|
||||
background: rgba(0, 0, 0, 0);
|
||||
}
|
||||
/*-----module groups----*/
|
||||
.modules-right {
|
||||
background-color: rgba(0,43,51,0.85);
|
||||
margin: 2px 10px 2px 0;
|
||||
}
|
||||
.modules-left {
|
||||
margin: 2px 0 2px 5px;
|
||||
background-color: rgba(0,119,179,0.6);
|
||||
}
|
||||
/*-----modules indv----*/
|
||||
#workspaces button {
|
||||
padding: 1px 5px;
|
||||
background-color: transparent;
|
||||
}
|
||||
#workspaces button:hover {
|
||||
box-shadow: inherit;
|
||||
background-color: rgba(0,153,153,1);
|
||||
}
|
||||
#workspaces button.empty {
|
||||
color: rgba(0 ,40, 40, 40);
|
||||
}
|
||||
#workspaces button.active {
|
||||
background-color: rgba(0,43,51,0.85);
|
||||
}
|
||||
#window {
|
||||
border-style: solid;
|
||||
background-color: rgba(0,43,51,0.5);
|
||||
margin: 2px 5px;
|
||||
padding: 2px 5px;
|
||||
border-width: 1px;
|
||||
border-color: #33ccff;
|
||||
}
|
||||
#window.empty {
|
||||
border-style: none;
|
||||
background-color: transparent;
|
||||
}
|
||||
#custom-launcher {
|
||||
background-color: rgba(0,119,179,0.6);
|
||||
border-radius: 100px;
|
||||
margin: 5px 5px;
|
||||
}
|
||||
|
||||
#clock,
|
||||
#battery,
|
||||
#cpu,
|
||||
#memory,
|
||||
#temperature,
|
||||
#network,
|
||||
#pulseaudio,
|
||||
#custom-media,
|
||||
#tray,
|
||||
#mode,
|
||||
#custom-power,
|
||||
#custom-menu,
|
||||
#idle_inhibitor {
|
||||
padding: 0 10px;
|
||||
}
|
||||
#mode {
|
||||
color: #cc3436;
|
||||
font-weight: bold;
|
||||
}
|
||||
#custom-power {
|
||||
background-color: rgba(0,119,179,0.6);
|
||||
border-radius: 100px;
|
||||
margin: 5px 5px;
|
||||
padding: 1px 1px 1px 6px;
|
||||
}
|
||||
/*-----Indicators----*/
|
||||
#idle_inhibitor.activated {
|
||||
color: #2dcc36;
|
||||
}
|
||||
#pulseaudio.muted {
|
||||
color: #cc3436;
|
||||
}
|
||||
#battery.charging {
|
||||
color: #2dcc36;
|
||||
}
|
||||
#battery.warning:not(.charging) {
|
||||
color: #e6e600;
|
||||
}
|
||||
#battery.critical:not(.charging) {
|
||||
color: #cc3436;
|
||||
}
|
||||
#temperature.critical {
|
||||
color: #cc3436;
|
||||
}
|
||||
/*-----Colors----*/
|
||||
/*
|
||||
*rgba(0,85,102,1),#005566 --> Indigo(dye)
|
||||
*rgba(0,43,51,1),#002B33 --> Dark Green
|
||||
*RGBA(0,153,153,1),#009999 --> PERSIAN GREEN
|
||||
*
|
||||
*/
|
||||
'';
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -1,80 +0,0 @@
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
...
|
||||
}: let
|
||||
cfg = config.hive.wlogout;
|
||||
in {
|
||||
options.hive.wlogout = {
|
||||
enable = lib.mkEnableOption "Enable Wlogout";
|
||||
};
|
||||
config = lib.mkIf cfg.enable {
|
||||
programs.wlogout.enable = true;
|
||||
programs.wlogout.layout = [
|
||||
{
|
||||
label = "shutdown";
|
||||
action = "systemctl poweroff";
|
||||
text = "Shutdown";
|
||||
keybind = "s";
|
||||
}
|
||||
{
|
||||
label = "reboot";
|
||||
action = "systemctl reboot";
|
||||
text = "Reboot";
|
||||
keybind = "r";
|
||||
}
|
||||
{
|
||||
label = "logout";
|
||||
action = "loginctl kill-session $XDG_SESSION_ID";
|
||||
text = "Logout";
|
||||
keybind = "e";
|
||||
}
|
||||
{
|
||||
label = "hibernate";
|
||||
action = "hyprlock --immediate & (sleep 1; systemctl hibernate -i)";
|
||||
text = "Hibernate";
|
||||
keybind = "h";
|
||||
}
|
||||
{
|
||||
label = "lock";
|
||||
action = "hyprlock";
|
||||
text = "Lock";
|
||||
keybind = "l";
|
||||
}
|
||||
];
|
||||
programs.wlogout.style = builtins.readFile ./style.css;
|
||||
xdg.enable = true;
|
||||
xdg.configFile = {
|
||||
"wlogout/icons/hibernate.png" = {
|
||||
source = ./icons/hibernate.png;
|
||||
};
|
||||
"wlogout/icons/lock.png" = {
|
||||
source = ./icons/lock.png;
|
||||
};
|
||||
"wlogout/icons/logout.png" = {
|
||||
source = ./icons/logout.png;
|
||||
};
|
||||
"wlogout/icons/power.png" = {
|
||||
source = ./icons/power.png;
|
||||
};
|
||||
"wlogout/icons/restart.png" = {
|
||||
source = ./icons/restart.png;
|
||||
};
|
||||
"wlogout/icons/hibernate-hover.png" = {
|
||||
source = ./icons/hibernate-hover.png;
|
||||
};
|
||||
"wlogout/icons/lock-hover.png" = {
|
||||
source = ./icons/lock-hover.png;
|
||||
};
|
||||
"wlogout/icons/logout-hover.png" = {
|
||||
source = ./icons/logout-hover.png;
|
||||
};
|
||||
"wlogout/icons/power-hover.png" = {
|
||||
source = ./icons/power-hover.png;
|
||||
};
|
||||
"wlogout/icons/restart-hover.png" = {
|
||||
source = ./icons/restart-hover.png;
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
Before Width: | Height: | Size: 5.9 KiB |
|
Before Width: | Height: | Size: 5.9 KiB |
|
Before Width: | Height: | Size: 5.4 KiB |
|
Before Width: | Height: | Size: 5.4 KiB |
|
Before Width: | Height: | Size: 6.1 KiB |
|
Before Width: | Height: | Size: 6.1 KiB |
|
Before Width: | Height: | Size: 9.9 KiB |