From 44307a3f6f6a333a618c24c7a06a58b139ee74c5 Mon Sep 17 00:00:00 2001 From: Lucy Hochkamp Date: Fri, 4 Apr 2025 18:42:10 +0200 Subject: [PATCH] many changes this one forgot --- flake.lock | 292 ++++++- flake.nix | 14 +- hm-modules/git.nix | 1 + instances/ds9/configuration.nix | 21 + instances/ds9/default.nix | 5 + instances/ds9/hardware-configuration.nix | 51 ++ instances/theseus/configuration.nix | 20 +- instances/theseus/hardware-configuration.nix | 7 +- modules/cli/fish.nix | 9 + modules/desktop/common-programs.nix | 1 - modules/desktop/fcitx5.nix | 27 + modules/desktop/foot.nix | 39 + modules/desktop/mate-polkit.nix | 32 + modules/desktop/niri.nix | 53 +- modules/desktop/swayidle.nix | 9 +- modules/desktop/waybar.nix | 812 ++++++++++--------- modules/desktop/wpaperd.nix | 1 + modules/module-list.nix | 4 + modules/presets/cli.nix | 36 +- modules/presets/gui.nix | 47 ++ modules/services/authentik.nix | 9 + modules/user-services/syncthing.nix | 28 + 22 files changed, 1081 insertions(+), 437 deletions(-) create mode 100644 instances/ds9/configuration.nix create mode 100644 instances/ds9/default.nix create mode 100644 instances/ds9/hardware-configuration.nix create mode 100644 modules/desktop/fcitx5.nix create mode 100644 modules/desktop/foot.nix create mode 100644 modules/desktop/mate-polkit.nix create mode 100644 modules/services/authentik.nix create mode 100644 modules/user-services/syncthing.nix diff --git a/flake.lock b/flake.lock index 798667cf..18549945 100644 --- a/flake.lock +++ b/flake.lock @@ -1,9 +1,79 @@ { "nodes": { + "crane": { + "locked": { + "lastModified": 1731098351, + "narHash": "sha256-HQkYvKvaLQqNa10KEFGgWHfMAbWBfFp+4cAgkut+NNE=", + "owner": "ipetkov", + "repo": "crane", + "rev": "ef80ead953c1b28316cc3f8613904edc2eb90c28", + "type": "github" + }, + "original": { + "owner": "ipetkov", + "repo": "crane", + "type": "github" + } + }, + "flake-compat": { + "flake": false, + "locked": { + "lastModified": 1696426674, + "narHash": "sha256-kvjfFW7WAETZlt09AgDn1MrtKzP7t90Vf7vypd3OL1U=", + "owner": "edolstra", + "repo": "flake-compat", + "rev": "0f9255e01c2351cc7d116c072cb317785dd33b33", + "type": "github" + }, + "original": { + "owner": "edolstra", + "repo": "flake-compat", + "type": "github" + } + }, + "flake-parts": { + "inputs": { + "nixpkgs-lib": [ + "lanzaboote", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1730504689, + "narHash": "sha256-hgmguH29K2fvs9szpq2r3pz2/8cJd2LPS+b4tfNFCwE=", + "owner": "hercules-ci", + "repo": "flake-parts", + "rev": "506278e768c2a08bec68eb62932193e341f55c90", + "type": "github" + }, + "original": { + "owner": "hercules-ci", + "repo": "flake-parts", + "type": "github" + } + }, "flake-utils": { "inputs": { "systems": "systems" }, + "locked": { + "lastModified": 1731533236, + "narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "11707dc2f618dd54ca8739b309ec4fc024de578b", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "flake-utils_2": { + "inputs": { + "systems": "systems_2" + }, "locked": { "lastModified": 1726560853, "narHash": "sha256-X6rJYSESBVr3hBoH0WbKE5KvhPU5bloyZ2L4K60/fPQ=", @@ -33,6 +103,28 @@ "type": "github" } }, + "gitignore": { + "inputs": { + "nixpkgs": [ + "lanzaboote", + "pre-commit-hooks-nix", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1709087332, + "narHash": "sha256-HG2cCnktfHsKV0s4XW83gU3F57gaTljL9KNSuG6bnQs=", + "owner": "hercules-ci", + "repo": "gitignore.nix", + "rev": "637db329424fd7e46cf4185293b9cc8c88c95394", + "type": "github" + }, + "original": { + "owner": "hercules-ci", + "repo": "gitignore.nix", + "type": "github" + } + }, "home-manager": { "inputs": { "nixpkgs": [ @@ -54,6 +146,28 @@ "type": "github" } }, + "iamb": { + "inputs": { + "flake-utils": "flake-utils", + "nixpkgs": [ + "nixpkgs-master" + ], + "rust-overlay": "rust-overlay" + }, + "locked": { + "lastModified": 1740367006, + "narHash": "sha256-TgkKx7NCxEXR7I6AY5CJ4fNC6BEXizJs1nt6zuik9E0=", + "owner": "ulyssa", + "repo": "iamb", + "rev": "b023e38f772f167f9c3a9e7d6dc105b2bc784a8e", + "type": "github" + }, + "original": { + "owner": "ulyssa", + "repo": "iamb", + "type": "github" + } + }, "kmonad": { "inputs": { "nixpkgs": [ @@ -77,6 +191,32 @@ "url": "https://github.com/jokesper/kmonad" } }, + "lanzaboote": { + "inputs": { + "crane": "crane", + "flake-compat": "flake-compat", + "flake-parts": "flake-parts", + "nixpkgs": [ + "nixpkgs" + ], + "pre-commit-hooks-nix": "pre-commit-hooks-nix", + "rust-overlay": "rust-overlay_2" + }, + "locked": { + "lastModified": 1737639419, + "narHash": "sha256-AEEDktApTEZ5PZXNDkry2YV2k6t0dTgLPEmAZbnigXU=", + "owner": "nix-community", + "repo": "lanzaboote", + "rev": "a65905a09e2c43ff63be8c0e86a93712361f871e", + "type": "github" + }, + "original": { + "owner": "nix-community", + "ref": "v0.4.2", + "repo": "lanzaboote", + "type": "github" + } + }, "lix": { "flake": false, "locked": { @@ -93,7 +233,7 @@ }, "lix-module": { "inputs": { - "flake-utils": "flake-utils", + "flake-utils": "flake-utils_2", "flakey-profile": "flakey-profile", "lix": "lix", "nixpkgs": [ @@ -146,16 +286,16 @@ }, "nixpkgs": { "locked": { - "lastModified": 1742512142, - "narHash": "sha256-8XfURTDxOm6+33swQJu/hx6xw1Tznl8vJJN5HwVqckg=", - "owner": "nixos", + "lastModified": 1736320768, + "narHash": "sha256-nIYdTAiKIGnFNugbomgBJR+Xv5F1ZQU+HfaBqJKroC0=", + "owner": "NixOS", "repo": "nixpkgs", - "rev": "7105ae3957700a9646cc4b766f5815b23ed0c682", + "rev": "4bc9c909d9ac828a039f288cf872d16d38185db8", "type": "github" }, "original": { - "owner": "nixos", - "ref": "nixos-24.11", + "owner": "NixOS", + "ref": "nixpkgs-unstable", "repo": "nixpkgs", "type": "github" } @@ -176,18 +316,139 @@ "type": "github" } }, + "nixpkgs-stable": { + "locked": { + "lastModified": 1730741070, + "narHash": "sha256-edm8WG19kWozJ/GqyYx2VjW99EdhjKwbY3ZwdlPAAlo=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "d063c1dd113c91ab27959ba540c0d9753409edf3", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-24.05", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_2": { + "locked": { + "lastModified": 1742512142, + "narHash": "sha256-8XfURTDxOm6+33swQJu/hx6xw1Tznl8vJJN5HwVqckg=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "7105ae3957700a9646cc4b766f5815b23ed0c682", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "nixos-24.11", + "repo": "nixpkgs", + "type": "github" + } + }, + "pre-commit-hooks-nix": { + "inputs": { + "flake-compat": [ + "lanzaboote", + "flake-compat" + ], + "gitignore": "gitignore", + "nixpkgs": [ + "lanzaboote", + "nixpkgs" + ], + "nixpkgs-stable": "nixpkgs-stable" + }, + "locked": { + "lastModified": 1731363552, + "narHash": "sha256-vFta1uHnD29VUY4HJOO/D6p6rxyObnf+InnSMT4jlMU=", + "owner": "cachix", + "repo": "pre-commit-hooks.nix", + "rev": "cd1af27aa85026ac759d5d3fccf650abe7e1bbf0", + "type": "github" + }, + "original": { + "owner": "cachix", + "repo": "pre-commit-hooks.nix", + "type": "github" + } + }, + "quadlet": { + "inputs": { + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1743126528, + "narHash": "sha256-4fkwPgP7HatDWC2wntWnWekgkC7G6tNMtbUQKmNKFy4=", + "owner": "SEIAROTg", + "repo": "quadlet-nix", + "rev": "e58deae6ca4cc331139360fbec53a6245aeb8a5c", + "type": "github" + }, + "original": { + "owner": "SEIAROTg", + "repo": "quadlet-nix", + "type": "github" + } + }, "root": { "inputs": { "home-manager": "home-manager", + "iamb": "iamb", "kmonad": "kmonad", + "lanzaboote": "lanzaboote", "lix-module": "lix-module", "nix-flatpak": "nix-flatpak", "nixos-hardware": "nixos-hardware", - "nixpkgs": "nixpkgs", + "nixpkgs": "nixpkgs_2", "nixpkgs-master": "nixpkgs-master", + "quadlet": "quadlet", "zen-browser": "zen-browser" } }, + "rust-overlay": { + "inputs": { + "nixpkgs": "nixpkgs" + }, + "locked": { + "lastModified": 1743302122, + "narHash": "sha256-VWyaUfBY49kjN29N140INa9LEW0YIgAr+OEJRdbKfnQ=", + "owner": "oxalica", + "repo": "rust-overlay", + "rev": "15c2a7930e04efc87be3ebf1b5d06232e635e24b", + "type": "github" + }, + "original": { + "owner": "oxalica", + "repo": "rust-overlay", + "type": "github" + } + }, + "rust-overlay_2": { + "inputs": { + "nixpkgs": [ + "lanzaboote", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1731897198, + "narHash": "sha256-Ou7vLETSKwmE/HRQz4cImXXJBr/k9gp4J4z/PF8LzTE=", + "owner": "oxalica", + "repo": "rust-overlay", + "rev": "0be641045af6d8666c11c2c40e45ffc9667839b5", + "type": "github" + }, + "original": { + "owner": "oxalica", + "repo": "rust-overlay", + "type": "github" + } + }, "systems": { "locked": { "lastModified": 1681028828, @@ -203,6 +464,21 @@ "type": "github" } }, + "systems_2": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + }, "zen-browser": { "inputs": { "nixpkgs": [ diff --git a/flake.nix b/flake.nix index 4431490e..03ca3fec 100644 --- a/flake.nix +++ b/flake.nix @@ -8,17 +8,25 @@ home-manager.url = "github:nix-community/home-manager/release-24.11"; home-manager.inputs.nixpkgs.follows = "nixpkgs"; nixos-hardware.url = "github:NixOS/nixos-hardware/master"; - # helix.url = "github:helix-editor/helix"; - # helix.inputs.nixpkgs.follows = "nixpkgs"; + quadlet.url = "github:SEIAROTg/quadlet-nix"; + quadlet.inputs.nixpkgs.follows = "nixpkgs"; # software + lanzaboote = { + url = "github:nix-community/lanzaboote/v0.4.2"; + + # Optional but recommended to limit the size of your system closure. + inputs.nixpkgs.follows = "nixpkgs"; + }; lix-module = { url = "https://git.lix.systems/lix-project/nixos-module/archive/2.91.1-2.tar.gz"; inputs.nixpkgs.follows = "nixpkgs"; }; zen-browser.url = "github:0xc000022070/zen-browser-flake"; zen-browser.inputs.nixpkgs.follows = "nixpkgs-master"; + iamb.url = "github:ulyssa/iamb"; + iamb.inputs.nixpkgs.follows = "nixpkgs-master"; kmonad = { url = "git+https://github.com/jokesper/kmonad?dir=nix&ref=feat-tap-overlap"; inputs.nixpkgs.follows = "nixpkgs"; @@ -62,6 +70,8 @@ inputs.lix-module.nixosModules.default inputs.kmonad.nixosModules.default inputs.home-manager.nixosModules.default + inputs.lanzaboote.nixosModules.lanzaboote + inputs.quadlet.nixosModules.quadlet ] ++ (import ./modules/module-list.nix)); devShell."x86_64-linux" = diff --git a/hm-modules/git.nix b/hm-modules/git.nix index 4cae6702..bf999b94 100644 --- a/hm-modules/git.nix +++ b/hm-modules/git.nix @@ -11,6 +11,7 @@ in config = lib.mkIf cfg.enable { programs.git = { enable = true; + difftastic.enable = true; lfs.enable = true; # Default configs diff --git a/instances/ds9/configuration.nix b/instances/ds9/configuration.nix new file mode 100644 index 00000000..f1b24e5f --- /dev/null +++ b/instances/ds9/configuration.nix @@ -0,0 +1,21 @@ +{ + config, + pkgs, + lib, + ... +}: +{ + imports = [ ./hardware-configuration.nix ]; + time.timeZone = "Europe/Berlin"; + + services.tailscale.enable = true; + services.tailscale.useRoutingFeatures = "client"; + xyno.presets.cli.enable = true; + xyno.presets.home-manager.enable = true; + xyno.system.user.enable = true; + xyno.networking.networkd = { + enable = true; + }; + + system.stateVersion = "24.11"; +} diff --git a/instances/ds9/default.nix b/instances/ds9/default.nix new file mode 100644 index 00000000..198ddfdf --- /dev/null +++ b/instances/ds9/default.nix @@ -0,0 +1,5 @@ +{ + modules = [ ./configuration.nix ]; + system = "x86_64-linux"; + hostName = "ds9"; +} diff --git a/instances/ds9/hardware-configuration.nix b/instances/ds9/hardware-configuration.nix new file mode 100644 index 00000000..381f25ef --- /dev/null +++ b/instances/ds9/hardware-configuration.nix @@ -0,0 +1,51 @@ +# 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 = [ "r8169" "ahci" "vfio-pci" "xhci_pci" "ehci_pci" "nvme" "usbhid" "sd_mod" "sr_mod" ]; + boot.kernelModules = [ "kvm-amd" ]; + nix.settings.max-jobs = lib.mkDefault 12; + powerManagement.powertop.enable = true; + powerManagement.cpuFreqGovernor = "powersave"; + powerManagement.scsiLinkPolicy = "min_power"; + + services.zfs.autoScrub.enable = true; + + services.sanoid.datasets."rpool/content/safe/data/media" = { }; + services.sanoid.enable = true; + services.sanoid.interval = "0/8:00:00"; + + swapDevices = [{ device = "/dev/disk/by-id/nvme-eui.000000000000000100a075202c247839-part1"; randomEncryption = true; }]; + fileSystems."/boot".device = "/dev/disk/by-uuid/149F-23AA"; + + + fileSystems."/" = { + device = "spool/safe/persist"; + fsType = "zfs"; + }; + fileSystems."/nix" = { + device = "spool/local/nix"; + fsType = "zfs"; + }; + fileSystems."/var/log" = { + device = "spool/local/journal"; + fsType = "zfs"; + }; + fileSystems."/data" = { + device = "rpool/content/safe/data"; + fsType = "zfs"; + }; + fileSystems."/data/media" = { + device = "rpool/content/safe/data/media"; + fsType = "zfs"; + }; + fileSystems."/backups" = { + device = "rpool/content/local/backups"; + fsType = "zfs"; + }; + +} diff --git a/instances/theseus/configuration.nix b/instances/theseus/configuration.nix index 222ae73a..3e52dca0 100644 --- a/instances/theseus/configuration.nix +++ b/instances/theseus/configuration.nix @@ -1,6 +1,7 @@ { config, pkgs, + inputs, lib, ... }: @@ -11,7 +12,8 @@ { ... }: { xyno.git.enable = true; - home.packages = [ # work + home.packages = [ + # work pkgs.jetbrains.rider (pkgs.firefox-devedition.overrideAttrs (super: self: { meta.priority = 1; })) ]; @@ -20,7 +22,7 @@ enable = true; packages = [ "com.unicornsonlsd.finamp" - "io.github.softfever.OrcaSlicer" + # "io.github.softfever.OrcaSlicer" "io.anytype.anytype" "org.bionus.Grabber" "org.getmonero.Monero" @@ -34,6 +36,14 @@ }; } ); + environment.systemPackages = with pkgs; [ + aerc + jabref + inputs.iamb.packages.${pkgs.system}.default + (pkgs.writeShellScriptBin "sudo" "run0 $@") + ]; + + time.timeZone = "Europe/Berlin"; services.tailscale.enable = true; services.tailscale.useRoutingFeatures = "client"; @@ -43,10 +53,15 @@ xyno.presets.gui.enable = true; xyno.presets.home-manager.enable = true; xyno.system.user.enable = true; + xyno.user-services.syncthing = { + enable = true; + tray = true; + }; xyno.networking.networkd = { enable = true; enableWifi = true; }; + xyno.desktop.fcitx5.enable = true; hardware.bluetooth.enable = true; services.blueman.enable = true; services.power-profiles-daemon.enable = true; @@ -54,4 +69,5 @@ services.flatpak.enable = true; system.stateVersion = "24.11"; + programs.nh.enable = true; } diff --git a/instances/theseus/hardware-configuration.nix b/instances/theseus/hardware-configuration.nix index 1f1b35d1..cb7065b6 100644 --- a/instances/theseus/hardware-configuration.nix +++ b/instances/theseus/hardware-configuration.nix @@ -24,7 +24,12 @@ "usbhid" "sd_mod" ]; - boot.loader.systemd-boot.enable = true; + boot.loader.systemd-boot.enable = lib.mkForce false; + + boot.lanzaboote = { + enable = true; + pkiBundle = "/var/lib/sbctl"; + }; boot.initrd.luks.devices.cryptroot.device = "/dev/disk/by-uuid/4cd8dbb3-8eea-48ff-87b1-92945be291ac"; diff --git a/modules/cli/fish.nix b/modules/cli/fish.nix index eb7e2ae3..d9c3105c 100644 --- a/modules/cli/fish.nix +++ b/modules/cli/fish.nix @@ -23,10 +23,19 @@ in environment.systemPackages = with pkgs; [ fishPlugins.grc grc + fzf # needed for reverse history search ]; programs.direnv.enableFishIntegration = true; programs.fish.interactiveShellInit = '' set -g fish_key_bindings fish_vi_key_bindings + function y + set tmp (mktemp -t "yazi-cwd.XXXXXX") + yazi $argv --cwd-file="$tmp" + if set cwd (command cat -- "$tmp"); and [ -n "$cwd" ]; and [ "$cwd" != "$PWD" ] + builtin cd -- "$cwd" + end + rm -f -- "$tmp" + end ''; programs.fish.enable = true; }; diff --git a/modules/desktop/common-programs.nix b/modules/desktop/common-programs.nix index aa8cc903..4d9b6a4d 100644 --- a/modules/desktop/common-programs.nix +++ b/modules/desktop/common-programs.nix @@ -42,7 +42,6 @@ in libreoffice-qt6-fresh inkscape easyeffects - dune3d appimage-run unstable.keepassxc inputs.zen-browser.packages."${pkgs.system}".default diff --git a/modules/desktop/fcitx5.nix b/modules/desktop/fcitx5.nix new file mode 100644 index 00000000..b57073f8 --- /dev/null +++ b/modules/desktop/fcitx5.nix @@ -0,0 +1,27 @@ +{ + pkgs, + config, + lib, + ... +}: +let + cfg = config.xyno.desktop.fcitx5; +in +{ + options.xyno.desktop.fcitx5.enable = lib.mkEnableOption "enable fcitx5 input daemon thing"; + config = lib.mkIf cfg.enable { + i18n.inputMethod = { + type = "fcitx5"; + enable = true; + fcitx5.addons = with pkgs; [ + fcitx5-table-other + ]; + fcitx5.waylandFrontend = true; + fcitx5.quickPhrase = { + ":pleading:" = "πŸ₯Ί"; + ":pointing_right:" = "πŸ‘‰"; + ":pointing_left:" = "πŸ‘ˆ"; + }; + }; + }; +} diff --git a/modules/desktop/foot.nix b/modules/desktop/foot.nix new file mode 100644 index 00000000..17d371be --- /dev/null +++ b/modules/desktop/foot.nix @@ -0,0 +1,39 @@ +{ + pkgs, + config, + lib, + ... +}: +let + cfg = config.xyno.desktop.foot; +in +{ + options.xyno.desktop.foot.enable = lib.mkEnableOption "enable foot terminal emulator"; + options.xyno.desktop.foot.wantedBy = lib.mkOption { + type = lib.types.str; + default = "niri.service"; + }; + options.xyno.desktop.foot.package= lib.mkOption { + type = lib.types.package; + default = pkgs.foot; + }; + config = lib.mkIf cfg.enable { + # should be socket activated tm + # systemd.user.services.foot.wantedBy = lib.mkForce [ cfg.wantedBy ]; + # systemd.user.sockets.foot.wantedBy = lib.mkForce [ cfg.wantedBy ]; + systemd.packages = [ cfg.package ]; + programs.foot = { + enable = true; + package = cfg.package; + theme = "gruvbox-dark"; + settings = { + main = { + font = "JetBrainsMono Nerd Font:size=11"; + }; + scrollback = { + lines = 100000; + }; + }; + }; + }; +} diff --git a/modules/desktop/mate-polkit.nix b/modules/desktop/mate-polkit.nix new file mode 100644 index 00000000..f177f202 --- /dev/null +++ b/modules/desktop/mate-polkit.nix @@ -0,0 +1,32 @@ + +{ + pkgs, + config, + lib, + ... +}: +let + cfg = config.xyno.desktop.mate-polkit; +in +{ + options.xyno.desktop.mate-polkit.enable = lib.mkEnableOption "enable mate-polkit as the gui polkit thing"; + options.xyno.desktop.mate-polkit.wantedBy = lib.mkOption { + type = lib.types.str; + default = "niri.service"; + }; + options.xyno.desktop.mate-polkit.package = lib.mkOption { + type = lib.types.package; + default = pkgs.mate.mate-polkit; # we're using mate polkit as it seems to be the only maintained gtk polkit thing (and we're using all the other gtk shit anyways) + }; + config = lib.mkIf cfg.enable { + environment.systemPackages = [ cfg.package ]; + systemd.user.services.mate-polkit = { + unitConfig.PartOf = "graphical-session.target"; + unitConfig.After = "graphical-session.target"; + unitConfig.Requisite = "graphical-session.target"; + serviceConfig.Restart = "on-failure"; + wantedBy = [ cfg.wantedBy ]; + script = "${cfg.package}/libexec/polkit-mate-authentication-agent-1"; + }; + }; +} diff --git a/modules/desktop/niri.nix b/modules/desktop/niri.nix index bcae8e45..0bfc64e8 100644 --- a/modules/desktop/niri.nix +++ b/modules/desktop/niri.nix @@ -31,6 +31,7 @@ in shikane.enable = lib.mkDefault true; swayidle.enable = lib.mkDefault true; wpaperd.enable = lib.mkDefault true; + foot.enable = lib.mkDefault true; }; home-manager.users.${config.xyno.system.user.name} = lib.mkIf config.xyno.presets.home-manager.enable @@ -56,7 +57,8 @@ in # prompt=> icon-theme=hicolor icons-enabled=yes - fuzzy=yes + match-mode=fuzzy + launch-prefix=systemd-run --user --scope width=80 horizontal-pad=10 vertical-pad=10 @@ -74,6 +76,7 @@ in width=2 radius=3 ''; + environment.etc."niri/config.kdl".mode = "444"; # copy file so niri detects changes environment.etc."niri/config.kdl".text = '' // xwayland spawn-at-startup "${pkgs.xwayland-satellite}/bin/xwayland-satellite" @@ -83,7 +86,10 @@ in // keybinds binds { Mod+D { spawn "fuzzel"; } - Mod+T { spawn "alacritty"; } + Mod+Alt+L { spawn "lock"; } + Mod+T { spawn "footclient"; } + Mod+Y { spawn "footclient yazi"; } + Mod+P { spawn "keepassxc"; } XF86AudioRaiseVolume allow-when-locked=true { spawn "wpctl" "set-volume" "@DEFAULT_AUDIO_SINK@" "0.1+"; } XF86AudioLowerVolume allow-when-locked=true { spawn "wpctl" "set-volume" "@DEFAULT_AUDIO_SINK@" "0.1-"; } XF86AudioMute allow-when-locked=true { spawn "wpctl" "set-mute" "@DEFAULT_AUDIO_SINK@" "toggle"; } @@ -206,15 +212,15 @@ in Mod+7 { focus-workspace 7; } Mod+8 { focus-workspace 8; } Mod+9 { focus-workspace 9; } - Mod+Ctrl+1 { move-column-to-workspace 1; } - Mod+Ctrl+2 { move-column-to-workspace 2; } - Mod+Ctrl+3 { move-column-to-workspace 3; } - Mod+Ctrl+4 { move-column-to-workspace 4; } - Mod+Ctrl+5 { move-column-to-workspace 5; } - Mod+Ctrl+6 { move-column-to-workspace 6; } - Mod+Ctrl+7 { move-column-to-workspace 7; } - Mod+Ctrl+8 { move-column-to-workspace 8; } - Mod+Ctrl+9 { move-column-to-workspace 9; } + Mod+Shift+1 { move-column-to-workspace 1; } + Mod+Shift+2 { move-column-to-workspace 2; } + Mod+Shift+3 { move-column-to-workspace 3; } + Mod+Shift+4 { move-column-to-workspace 4; } + Mod+Shift+5 { move-column-to-workspace 5; } + Mod+Shift+6 { move-column-to-workspace 6; } + Mod+Shift+7 { move-column-to-workspace 7; } + Mod+Shift+8 { move-column-to-workspace 8; } + Mod+Shift+9 { move-column-to-workspace 9; } // Alternatively, there are commands to move just a single window: // Mod+Ctrl+1 { move-window-to-workspace 1; } @@ -304,19 +310,22 @@ in Super+Backslash { focus-workspace "scratchpad"; } } layout { - gaps 4 + gaps 12 shadow { on } tab-indicator { hide-when-single-tab position "top" + place-within-column + width 8 + gap 8 } } prefer-no-csd // scratchpad - workspace "scratchpad" - + // workspace "scratchpad" + screenshot-path "~/Pictures/screenshots/screenshot-%Y-%m-%d %H-%M-%S.png" // Indicate screencasted windows with red colors. @@ -346,7 +355,7 @@ in match app-id="KeePassXC" open-floating true - open-on-workspace "scratchpad" + // open-on-workspace "scratchpad" block-out-from "screencast" } // Block out mako notifications from screencasts. @@ -360,16 +369,26 @@ in // This app-id regular expression will work for both: // - host Firefox (app-id is "firefox") // - Flatpak Firefox (app-id is "org.mozilla.firefox") - match app-id=r#"firefox$"# title="^Picture-in-Picture$" + match title="Picture-in-Picture" open-floating true } + // Place steam notifications in the bottom right + window-rule { + match app-id="steam" title="^notificationtoasts_[\\d]+_desktop$" + default-floating-position x=o y=o relative-to="bottom-right" + } input { workspace-auto-back-and-forth focus-follows-mouse + keyboard { + xkb { + layout "eu" + } + } touchpad { tap - natural-scroll + // natural-scroll } } // autogenerated from here on diff --git a/modules/desktop/swayidle.nix b/modules/desktop/swayidle.nix index 41ae6f64..0883dbdf 100644 --- a/modules/desktop/swayidle.nix +++ b/modules/desktop/swayidle.nix @@ -23,11 +23,16 @@ in }; options.xyno.desktop.swayidle.swaylockArgs = lib.mkOption { type = lib.types.str; - default = "-f --fade-in 2 --clock --timestr %T%z --datestr %F -i /home/${config.xyno.system.user.name}/Pictures/background.jpg"; + default = "-f -F --clock --timestr %T --datestr %F --indicator -i /home/${config.xyno.system.user.name}/Pictures/background.jpg"; }; config = lib.mkIf cfg.enable { - environment.systemPackages = with cfg; [ package swaylockPackage ]; + environment.systemPackages = with cfg; [ package swaylockPackage ( + pkgs.writeScriptBin "lock" '' + #!/${pkgs.bash}/bin/bash + ${cfg.swaylockPackage}/bin/swaylock ${cfg.swaylockArgs} "$@" + '' + ) ]; systemd.user.services.swayidle = { unitConfig.PartOf = "graphical-session.target"; unitConfig.After = "graphical-session.target"; diff --git a/modules/desktop/waybar.nix b/modules/desktop/waybar.nix index c3d6883c..75368195 100644 --- a/modules/desktop/waybar.nix +++ b/modules/desktop/waybar.nix @@ -6,6 +6,415 @@ }: let cfg = config.xyno.desktop.waybar; + json = pkgs.formats.json { }; + waybarCfg = { + layer = "top"; + position = "top"; + height = 15; + modules-left = + (lib.optionals (cfg.mode == "river") [ + "river/tags" + "river/layout" + "river/window" + ]) + ++ (lib.optionals (cfg.mode == "niri") [ + "niri/workspaces" + "niri/window" + ]); + modules-right = [ + "tray" + "idle_inhibitor" + "wireplumber" + "battery" + "power-profiles-daemon" + "backlight" + "cpu" + "temperature" + "memory" + "disk" + "network" + "clock" + ]; + "power-profiles-daemon" = { + format = "{icon} "; + tooltip-format = "Power profile: {profile}\nDriver: {driver}"; + tooltip = true; + format-icons = { + "default" = ""; + "performance" = ""; + "balanced" = "ο‰Ž"; + "power-saver" = ""; + }; + }; + "river/window" = { + max-length = 40; + }; + "niri/window" = { + max-length = 40; + }; + wireplumber = { + "format" = "{icon} {volume}%"; + "format-muted" = " MUTE"; + # "on-click" = "${pkgs.pwvucontrol}/bin/pwvucontrol"; + "on-click" = "${pkgs.pavucontrol}/bin/pavucontrol"; + "on-click-right" = "${pkgs.wireplumber}/bin/wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle"; + "format-icons" = [ + "" + "ο€§" + "" + ]; + }; + "backlight" = { + "device" = "amdgpu_bl1"; + "format" = "{icon} {percent}%"; + "format-icons" = [ + "σ°ƒš" + "󰃛" + "σ°ƒœ" + "󰃝" + "σ°ƒž" + "σ°ƒŸ" + "σ°ƒ " + ]; + "on-scroll-up" = "${pkgs.brightnessctl}/bin/brightnessctl s +10"; + "on-scroll-down" = "${pkgs.brightnessctl}/bin/brightnessctl s 10-"; + }; + "idle_inhibitor" = { + format = "{icon} "; + format-icons = { + "activated" = "σ°…Ά"; + "deactivated" = "σ°Ύͺ"; + }; + }; + battery = { + "states" = { + "warning" = 30; + "critical" = 15; + }; + "format" = "{icon} {capacity}%"; + "format-icons" = [ + "" + "" + "" + "" + "" + ]; + "tooltip-format" = "Capacity: {capacity}%\nPower Draw: {power:0.2f}W\n{timeTo}\nCycles: {cycles}"; + "max-length" = 25; + }; + "cpu" = { + "interval" = 10; + "format" = "ο‹› {:0.0f}%"; + "max-length" = 10; + }; + "temperature" = { + "format" = " {temperatureC}Β°C"; + }; + memory = { + interval = 30; + format = " {used:0.0f}/{total:0.0f}GB"; + }; + clock = { + interval = 1; + format = "{:%Y-%m-%dT%H:%M:%S%z}"; + "tooltip-format" = "{calendar}"; + "calendar" = { + "mode" = "year"; + "mode-mon-col" = 3; + "weeks-pos" = "right"; + "on-scroll" = 1; + "format" = { + "months" = "{}"; + "days" = "{}"; + "weeks" = "W{}"; + "weekdays" = "{}"; + "today" = "{}"; + }; + }; + "actions" = { + "on-click-right" = "mode"; + "on-scroll-up" = "shift_up"; + "on-scroll-down" = "shift_down"; + }; + }; + disk = { + format = "σ°‹Š {specific_used:0.0f}/{specific_total:0.0f}GB"; + unit = "GB"; + path = "/persistent"; + }; + "network" = { + "on-click" = + "${pkgs.alacritty}/bin/alacritty --class floating-alacritty -e ${pkgs.impala}/bin/impala"; + "format" = "{ifname}"; + "format-wifi" = "σ°–© {essid}"; + "format-ethernet" = "σ°ˆ€ {ifname}"; + "format-disconnected" = "σ°–ͺ"; + "tooltip-format" = "{ifname} via {gwaddr}\n{ipaddr}/{cidr}"; + "tooltip-format-wifi" = "{essid} ({signaldBm} dBm) {frequency} GHz\n{ipaddr}/{cidr}"; + "tooltip-format-ethernet" = "{ifname}\n{ipaddr}/{cidr}"; + "tooltip-format-disconnected" = "Disconnected"; + "max-length" = 50; + }; + }; + waybarCfgFile = json.generate "waybar-config.json" waybarCfg; + waybarStyleCss = '' + + * { + /* `otf-font-awesome` is required to be installed for icons */ + font-family: "Source Sans Pro Nerd Font"; + font-size: 12px; + } + + window#waybar { + /* background-color: rgba(43, 48, 59, 0.5); + border-bottom: 3px solid rgba(100, 114, 125, 0.5);*/ + color: #a89984; + background-color: #1d2021; + /* transition-property: background-color; + transition-duration: .5s;*/ + } + + window#waybar.hidden { + opacity: 0.2; + } + + /* + window#waybar.empty { + background-color: transparent; + } + window#waybar.solo { + background-color: #FFFFFF; + } + */ + + /*window#waybar.termite { + background-color: #3F3F3F; + } + + window#waybar.chromium { + background-color: #000000; + border: none; + }*/ + + #workspaces button { + padding: 0 2px; + background-color: #1d2021; + color: #ebdbb2; + /* Use box-shadow instead of border so the text isn't offset */ + box-shadow: inset 0 -3px transparent; + /* Avoid rounded borders under each workspace name */ + border: none; + border-radius: 0; + } + + /* https://github.com/Alexays/Waybar/wiki/FAQ#the-workspace-buttons-have-a-strange-hover-effect */ + #workspaces button:hover { + background: rgba(0, 0, 0, 0.2); + /* box-shadow: inset 0 -3px #fbf1c7; + */ + background-color: #3c3836; + } + + #workspaces button.focused { + /* box-shadow: inset 0 -3px #fbf1c7; + */ + background-color: #3c3836; + color: #ebdbb2; + } + + #workspaces button.occupied { + color: #d3869b; + } + #workspaces button.urgent { + background-color: #cc241d; + color: #ebdbb2; + } + + #mode { + background-color: #64727D; + border-bottom: 3px solid #fbf1c7; + } + + #clock, + #battery, + #cpu, + #memory, + #disk, + #temperature, + #backlight, + #network, + #pulseaudio, + #custom-media, + #tray, + #mode, + #idle_inhibitor, + #custom-poweroff, + #custom-suspend, + #mpd { + padding: 0 2px; + background-color: #1d2021; + color: #ebdbb2; + } + + #window, + #workspaces, + #tags { + margin: 0 2px; + } + + /* If workspaces is the leftmost module, omit left margin */ + .modules-left > widget:first-child > #workspaces { + margin-left: 0; + } + + /* If workspaces is the rightmost module, omit right margin */ + .modules-right > widget:last-child > #workspaces { + margin-right: 0; + } + + + #battery { + color: #d3869b; + } + + #battery.charging, #battery.plugged { + color: #98971a; + } + + @keyframes blink { + to { + background-color: #fbf1c7; + color: #df3f71; + } + } + + #battery.critical:not(.charging) { + background-color: #1d2021; + color: #d3869b; + animation-name: blink; + animation-duration: 0.5s; + animation-timing-function: linear; + animation-iteration-count: infinite; + animation-direction: alternate; + } + + label:focus { + background-color: #000000; + } + + #backlight { + color: #458588; + } + + #temperature { + color: #fabd2f; + } + + #temperature.critical { + background-color: #fbf1c7; + color: #b57614; + } + + #memory { + color: #FCF434; /* enby yellow */ + } + #disk { + color: #FFFFFF; /* enby white */ + } + #network { + color: #b8bb26; /* enby green */ + } + #clock { + color: #9C59D1; /* enby purple */ + /*color: #2C2C2C; enby black */ + } + + + #network.disconnected { + background-color: #fbf1c7; + color: #9d0006; + } + + + #wireplumber { + color: #fe8019; + } + + #tray { + } + + #tray > .needs-attention { + background-color: #fbf1c7; + color: #3c3836; + } + + #idle_inhibitor { + background-color: #1d2021; + color: #ebdbb2; + } + + #idle_inhibitor.activated { + background-color: #fbf1c7; + color: #3c3836; + } + + #custom-media { + background-color: #66cc99; + color: #2a5c45; + min-width: 100px; + } + + #custom-media.custom-spotify { + background-color: #66cc99; + } + + #custom-media.custom-vlc { + background-color: #ffa000; + } + + #mpd { + background-color: #66cc99; + color: #2a5c45; + } + + #mpd.disconnected { + background-color: #f53c3c; + } + + #mpd.stopped { + background-color: #90b1b1; + } + + #mpd.paused { + background-color: #51a37a; + } + + #language { + background: #00b093; + color: #740864; + padding: 0 5px; + margin: 0 5px; + min-width: 16px; + } + + #keyboard-state { + background: #97e1ad; + color: #000000; + padding: 0 0px; + margin: 0 5px; + min-width: 16px; + } + + #keyboard-state > label { + padding: 0 5px; + } + + #keyboard-state > label.locked { + background: rgba(0, 0, 0, 0.2); + } + ''; + waybarCssFile = pkgs.writeText "waybar.css" waybarStyleCss; + in { options.xyno.desktop.waybar.enable = lib.mkEnableOption "enable mako notification daemon"; @@ -27,403 +436,12 @@ in programs.light.enable = true; systemd.user.services.waybar.wantedBy = lib.mkForce [ cfg.wantedBy ]; - systemd.user.services.waybar.restartTriggers = [ "/etc/xdg/waybar/config" "/etc/xdg/waybar/style.css" ]; - environment.etc."xdg/waybar/config".source = - let - json = pkgs.formats.json { }; - in + systemd.user.services.waybar.restartTriggers = [ + waybarCfgFile + waybarCssFile + ]; + environment.etc."xdg/waybar/config".source = waybarCfgFile; + environment.etc."xdg/waybar/style.css".source = waybarCssFile; - (json.generate "waybar-config.json" { - layer = "top"; - position = "top"; - height = 15; - modules-left = (lib.optionals (cfg.mode == "river") [ - "river/tags" - "river/layout" - "river/window" - ]) - ++ (lib.optionals (cfg.mode == "niri") [ - "niri/workspaces" - "niri/window" - ]); - modules-right = [ - "tray" - "power_profiles_daemon" - "idle_inhibitor" - "wireplumber" - "battery" - "backlight" - "cpu" - "temperature" - "memory" - "disk" - "network" - "clock" - ]; - "river/window" = { - max-length = 40; - }; - "niri/window" = { - max-length = 40; - }; - wireplumber = { - "format" = "{icon} {volume}%"; - "format-muted" = " MUTE"; - # "on-click" = "${pkgs.pwvucontrol}/bin/pwvucontrol"; - "on-click" = "${pkgs.pavucontrol}/bin/pavucontrol"; - "on-click-right" = "${pkgs.wireplumber}/bin/wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle"; - "format-icons" = [ - "" - "ο€§" - "" - ]; - }; - "backlight" = { - "device" = "amdgpu_bl1"; - "format" = "{icon} {percent}%"; - "format-icons" = [ - "σ°ƒš" - "󰃛" - "σ°ƒœ" - "󰃝" - "σ°ƒž" - "σ°ƒŸ" - "σ°ƒ " - ]; - "on-scroll-up" = "${pkgs.brightnessctl}/bin/brightnessctl s +10"; - "on-scroll-down" = "${pkgs.brightnessctl}/bin/brightnessctl s 10-"; - }; - "idle_inhibitor" = { - format = "{icon} "; - format-icons = { - "activated" = "σ°…Ά"; - "deactivated" = "σ°Ύͺ"; - }; - }; - battery = { - "states" = { - "warning" = 30; - "critical" = 15; - }; - "format" = "{icon} {capacity}%"; - "format-icons" = [ - "" - "" - "" - "" - "" - ]; - "tooltip-format" = "Capacity: {capacity}%\nPower Draw: {power:0.2f}W\n{timeTo}\nCycles: {cycles}"; - "max-length" = 25; - }; - "cpu" = { - "interval" = 10; - "format" = "ο‹› {:0.0f}%"; - "max-length" = 10; - }; - "temperature" = { - "format" = " {temperatureC}Β°C"; - }; - memory = { - interval = 30; - format = " {used:0.0f}/{total:0.0f}GB"; - }; - clock = { - interval = 1; - format = "{:%Y-%m-%dT%H:%M:%S%z}"; - "tooltip-format" = "{calendar}"; - "calendar" = { - "mode" = "year"; - "mode-mon-col" = 3; - "weeks-pos" = "right"; - "on-scroll" = 1; - "format" = { - "months" = "{}"; - "days" = "{}"; - "weeks" = "W{}"; - "weekdays" = "{}"; - "today" = "{}"; - }; - }; - "actions" = { - "on-click-right" = "mode"; - "on-scroll-up" = "shift_up"; - "on-scroll-down" = "shift_down"; - }; - }; - disk = { - format = "σ°‹Š {specific_used:0.0f}/{specific_total:0.0f}GB"; - unit = "GB"; - path = "/persistent"; - }; - "network" = { - "on-click" = - "${pkgs.alacritty}/bin/alacritty --class floating-alacritty -e ${pkgs.impala}/bin/impala"; - "format" = "{ifname}"; - "format-wifi" = "σ°–© {essid}"; - "format-ethernet" = "σ°ˆ€ {ifname}"; - "format-disconnected" = "σ°–ͺ"; - "tooltip-format" = "{ifname} via {gwaddr}\n{ipaddr}/{cidr}"; - "tooltip-format-wifi" = "{essid} ({signaldBm} dBm) {frequency} GHz\n{ipaddr}/{cidr}"; - "tooltip-format-ethernet" = "{ifname}\n{ipaddr}/{cidr}"; - "tooltip-format-disconnected" = "Disconnected"; - "max-length" = 50; - }; - }); - environment.etc."xdg/waybar/style.css".text = '' - * { - /* `otf-font-awesome` is required to be installed for icons */ - font-family: "Source Sans Pro Nerd Font"; - font-size: 12px; - } - - window#waybar { - /* background-color: rgba(43, 48, 59, 0.5); - border-bottom: 3px solid rgba(100, 114, 125, 0.5);*/ - color: #a89984; - background-color: #1d2021; - /* transition-property: background-color; - transition-duration: .5s;*/ - } - - window#waybar.hidden { - opacity: 0.2; - } - - /* - window#waybar.empty { - background-color: transparent; - } - window#waybar.solo { - background-color: #FFFFFF; - } - */ - - /*window#waybar.termite { - background-color: #3F3F3F; - } - - window#waybar.chromium { - background-color: #000000; - border: none; - }*/ - - #workspaces button { - padding: 0 2px; - background-color: #1d2021; - color: #ebdbb2; - /* Use box-shadow instead of border so the text isn't offset */ - box-shadow: inset 0 -3px transparent; - /* Avoid rounded borders under each workspace name */ - border: none; - border-radius: 0; - } - - /* https://github.com/Alexays/Waybar/wiki/FAQ#the-workspace-buttons-have-a-strange-hover-effect */ - #workspaces button:hover { - background: rgba(0, 0, 0, 0.2); - /* box-shadow: inset 0 -3px #fbf1c7; - */ - background-color: #3c3836; - } - - #workspaces button.focused { - /* box-shadow: inset 0 -3px #fbf1c7; - */ - background-color: #3c3836; - color: #ebdbb2; - } - - #workspaces button.occupied { - color: #d3869b; - } - #workspaces button.urgent { - background-color: #cc241d; - color: #ebdbb2; - } - - #mode { - background-color: #64727D; - border-bottom: 3px solid #fbf1c7; - } - - #clock, - #battery, - #cpu, - #memory, - #disk, - #temperature, - #backlight, - #network, - #pulseaudio, - #custom-media, - #tray, - #mode, - #idle_inhibitor, - #custom-poweroff, - #custom-suspend, - #mpd { - padding: 0 2px; - background-color: #1d2021; - color: #ebdbb2; - } - - #window, - #workspaces, - #tags { - margin: 0 2px; - } - - /* If workspaces is the leftmost module, omit left margin */ - .modules-left > widget:first-child > #workspaces { - margin-left: 0; - } - - /* If workspaces is the rightmost module, omit right margin */ - .modules-right > widget:last-child > #workspaces { - margin-right: 0; - } - - - #battery { - color: #d3869b; - } - - #battery.charging, #battery.plugged { - color: #98971a; - } - - @keyframes blink { - to { - background-color: #fbf1c7; - color: #df3f71; - } - } - - #battery.critical:not(.charging) { - background-color: #1d2021; - color: #d3869b; - animation-name: blink; - animation-duration: 0.5s; - animation-timing-function: linear; - animation-iteration-count: infinite; - animation-direction: alternate; - } - - label:focus { - background-color: #000000; - } - - #backlight { - color: #458588; - } - - #temperature { - color: #fabd2f; - } - - #temperature.critical { - background-color: #fbf1c7; - color: #b57614; - } - - #memory { - color: #FCF434; /* enby yellow */ - } - #disk { - color: #FFFFFF; /* enby white */ - } - #network { - color: #b8bb26; /* enby green */ - } - #clock { - color: #9C59D1; /* enby purple */ - /*color: #2C2C2C; enby black */ - } - - - #network.disconnected { - background-color: #fbf1c7; - color: #9d0006; - } - - - #wireplumber { - color: #fe8019; - } - - #tray { - } - - #tray > .needs-attention { - background-color: #fbf1c7; - color: #3c3836; - } - - #idle_inhibitor { - background-color: #1d2021; - color: #ebdbb2; - } - - #idle_inhibitor.activated { - background-color: #fbf1c7; - color: #3c3836; - } - - #custom-media { - background-color: #66cc99; - color: #2a5c45; - min-width: 100px; - } - - #custom-media.custom-spotify { - background-color: #66cc99; - } - - #custom-media.custom-vlc { - background-color: #ffa000; - } - - #mpd { - background-color: #66cc99; - color: #2a5c45; - } - - #mpd.disconnected { - background-color: #f53c3c; - } - - #mpd.stopped { - background-color: #90b1b1; - } - - #mpd.paused { - background-color: #51a37a; - } - - #language { - background: #00b093; - color: #740864; - padding: 0 5px; - margin: 0 5px; - min-width: 16px; - } - - #keyboard-state { - background: #97e1ad; - color: #000000; - padding: 0 0px; - margin: 0 5px; - min-width: 16px; - } - - #keyboard-state > label { - padding: 0 5px; - } - - #keyboard-state > label.locked { - background: rgba(0, 0, 0, 0.2); - } - ''; }; } diff --git a/modules/desktop/wpaperd.nix b/modules/desktop/wpaperd.nix index 3d717e41..6a0ca49d 100644 --- a/modules/desktop/wpaperd.nix +++ b/modules/desktop/wpaperd.nix @@ -25,6 +25,7 @@ in default = pkgs.wpaperd; }; config = lib.mkIf cfg.enable { + environment.systemPackages = [ cfg.package ]; systemd.user.services.wpaperd = { unitConfig.PartOf = "graphical-session.target"; unitConfig.After = "graphical-session.target"; diff --git a/modules/module-list.nix b/modules/module-list.nix index ae3674cc..15881678 100644 --- a/modules/module-list.nix +++ b/modules/module-list.nix @@ -3,7 +3,10 @@ ./cli/starship.nix ./desktop/audio.nix ./desktop/common-programs.nix + ./desktop/fcitx5.nix + ./desktop/foot.nix ./desktop/mako.nix + ./desktop/mate-polkit.nix ./desktop/niri.nix ./desktop/shikane.nix ./desktop/swayidle.nix @@ -15,5 +18,6 @@ ./presets/gui.nix ./presets/home-manager.nix ./system/user.nix + ./user-services/syncthing.nix ] diff --git a/modules/presets/cli.nix b/modules/presets/cli.nix index 4670f2cc..066fde8b 100644 --- a/modules/presets/cli.nix +++ b/modules/presets/cli.nix @@ -16,28 +16,46 @@ in security.sudo.enable = false; nix.settings = { - trusted-users = lib.mkDefault [ "root" "@wheel" ]; - allowed-users = lib.mkDefault [ "root" "@wheel" ]; - auto-optimise-store = true; - + trusted-users = lib.mkDefault [ + "root" + "@wheel" + ]; + allowed-users = lib.mkDefault [ + "root" + "@wheel" + ]; + auto-optimise-store = true; }; nix.extraOptions = "experimental-features = nix-command flakes"; + programs.nh.enable = true; programs.direnv = { enable = true; nix-direnv.enable = true; enableFishIntegration = true; }; -# https://github.com/NixOS/nixpkgs/issues/361592 needed for run0 -security.pam.services.systemd-run0 = {}; - + # https://github.com/NixOS/nixpkgs/issues/361592 needed for run0 + security.pam.services.systemd-run0 = { }; + programs.tmux.enable = true; + + programs.yazi = { + enable = true; + }; + environment.systemPackages = with pkgs; [ jq + fd bottom htop + imagemagick + bat + ffmpeg + poppler + w3m curl aria2 + fzf file git neofetch @@ -45,6 +63,9 @@ security.pam.services.systemd-run0 = {}; pv yt-dlp helix + lm_sensors + dig + (pkgs.writeShellScriptBin "sudo" "run0 $@") ]; programs.mosh.enable = true; environment.variables.EDITOR = "hx"; @@ -52,6 +73,7 @@ security.pam.services.systemd-run0 = {}; environment.shellAliases = { l = "ls -al"; + n = "yazi"; gc = "git commit -v"; gpl = "git pull"; gd = "git diff"; diff --git a/modules/presets/gui.nix b/modules/presets/gui.nix index 68e4e828..ee763ef2 100644 --- a/modules/presets/gui.nix +++ b/modules/presets/gui.nix @@ -9,9 +9,14 @@ let in { options.xyno.presets.gui.enable = lib.mkEnableOption "enables xynos gui config"; + options.xyno.presets.gui.terminalEmulator = lib.mkOption { + type = lib.types.str; + default = "alacritty"; + }; config = lib.mkIf cfg.enable { xyno.desktop.niri.enable = true; xyno.desktop.audio.enable = lib.mkDefault true; + xyno.desktop.mate-polkit.enable = true; xyno.hardware.kmonad.enable = true; # wayland on electron environment.sessionVariables.NIXOS_OZONE_WL = "1"; @@ -23,6 +28,12 @@ in # ssh agent programs.ssh.startAgent = true; + qt = { + enable = true; + style = "breeze"; + platformTheme = "kde"; + }; + # setup printing services.avahi = { enable = true; @@ -40,6 +51,42 @@ in services.gnome.gnome-settings-daemon.enable = true; services.gvfs.enable = true; + home-manager.users.${config.xyno.system.user.name} = + { pkgs, ... }: + { + xdg.desktopEntries.nemo = { + name = "Nemo"; + exec = "${pkgs.nemo-with-extensions}/bin/nemo"; + }; + xdg.mimeApps = { + enable = true; + defaultApplications = { + "inode/directory" = [ "nemo.desktop" ]; + "application/x-gnome-saved-search" = [ "nemo.desktop" ]; + "x-scheme-handler/http" = "userapp-Zen-D2P132.desktop"; + "x-scheme-handler/https" = "userapp-Zen-D2P132.desktop"; + "x-scheme-handler/chrome" = "userapp-Zen-D2P132.desktop"; + "text/html" = "userapp-Zen-D2P132.desktop"; + "application/x-extension-htm" = "userapp-Zen-D2P132.desktop"; + "application/x-extension-html" = "userapp-Zen-D2P132.desktop"; + "application/x-extension-shtml" = "userapp-Zen-D2P132.desktop"; + "application/xhtml+xml" = "userapp-Zen-D2P132.desktop"; + "application/x-extension-xhtml" = "userapp-Zen-D2P132.desktop"; + "application/x-extension-xht" = "userapp-Zen-D2P132.desktop"; + "application/pdf" = "org.gnome.Evince.desktop"; + + }; + }; + }; + + environment.systemPackages = with pkgs; [ + nemo-with-extensions + kdePackages.breeze-gtk + kdePackages.breeze.qt5 + kdePackages.breeze + kdePackages.breeze-icons + ]; + # fonts fonts.packages = with pkgs; [ nerdfonts diff --git a/modules/services/authentik.nix b/modules/services/authentik.nix new file mode 100644 index 00000000..9fc6c085 --- /dev/null +++ b/modules/services/authentik.nix @@ -0,0 +1,9 @@ +{ pkgs, lib, config, ... }: +let cfg = config.xyno.services.authentik; in +{ + options.xyno.services.authentik.enable = lib.mkEnableOption "enables the authentik SSO thing"; + config = lib.mkIf cfg.enable { + + + }; +} diff --git a/modules/user-services/syncthing.nix b/modules/user-services/syncthing.nix new file mode 100644 index 00000000..b6d9b12d --- /dev/null +++ b/modules/user-services/syncthing.nix @@ -0,0 +1,28 @@ + +{ + pkgs, + config, + lib, + ... +}: +let + cfg = config.xyno.user-services.syncthing; +in +{ + options.xyno.user-services.syncthing.enable = lib.mkEnableOption "enable syncthing as user/with gui"; + options.xyno.user-services.syncthing.wantedBy = lib.mkOption { + type = lib.types.str; + default = "niri.service"; + }; + options.xyno.user-services.syncthing.tray = lib.mkEnableOption "add syncthingtray"; + config = lib.mkIf cfg.enable { + services.syncthing = { + systemService = false; + enable = true; + openDefaultPorts = true; + }; + environment.systemPackages = lib.optionals cfg.tray [ pkgs.syncthingtray ]; + systemd.packages = lib.optionals cfg.tray [ pkgs.syncthingtray ]; + systemd.user.services.syncthing.wantedBy = [ cfg.wantedBy ]; + }; +}