Add syncthing base

Signed-off-by: Nikolaos Karaolidis <nick@karaolidis.com>
This commit is contained in:
2024-07-08 15:56:42 +03:00
parent 47325206d0
commit 9dfbe1203d
103 changed files with 1285 additions and 951 deletions

12
flake.lock generated
View File

@@ -27,11 +27,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1720056646, "lastModified": 1720402389,
"narHash": "sha256-BymcV4HWtx2VFuabDCM4/nEJcfivCx0S02wUCz11mAY=", "narHash": "sha256-zJv6euDOrJWMHBhxfp/ay+Dvjwpe8YtMuEI5b09bxmo=",
"owner": "nix-community", "owner": "nix-community",
"repo": "disko", "repo": "disko",
"rev": "64679cd7f318c9b6595902b47d4585b1d51d5f9e", "rev": "f1a00e7f55dc266ef286cc6fc8458fa2b5ca2414",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -47,11 +47,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1720367448, "lastModified": 1720443333,
"narHash": "sha256-GttUD2lobMaLCYC3f39SBFSH2Ji7v1Yf+JOFYKYuQ7Y=", "narHash": "sha256-VS0HCv6M2Fr+XpCYpqkUNm74GboXlK2mPLWvSPsGMBg=",
"owner": "karaolidis", "owner": "karaolidis",
"repo": "home-manager", "repo": "home-manager",
"rev": "f837c613224c4709412e563d43f3ec3b50acedda", "rev": "178325dcb3e4afbf725d21cdc7f366f1c7f1a448",
"type": "github" "type": "github"
}, },
"original": { "original": {

View File

@@ -46,19 +46,27 @@
}; };
}; };
outputs = { self, nixpkgs, ... } @ inputs: { outputs =
{ self, nixpkgs, ... }@inputs:
{
nixosConfigurations = { nixosConfigurations = {
eirene-vm = nixpkgs.lib.nixosSystem { eirene-vm = nixpkgs.lib.nixosSystem {
specialArgs = { inherit inputs; }; specialArgs = {
inherit inputs;
};
system = "x86_64-linux"; system = "x86_64-linux";
modules = [ ./hosts/eirene/vm ]; modules = [ ./hosts/eirene/vm ];
}; };
eirene = nixpkgs.lib.nixosSystem { eirene = nixpkgs.lib.nixosSystem {
specialArgs = { inherit inputs; }; specialArgs = {
inherit inputs;
};
system = "x86_64-linux"; system = "x86_64-linux";
modules = [ ./hosts/eirene/base ]; modules = [ ./hosts/eirene/base ];
}; };
}; };
formatter.x86_64-linux = nixpkgs.legacyPackages.x86_64-linux.nixfmt-rfc-style;
}; };
} }

View File

@@ -7,7 +7,5 @@
}; };
}; };
environment.persistence."/persist".directories = [ environment.persistence."/persist".directories = [ "/var/lib/bluetooth" ];
"/var/lib/bluetooth"
];
} }

View File

@@ -1,5 +1,4 @@
{ pkgs, ... }: { pkgs, ... }:
{ {
boot = { boot = {
loader = { loader = {
@@ -14,6 +13,9 @@
initrd.systemd.enable = true; initrd.systemd.enable = true;
kernelPackages = pkgs.linuxPackages_latest; kernelPackages = pkgs.linuxPackages_latest;
supportedFilesystems = [ "btrfs" "ntfs" ]; supportedFilesystems = [
"btrfs"
"ntfs"
];
}; };
} }

View File

@@ -1,12 +1,16 @@
{ config, lib, pkgs, ... }: {
config,
lib,
pkgs,
...
}:
{ {
environment.systemPackages = with pkgs; [ brightnessctl ]; environment.systemPackages = with pkgs; [ brightnessctl ];
services.udev.extraRules = services.udev.extraRules =
let let
chgrp = "${pkgs.coreutils-full}/bin/chgrp"; chgrp = "${pkgs.coreutils}/bin/chgrp";
chmod = "${pkgs.coreutils-full}/bin/chmod"; chmod = "${pkgs.coreutils}/bin/chmod";
in in
'' ''
ACTION=="add", SUBSYSTEM=="backlight", RUN+="${chgrp} video /sys/class/backlight/%k/brightness" ACTION=="add", SUBSYSTEM=="backlight", RUN+="${chgrp} video /sys/class/backlight/%k/brightness"
@@ -17,8 +21,9 @@
users.groups = users.groups =
let let
members = builtins.attrNames members = builtins.attrNames (
(lib.attrsets.filterAttrs (_: config: config.isNormalUser) config.users.users); lib.attrsets.filterAttrs (_: config: config.isNormalUser) config.users.users
);
in in
{ {
video.members = members; video.members = members;

View File

@@ -1,5 +1,4 @@
{ pkgs, ... }: { pkgs, ... }:
{ {
environment.systemPackages = with pkgs; [ btop ]; environment.systemPackages = with pkgs; [ btop ];
} }

View File

@@ -1,5 +1,4 @@
{ pkgs, ... }: { pkgs, ... }:
{ {
environment.systemPackages = with pkgs; [ fastfetch ]; environment.systemPackages = with pkgs; [ fastfetch ];
} }

View File

@@ -1,5 +1,4 @@
{ config, lib, ... }: { config, lib, ... }:
{ {
services.getty.extraArgs = lib.mkIf (config.services.getty.autologinUser != null) [ services.getty.extraArgs = lib.mkIf (config.services.getty.autologinUser != null) [
"--skip-login" "--skip-login"

View File

@@ -1,3 +1 @@
{ { programs.gnupg.agent.enable = true; }
programs.gnupg.agent.enable = true;
}

View File

@@ -1,7 +1,5 @@
{ {
networking.networkmanager.enable = true; networking.networkmanager.enable = true;
environment.persistence."/persist".directories = [ environment.persistence."/persist".directories = [ "/etc/NetworkManager/system-connections" ];
"/etc/NetworkManager/system-connections"
];
} }

View File

@@ -1,10 +1,12 @@
{ inputs, ... }: { inputs, ... }:
{ {
nix = { nix = {
settings = { settings = {
use-xdg-base-directories = true; use-xdg-base-directories = true;
experimental-features = [ "nix-command" "flakes" ]; experimental-features = [
"nix-command"
"flakes"
];
}; };
registry.self.flake = inputs.self; registry.self.flake = inputs.self;

View File

@@ -1,5 +1,4 @@
{ inputs, pkgs, ... }: { inputs, pkgs, ... }:
{ {
imports = [ inputs.impermanence.nixosModules.impermanence ]; imports = [ inputs.impermanence.nixosModules.impermanence ];
@@ -39,8 +38,6 @@
"/var/lib/systemd/coredump" "/var/lib/systemd/coredump"
"/var/log" "/var/log"
]; ];
files = [ files = [ "/etc/machine-id" ];
"/etc/machine-id"
];
}; };
} }

View File

@@ -8,10 +8,12 @@
pulse.enable = true; pulse.enable = true;
jack.enable = true; jack.enable = true;
extraConfig.pipewire-pulse = { extraConfig.pipewire-pulse = {
pulse.cmd = [{ pulse.cmd = [
{
cmd = "load-module"; cmd = "load-module";
args = "module-switch-on-connect"; args = "module-switch-on-connect";
}]; }
];
}; };
}; };
} }

View File

@@ -1,5 +1,4 @@
{ pkgs, ... }: { pkgs, ... }:
{ {
boot = { boot = {
plymouth = plymouth =
@@ -9,9 +8,7 @@
{ {
enable = true; enable = true;
inherit theme; inherit theme;
themePackages = with pkgs; [ themePackages = with pkgs; [ (adi1090x-plymouth-themes.override { selected_themes = [ theme ]; }) ];
(adi1090x-plymouth-themes.override { selected_themes = [ theme ]; })
];
}; };
initrd.verbose = false; initrd.verbose = false;

View File

@@ -1,5 +1,4 @@
{ pkgs, ... }: { pkgs, ... }:
{ {
environment.systemPackages = with pkgs; [ ranger ]; environment.systemPackages = with pkgs; [ ranger ];
} }

View File

@@ -1,5 +1,4 @@
{ inputs, pkgs, ... }: { inputs, pkgs, ... }:
{ {
imports = [ inputs.sops-nix.nixosModules.sops ]; imports = [ inputs.sops-nix.nixosModules.sops ];

View File

@@ -1,5 +1,4 @@
{ inputs, ... }: { inputs, ... }:
{ {
system = { system = {
autoUpgrade = { autoUpgrade = {

View File

@@ -1,5 +1,4 @@
{ pkgs, ... }: { pkgs, ... }:
{ {
environment.systemPackages = with pkgs; [ tree ]; environment.systemPackages = with pkgs; [ tree ];
} }

View File

@@ -1,5 +1,4 @@
{ pkgs, ... }: { pkgs, ... }:
{ {
users = { users = {
mutableUsers = false; mutableUsers = false;

View File

@@ -1,11 +1,10 @@
{ pkgs, ... }: { pkgs, ... }:
{ {
environment.systemPackages = [ environment.systemPackages = [
(pkgs.writeShellApplication { (pkgs.writeShellApplication {
name = "nix-cleanup"; name = "nix-cleanup";
runtimeInputs = with pkgs; [ runtimeInputs = with pkgs; [
coreutils-full coreutils
util-linux util-linux
findutils findutils
btrfs-progs btrfs-progs

View File

@@ -1,9 +1,16 @@
{ config, inputs, lib, pkgs, ... }: {
config,
inputs,
lib,
pkgs,
...
}:
{ {
imports = [ imports = [
inputs.disko.nixosModules.disko inputs.disko.nixosModules.disko
(import ../format.nix { device = "/dev/disk/by-id/nvme-SAMSUNG_MZVL22T0HBLB-00BL2_S64RNE0R602762"; }) (import ../format.nix {
device = "/dev/disk/by-id/nvme-SAMSUNG_MZVL22T0HBLB-00BL2_S64RNE0R602762";
})
./hardware-configuration.nix ./hardware-configuration.nix
../. ../.
]; ];
@@ -58,18 +65,24 @@
}; };
boot = { boot = {
kernelParams = [ "amd_pstate=active" "video=eDP-1:2560x1600@165" ]; kernelParams = [
"amd_pstate=active"
"video=eDP-1:2560x1600@165"
];
initrd.kernelModules = [ "amdgpu" ]; initrd.kernelModules = [ "amdgpu" ];
}; };
home-manager.sharedModules = lib.mkIf config.programs.hyprland.enable [{ home-manager.sharedModules = lib.mkIf config.programs.hyprland.enable [
{
wayland.windowManager.hyprland.settings = { wayland.windowManager.hyprland.settings = {
monitor = "eDP-1, 2560x1600@165, 0x0, 1.25"; monitor = "eDP-1, 2560x1600@165, 0x0, 1.25";
env = [ "WLR_DRM_DEVICES,$HOME/.config/hypr/card" ]; env = [ "WLR_DRM_DEVICES,$HOME/.config/hypr/card" ];
device = [{ device = [
{
name = "syna2ba6:00-06cb:ce44-touchpad"; name = "syna2ba6:00-06cb:ce44-touchpad";
sensitivity = 0.5; sensitivity = 0.5;
}]; }
];
gestures.workspace_swipe_distance = 600; gestures.workspace_swipe_distance = 600;
}; };
@@ -82,7 +95,8 @@
theme = { theme = {
cursor.size = 24; cursor.size = 24;
}; };
}]; }
];
nixpkgs.config = { nixpkgs.config = {
cudaSupport = true; cudaSupport = true;

View File

@@ -1,10 +1,13 @@
{ lib, modulesPath, ... }: { lib, modulesPath, ... }:
{ {
imports = [ (modulesPath + "/installer/scan/not-detected.nix") ]; imports = [ (modulesPath + "/installer/scan/not-detected.nix") ];
boot = { boot = {
initrd.availableKernelModules = [ "nvme" "ahci" "usbhid" ]; initrd.availableKernelModules = [
"nvme"
"ahci"
"usbhid"
];
kernelModules = [ "kvm-amd" ]; kernelModules = [ "kvm-amd" ];
}; };

View File

@@ -4,5 +4,6 @@
(import ../../users/nick { autologin = true; }) (import ../../users/nick { autologin = true; })
]; ];
sops.defaultSopsFile = ./secrets/secrets.yaml;
time.timeZone = "Europe/Athens"; time.timeZone = "Europe/Athens";
} }

View File

@@ -1,5 +1,7 @@
{ device ? throw "device argument is required", ... }: {
device ? throw "device argument is required",
...
}:
{ {
disko.devices = { disko.devices = {
disk.main = { disk.main = {
@@ -49,15 +51,24 @@
}; };
"@persist" = { "@persist" = {
mountpoint = "/persist"; mountpoint = "/persist";
mountOptions = [ "compress=zstd" "noatime" ]; mountOptions = [
"compress=zstd"
"noatime"
];
}; };
"@nix" = { "@nix" = {
mountpoint = "/nix"; mountpoint = "/nix";
mountOptions = [ "compress=zstd" "noatime" ]; mountOptions = [
"compress=zstd"
"noatime"
];
}; };
"@cache" = { "@cache" = {
mountpoint = "/cache"; mountpoint = "/cache";
mountOptions = [ "compress=zstd" "noatime" ]; mountOptions = [
"compress=zstd"
"noatime"
];
}; };
}; };
}; };

View File

@@ -1,5 +1,9 @@
{ config, inputs, lib, ... }: {
config,
inputs,
lib,
...
}:
{ {
imports = [ imports = [
inputs.disko.nixosModules.disko inputs.disko.nixosModules.disko
@@ -17,5 +21,7 @@
fsType = "virtiofs"; fsType = "virtiofs";
}; };
home-manager.sharedModules = lib.mkIf config.programs.hyprland.enable [{ wayland.windowManager.hyprland.settings.monitor = "Virtual-1, 2560x1600@60, 0x0, 1"; }]; home-manager.sharedModules = lib.mkIf config.programs.hyprland.enable [
{ wayland.windowManager.hyprland.settings.monitor = "Virtual-1, 2560x1600@60, 0x0, 1"; }
];
} }

View File

@@ -1,10 +1,16 @@
{ lib, modulesPath, ... }: { lib, modulesPath, ... }:
{ {
imports = [ (modulesPath + "/profiles/qemu-guest.nix") ]; imports = [ (modulesPath + "/profiles/qemu-guest.nix") ];
boot = { boot = {
initrd.availableKernelModules = [ "ahci" "xhci_pci" "virtio_pci" "virtio_scsi" "sr_mod" "virtio_blk" ]; initrd.availableKernelModules = [
"ahci"
"xhci_pci"
"virtio_pci"
"virtio_scsi"
"sr_mod"
"virtio_blk"
];
kernelModules = [ "kvm-amd" ]; kernelModules = [ "kvm-amd" ];
}; };

View File

@@ -1,5 +1,9 @@
{ config, inputs, lib, ... }: {
config,
inputs,
lib,
...
}:
let let
users = lib.attrsets.filterAttrs (_: config: config.isNormalUser) config.users.users; users = lib.attrsets.filterAttrs (_: config: config.isNormalUser) config.users.users;
in in
@@ -10,19 +14,17 @@ in
[ [
"d /persist/home 0755 root root -" "d /persist/home 0755 root root -"
"d /cache/home 0755 root root -" "d /cache/home 0755 root root -"
] ++ ]
lib.attrsets.mapAttrsToList (user: config: "d /persist${config.home} 0700 ${user} users -") users ++ ++ lib.attrsets.mapAttrsToList (user: config: "d /persist${config.home} 0700 ${user} users -") users
lib.attrsets.mapAttrsToList (user: config: "d /cache${config.home} 0700 ${user} users -") users ++ lib.attrsets.mapAttrsToList (user: config: "d /cache${config.home} 0700 ${user} users -") users
); );
home-manager.users = lib.attrsets.mapAttrs home-manager.users = lib.attrsets.mapAttrs (user: config: {
(user: config: ({
imports = [ inputs.impermanence.nixosModules.home-manager.impermanence ]; imports = [ inputs.impermanence.nixosModules.home-manager.impermanence ];
home.persistence = { home.persistence = {
"/persist${config.home}".allowOther = true; "/persist${config.home}".allowOther = true;
"/cache${config.home}".allowOther = true; "/cache${config.home}".allowOther = true;
}; };
})) }) users;
users;
} }

View File

@@ -1,12 +1,15 @@
{ config, inputs, lib, ... }: {
config,
inputs,
lib,
...
}:
let let
users = lib.attrsets.filterAttrs (_: config: config.isNormalUser) config.users.users; users = lib.attrsets.filterAttrs (_: config: config.isNormalUser) config.users.users;
sopsKeyPath = ".config/sops-nix/key.txt"; sopsKeyPath = ".config/sops-nix/key.txt";
in in
{ {
home-manager.users = lib.attrsets.mapAttrs home-manager.users = lib.attrsets.mapAttrs (user: config: {
(user: config: ({
imports = [ inputs.sops-nix.homeManagerModules.sops ]; imports = [ inputs.sops-nix.homeManagerModules.sops ];
sops.age.keyFile = "/persist${config.home}/${sopsKeyPath}"; sops.age.keyFile = "/persist${config.home}/${sopsKeyPath}";
@@ -15,6 +18,5 @@ in
persistence."/persist${config.home}".files = [ sopsKeyPath ]; persistence."/persist${config.home}".files = [ sopsKeyPath ];
sessionVariables.SOPS_AGE_KEY_FILE = "${config.home}/${sopsKeyPath}"; sessionVariables.SOPS_AGE_KEY_FILE = "${config.home}/${sopsKeyPath}";
}; };
})) }) users;
users;
} }

View File

@@ -1,11 +1,9 @@
{ config, lib, ... }: { config, lib, ... }:
let let
users = lib.attrsets.filterAttrs (_: config: config.isNormalUser) config.users.users; users = lib.attrsets.filterAttrs (_: config: config.isNormalUser) config.users.users;
in in
{ {
home-manager.users = lib.attrsets.mapAttrs home-manager.users = lib.attrsets.mapAttrs (user: cfg: {
(user: cfg: ({
xdg = { xdg = {
enable = true; enable = true;
mimeApps.enable = true; mimeApps.enable = true;
@@ -30,6 +28,5 @@ in
"VMs" "VMs"
"git" "git"
]; ];
})) }) users;
users;
} }

View File

@@ -1,5 +1,4 @@
{ config, inputs, ... }: { config, inputs, ... }:
{ {
imports = [ imports = [
inputs.home-manager.nixosModules.default inputs.home-manager.nixosModules.default
@@ -10,10 +9,13 @@
]; ];
home-manager = { home-manager = {
extraSpecialArgs = { inherit inputs; }; extraSpecialArgs = {
inherit inputs;
};
backupFileExtension = "bak"; backupFileExtension = "bak";
useGlobalPkgs = true; useGlobalPkgs = true;
sharedModules = [{ sharedModules = [
{
imports = [ imports = [
./options/home-manager/xdg ./options/home-manager/xdg
./options/home-manager/hyprland ./options/home-manager/hyprland
@@ -25,7 +27,8 @@
systemd.user.startServices = "sd-switch"; systemd.user.startServices = "sd-switch";
nix.settings = config.nix.settings; nix.settings = config.nix.settings;
nixpkgs.config = config.nixpkgs.config; nixpkgs.config = config.nixpkgs.config;
}]; }
];
}; };
programs.dconf.enable = true; programs.dconf.enable = true;

View File

@@ -1,7 +1,10 @@
{ lib, ... }: { lib, ... }:
let let
userOptions = with lib; with types; { config, ... }: { userOptions =
with lib;
with types;
{ config, ... }:
{
options.email = mkOption { options.email = mkOption {
type = nullOr str; type = nullOr str;
description = "Email address of the user."; description = "Email address of the user.";
@@ -14,9 +17,10 @@ let
}; };
in in
{ {
options = with lib; with types; { options =
users.users = mkOption { with lib;
type = attrsOf (submodule userOptions); with types;
}; {
users.users = mkOption { type = attrsOf (submodule userOptions); };
}; };
} }

View File

@@ -1,10 +1,17 @@
{ config, pkgs, lib, ... }: {
config,
pkgs,
lib,
...
}:
let let
cfg = config.wayland.windowManager.hyprland; cfg = config.wayland.windowManager.hyprland;
in in
{ {
options.wayland.windowManager.hyprland = with lib; with types; { options.wayland.windowManager.hyprland =
with lib;
with types;
{
initExtraConfig = mkOption { initExtraConfig = mkOption {
type = lines; type = lines;
default = ""; default = "";
@@ -19,14 +26,18 @@ in
}; };
config = { config = {
wayland.windowManager.hyprland.settings.exec-once = lib.meta.getExe (pkgs.writeShellApplication { wayland.windowManager.hyprland.settings.exec-once = lib.meta.getExe (
pkgs.writeShellApplication {
name = "init-hyprland"; name = "init-hyprland";
text = cfg.initExtraConfig; text = cfg.initExtraConfig;
}); }
);
wayland.windowManager.hyprland.settings.exec = lib.meta.getExe (pkgs.writeShellApplication { wayland.windowManager.hyprland.settings.exec = lib.meta.getExe (
pkgs.writeShellApplication {
name = "reload-hyprland"; name = "reload-hyprland";
text = cfg.reloadExtraConfig; text = cfg.reloadExtraConfig;
}); }
);
}; };
} }

View File

@@ -1,11 +1,18 @@
{ config, pkgs, lib, ... }: {
config,
pkgs,
lib,
...
}:
let let
cfg = config.programs.matugen; cfg = config.programs.matugen;
in in
{ {
# https://github.com/Theaninova/matugen/blob/add-home-manager-module/hm-module.nix # https://github.com/Theaninova/matugen/blob/add-home-manager-module/hm-module.nix
options.programs.matugen = with lib; with types; { options.programs.matugen =
with lib;
with types;
{
enable = mkEnableOption "matugen"; enable = mkEnableOption "matugen";
package = mkPackageOption pkgs "matugen" { }; package = mkPackageOption pkgs "matugen" { };
settings = mkOption { settings = mkOption {

View File

@@ -1,11 +1,18 @@
{ config, lib, pkgs, ... }: {
config,
lib,
pkgs,
...
}:
let let
cfg = config.theme; cfg = config.theme;
init = pkgs.writeShellApplication { init = pkgs.writeShellApplication {
name = "theme"; name = "theme";
runtimeInputs = with pkgs; [ coreutils-full ]; runtimeInputs = with pkgs; [ coreutils ];
bashOptions = [ "nounset" "pipefail" ]; bashOptions = [
"nounset"
"pipefail"
];
runtimeEnv = { runtimeEnv = {
CONFIG = cfg.configDir; CONFIG = cfg.configDir;
DEFAULT_WALLPAPER = cfg.wallpaper; DEFAULT_WALLPAPER = cfg.wallpaper;
@@ -17,7 +24,10 @@ let
in in
{ {
# https://github.com/Theaninova/TheaninovOS/blob/master/modules/home-manager/theme/md3-evo.nix # https://github.com/Theaninova/TheaninovOS/blob/master/modules/home-manager/theme/md3-evo.nix
options.theme = with lib; with types; { options.theme =
with lib;
with types;
{
enable = mkEnableOption "theme"; enable = mkEnableOption "theme";
configDir = mkOption { configDir = mkOption {
@@ -60,7 +70,10 @@ in
}; };
mode = mkOption { mode = mkOption {
type = enum [ "dark" "light" ]; type = enum [
"dark"
"light"
];
default = "dark"; default = "dark";
description = "The default mode of the theme."; description = "The default mode of the theme.";
}; };
@@ -281,13 +294,19 @@ in
emoji = { emoji = {
names = mkOption { names = mkOption {
type = listOf str; type = listOf str;
default = [ "Noto Emoji" "Font Awesome" ]; default = [
"Noto Emoji"
"Font Awesome"
];
description = "The emoji font families."; description = "The emoji font families.";
}; };
packages = mkOption { packages = mkOption {
type = listOf package; type = listOf package;
default = with pkgs; [ noto-fonts-color-emoji font-awesome ]; default = with pkgs; [
noto-fonts-color-emoji
font-awesome
];
description = "The emoji font packages."; description = "The emoji font packages.";
}; };
}; };
@@ -340,13 +359,13 @@ in
config = lib.mkIf cfg.enable { config = lib.mkIf cfg.enable {
home = { home = {
packages = packages =
[ cfg.pkg ] ++ [ cfg.pkg ]
cfg.font.sansSerif.packages ++ ++ cfg.font.sansSerif.packages
cfg.font.serif.packages ++ ++ cfg.font.serif.packages
cfg.font.monospace.packages ++ ++ cfg.font.monospace.packages
cfg.font.emoji.packages ++ ++ cfg.font.emoji.packages
cfg.icon.packages ++ ++ cfg.icon.packages
cfg.cursor.packages; ++ cfg.cursor.packages;
pointerCursor = { pointerCursor = {
name = builtins.head cfg.cursor.names; name = builtins.head cfg.cursor.names;

View File

@@ -1,19 +1,19 @@
{ config, lib, ... }: { config, lib, ... }:
let let
cfg = config.xdg; cfg = config.xdg;
in in
{ {
options.xdg = with lib; with types; { options.xdg =
with lib;
with types;
{
relativeCacheHome = mkOption { relativeCacheHome = mkOption {
type = str; type = str;
default = ".cache"; default = ".cache";
description = "Relative path to directory holding application caches."; description = "Relative path to directory holding application caches.";
}; };
cacheHome = mkOption { cacheHome = mkOption { default = "${config.home.homeDirectory}/${cfg.relativeCacheHome}"; };
default = "${config.home.homeDirectory}/${cfg.relativeCacheHome}";
};
relativeConfigHome = mkOption { relativeConfigHome = mkOption {
type = str; type = str;
@@ -21,9 +21,7 @@ in
description = "Relative path to directory holding application configurations."; description = "Relative path to directory holding application configurations.";
}; };
configHome = mkOption { configHome = mkOption { default = "${config.home.homeDirectory}/${cfg.relativeConfigHome}"; };
default = "${config.home.homeDirectory}/${cfg.relativeConfigHome}";
};
relativeDataHome = mkOption { relativeDataHome = mkOption {
type = str; type = str;
@@ -31,9 +29,7 @@ in
description = "Relative path to directory holding application data."; description = "Relative path to directory holding application data.";
}; };
dataHome = mkOption { dataHome = mkOption { default = "${config.home.homeDirectory}/${cfg.relativeDataHome}"; };
default = "${config.home.homeDirectory}/${cfg.relativeDataHome}";
};
relativeStateHome = mkOption { relativeStateHome = mkOption {
type = str; type = str;
@@ -41,8 +37,6 @@ in
description = "Relative path to directory holding application states."; description = "Relative path to directory holding application states.";
}; };
stateHome = mkOption { stateHome = mkOption { default = "${config.home.homeDirectory}/${cfg.relativeStateHome}"; };
default = "${config.home.homeDirectory}/${cfg.relativeStateHome}";
};
}; };
} }

View File

@@ -1,19 +0,0 @@
{ user ? throw "user argument is required" }: { config, lib, pkgs, ... }:
{
home-manager.users.${user.name}.systemd.user.services.mpris-proxy = {
Unit = {
Description = "MPRIS proxy";
Requires = [ "sound.target" ];
After = [ "network.target" "sound.target" ];
};
Service.ExecStart = lib.meta.getExe (pkgs.writeShellApplication {
name = "init-mpris-proxy";
runtimeInputs = with pkgs; [ bluez ];
text = "exec mpris-proxy";
});
Install.WantedBy = [ "default.target" ];
};
}

View File

@@ -1,16 +0,0 @@
{ user ? throw "user argument is required" }: { lib, pkgs, ... }:
{
home-manager.users.${user.name} = {
home.packages = with pkgs; [ brightnessctl ];
wayland.windowManager.hyprland.settings.bindle =
let
brightnessctl = lib.meta.getExe pkgs.brightnessctl;
in
[
", XF86MonBrightnessUp, exec, ${brightnessctl} -q s 5%+"
", XF86MonBrightnessDown, exec, ${brightnessctl} -q s 5%-"
];
};
}

View File

@@ -1,36 +0,0 @@
{ user ? throw "user argument is required", gpu ? false }: { config, lib, pkgs, ... }:
let
hmConfig = config.home-manager.users.${user.name};
in
{
home-manager.users.${user.name} = {
programs = {
btop = {
enable = true;
settings = {
color_theme = "matugen";
theme_background = false;
presets = "";
vim_keys = true;
shown_boxes = "cpu mem net proc gpu0 gpu1";
update_ms = 1000;
proc_tree = true;
cpu_single_graph = true;
disks_filter = "/ /nix /persist /cache";
};
};
matugen.settings.templates.btop = {
input_path = ./theme.theme;
output_path = "${hmConfig.xdg.configHome}/btop/themes/matugen.theme";
};
};
theme.extraConfig = "${lib.meta.getExe (pkgs.writeShellApplication {
name = "reload-btop";
runtimeInputs = with pkgs; [ procps ];
text = "exec pkill btop -SIGUSR2";
})} &";
};
}

View File

@@ -0,0 +1,31 @@
{
user ? throw "user argument is required",
}:
{
config,
lib,
pkgs,
...
}:
{
home-manager.users.${user.name}.systemd.user.services.mpris-proxy = {
Unit = {
Description = "MPRIS proxy";
Requires = [ "sound.target" ];
After = [
"network.target"
"sound.target"
];
};
Service.ExecStart = lib.meta.getExe (
pkgs.writeShellApplication {
name = "init-mpris-proxy";
runtimeInputs = with pkgs; [ bluez ];
text = "exec mpris-proxy";
}
);
Install.WantedBy = [ "default.target" ];
};
}

View File

@@ -0,0 +1,7 @@
{
user ? throw "user argument is required",
}:
{ lib, pkgs, ... }:
{
home-manager.users.${user.name}.home.packages = with pkgs; [ brightnessctl ];
}

View File

@@ -0,0 +1,19 @@
{
user ? throw "user argument is required",
}:
{ ... }:
{
home-manager.users.${user.name}.programs.btop = {
enable = true;
settings = {
theme_background = false;
presets = "";
vim_keys = true;
shown_boxes = "cpu mem net proc gpu0 gpu1";
update_ms = 1000;
proc_tree = true;
cpu_single_graph = true;
disks_filter = "/ /nix /persist /cache";
};
};
}

View File

@@ -1,5 +1,12 @@
{ user ? throw "user argument is required" }: { config, lib, pkgs, ... }: {
user ? throw "user argument is required",
}:
{
config,
lib,
pkgs,
...
}:
let let
hmConfig = config.home-manager.users.${user.name}; hmConfig = config.home-manager.users.${user.name};
in in
@@ -22,11 +29,13 @@ in
}; };
hooks = { hooks = {
commit-msg = lib.meta.getExe (pkgs.writeShellApplication { commit-msg = lib.meta.getExe (
pkgs.writeShellApplication {
name = "git-commit-msg-hook"; name = "git-commit-msg-hook";
runtimeInputs = with pkgs; [ git ]; runtimeInputs = with pkgs; [ git ];
text = builtins.readFile ./commit-msg.sh; text = builtins.readFile ./commit-msg.sh;
}); }
);
}; };
}; };

View File

@@ -1,5 +1,12 @@
{ user ? throw "user argument is required" }: { config, lib, pkgs, ... }: {
user ? throw "user argument is required",
}:
{
config,
lib,
pkgs,
...
}:
let let
hmConfig = config.home-manager.users.${user.name}; hmConfig = config.home-manager.users.${user.name};
gpgPath = "${hmConfig.xdg.dataHome}/gnupg"; gpgPath = "${hmConfig.xdg.dataHome}/gnupg";
@@ -20,10 +27,11 @@ in
systemd.user = { systemd.user = {
services.gpg-agent-import = services.gpg-agent-import =
let let
init = lib.meta.getExe (pkgs.writeShellApplication { init = lib.meta.getExe (
pkgs.writeShellApplication {
name = "import-gpg-keys"; name = "import-gpg-keys";
runtimeInputs = with pkgs; [ runtimeInputs = with pkgs; [
coreutils-full coreutils
gnugrep gnugrep
gnupg gnupg
]; ];
@@ -32,13 +40,20 @@ in
HOME = user.home; HOME = user.home;
}; };
text = builtins.readFile ./import-gpg-keys.sh; text = builtins.readFile ./import-gpg-keys.sh;
}); }
);
in in
{ {
Unit = { Unit = {
Description = "Auto-import GPG keys"; Description = "Auto-import GPG keys";
Requires = [ "sops-nix.service" "gpg-agent.socket" ]; Requires = [
After = [ "sops-nix.service" "gpg-agent.socket" ]; "sops-nix.service"
"gpg-agent.socket"
];
After = [
"sops-nix.service"
"gpg-agent.socket"
];
}; };
Service = { Service = {

View File

@@ -1,5 +1,7 @@
{ user ? throw "user argument is required" }: { ... }: {
user ? throw "user argument is required",
}:
{ ... }:
{ {
home-manager.users.${user.name} = { home-manager.users.${user.name} = {
programs.neovim = { programs.neovim = {

View File

@@ -0,0 +1,13 @@
{
user ? throw "user argument is required",
}:
{ pkgs, ... }:
{
home-manager.users.${user.name} = {
home.packages = with pkgs; [
wireplumber
playerctl
];
services.playerctld.enable = true;
};
}

View File

@@ -0,0 +1,35 @@
{
user ? throw "user argument is required",
}:
{ config, ... }:
{
networking.firewall = {
allowedTCPPorts = [ 22000 ];
allowedUDPPorts = [
21027
22000
];
};
sops.secrets = {
# openssl ecparam -name prime256v1 -genkey -noout -out key.pem
"syncthing/key" = {
owner = user.name;
group = "users";
};
# openssl req -new -x509 -key key.pem -out cert.pem -days 3650
"syncthing/cert" = {
owner = user.name;
group = "users";
};
};
home-manager.users.${user.name}.services.syncthing = {
enable = true;
key = config.sops.secrets."syncthing/key".path;
cert = config.sops.secrets."syncthing/cert".path;
extraOptions = [ "-no-default-folder" ];
settings.options.urAccepted = -1;
};
}

View File

@@ -1,5 +1,7 @@
{ user ? throw "user argument is required" }: { config, ... }: {
user ? throw "user argument is required",
}:
{ config, ... }:
let let
hmConfig = config.home-manager.users.${user.name}; hmConfig = config.home-manager.users.${user.name};
in in

View File

@@ -1,5 +1,7 @@
{ pkgs ? import <nixpkgs> { }, ... }: {
pkgs ? import <nixpkgs> { },
...
}:
pkgs.stdenv.mkDerivation { pkgs.stdenv.mkDerivation {
name = "ags-config"; name = "ags-config";

View File

@@ -1,8 +1,16 @@
{ user ? throw "user argument is required" }: { config, lib, pkgs, inputs, ... }: {
user ? throw "user argument is required",
}:
{
config,
lib,
pkgs,
inputs,
...
}:
let let
hmConfig = config.home-manager.users.${user.name}; hmConfig = config.home-manager.users.${user.name};
agsConfig = (import ./config { inherit pkgs; }); agsConfig = import ./config { inherit pkgs; };
in in
{ {
home-manager.users.${user.name} = { home-manager.users.${user.name} = {
@@ -23,7 +31,10 @@ in
systemd.user = { systemd.user = {
targets.tray.Unit = { targets.tray.Unit = {
BindsTo = [ "ags.service" ]; BindsTo = [ "ags.service" ];
After = [ "graphical-session.target" "ags.service" ]; After = [
"graphical-session.target"
"ags.service"
];
}; };
services.ags = { services.ags = {
@@ -37,7 +48,8 @@ in
Type = "notify"; Type = "notify";
NotifyAccess = "all"; NotifyAccess = "all";
ExecStart = lib.meta.getExe (pkgs.writeShellApplication { ExecStart = lib.meta.getExe (
pkgs.writeShellApplication {
name = "init-ags"; name = "init-ags";
runtimeInputs = with pkgs; [ runtimeInputs = with pkgs; [
inputs.ags.packages.${stdenv.hostPlatform.system}.default inputs.ags.packages.${stdenv.hostPlatform.system}.default
@@ -50,7 +62,8 @@ in
libdbusmenu-gtk3 libdbusmenu-gtk3
]; ];
text = "exec ags"; text = "exec ags";
}); }
);
}; };
Install.WantedBy = [ "graphical-session.target" ]; Install.WantedBy = [ "graphical-session.target" ];

View File

@@ -1,5 +1,12 @@
{ user ? throw "user argument is required" }: { config, lib, pkgs, ... }: {
user ? throw "user argument is required",
}:
{
config,
lib,
pkgs,
...
}:
{ {
services.blueman.enable = true; services.blueman.enable = true;

View File

@@ -0,0 +1,14 @@
{
user ? throw "user argument is required",
}:
{ lib, pkgs, ... }:
{
home-manager.users.${user.name}.wayland.windowManager.hyprland.settings.bindle =
let
brightnessctl = lib.meta.getExe pkgs.brightnessctl;
in
[
", XF86MonBrightnessUp, exec, ${brightnessctl} -q s 5%+"
", XF86MonBrightnessDown, exec, ${brightnessctl} -q s 5%-"
];
}

View File

@@ -0,0 +1,34 @@
{
user ? throw "user argument is required",
}:
{
config,
lib,
pkgs,
...
}:
let
hmConfig = config.home-manager.users.${user.name};
in
{
home-manager.users.${user.name} = {
programs = {
btop.settings.color_theme = "matugen";
matugen.settings.templates.btop = {
input_path = ./theme.theme;
output_path = "${hmConfig.xdg.configHome}/btop/themes/matugen.theme";
};
};
theme.extraConfig = "${
lib.meta.getExe (
pkgs.writeShellApplication {
name = "reload-btop";
runtimeInputs = with pkgs; [ procps ];
text = "exec pkill btop -SIGUSR2";
}
)
} &";
};
}

View File

@@ -1,5 +1,12 @@
{ user ? throw "user argument is required" }: { config, lib, pkgs, ... }: {
user ? throw "user argument is required",
}:
{
config,
lib,
pkgs,
...
}:
{ {
home-manager.users.${user.name} = { home-manager.users.${user.name} = {
services.cbatticon = { services.cbatticon = {

View File

@@ -1,12 +1,22 @@
{ user ? throw "user argument is required" }: { config, lib, pkgs, ... }: {
user ? throw "user argument is required",
}:
{
config,
lib,
pkgs,
...
}:
let let
hmConfig = config.home-manager.users.${user.name}; hmConfig = config.home-manager.users.${user.name};
in in
{ {
home-manager.users.${user.name} = { home-manager.users.${user.name} = {
home = { home = {
packages = with pkgs; [ wl-clipboard cliphist ]; packages = with pkgs; [
wl-clipboard
cliphist
];
persistence."/cache${user.home}".directories = [ "${hmConfig.xdg.relativeCacheHome}/cliphist" ]; persistence."/cache${user.home}".directories = [ "${hmConfig.xdg.relativeCacheHome}/cliphist" ];
}; };

View File

@@ -1,5 +1,7 @@
{ user ? throw "user argument is required" }: { lib, pkgs, ... }: {
user ? throw "user argument is required",
}:
{ lib, pkgs, ... }:
{ {
home-manager.users.${user.name} = { home-manager.users.${user.name} = {
programs.firefox = { programs.firefox = {
@@ -47,38 +49,59 @@
"Wikipedia (en)".metaData.alias = "@w"; "Wikipedia (en)".metaData.alias = "@w";
"Nix Packages" = { "Nix Packages" = {
urls = [{ urls = [
{
template = "https://search.nixos.org/packages"; template = "https://search.nixos.org/packages";
params = [ params = [
{ name = "type"; value = "packages"; } {
{ name = "query"; value = "{searchTerms}"; } name = "type";
value = "packages";
}
{
name = "query";
value = "{searchTerms}";
}
];
}
]; ];
}];
icon = "${pkgs.nixos-icons}/share/icons/hicolor/scalable/apps/nix-snowflake.svg"; icon = "${pkgs.nixos-icons}/share/icons/hicolor/scalable/apps/nix-snowflake.svg";
definedAliases = [ "@np" ]; definedAliases = [ "@np" ];
}; };
"Nix Options" = { "Nix Options" = {
urls = [{ urls = [
{
template = "https://search.nixos.org/options"; template = "https://search.nixos.org/options";
params = [ params = [
{ name = "type"; value = "options"; } {
{ name = "query"; value = "{searchTerms}"; } name = "type";
value = "options";
}
{
name = "query";
value = "{searchTerms}";
}
];
}
]; ];
}];
icon = "${pkgs.nixos-icons}/share/icons/hicolor/scalable/apps/nix-snowflake.svg"; icon = "${pkgs.nixos-icons}/share/icons/hicolor/scalable/apps/nix-snowflake.svg";
definedAliases = [ "@no" ]; definedAliases = [ "@no" ];
}; };
"Home Manager Options" = { "Home Manager Options" = {
urls = [{ urls = [
{
template = "https://home-manager-options.extranix.com/"; template = "https://home-manager-options.extranix.com/";
params = [ params = [
{ name = "query"; value = "{searchTerms}"; } {
name = "query";
value = "{searchTerms}";
}
];
}
]; ];
}];
icon = "${pkgs.nixos-icons}/share/icons/hicolor/scalable/apps/nix-snowflake.svg"; icon = "${pkgs.nixos-icons}/share/icons/hicolor/scalable/apps/nix-snowflake.svg";
definedAliases = [ "@nh" ]; definedAliases = [ "@nh" ];
@@ -88,9 +111,7 @@
}; };
}; };
wayland.windowManager.hyprland.settings.bind = [ wayland.windowManager.hyprland.settings.bind = [ "$mod, b, exec, ${lib.meta.getExe pkgs.firefox}" ];
"$mod, b, exec, ${lib.meta.getExe pkgs.firefox}"
];
home.persistence = { home.persistence = {
"/persist${user.home}".directories = [ ".mozilla" ]; "/persist${user.home}".directories = [ ".mozilla" ];

View File

@@ -1,5 +1,12 @@
{ user ? throw "user argument is required" }: { config, lib, pkgs, ... }: {
user ? throw "user argument is required",
}:
{
config,
lib,
pkgs,
...
}:
let let
hmConfig = config.home-manager.users.${user.name}; hmConfig = config.home-manager.users.${user.name};
in in
@@ -42,7 +49,9 @@ in
}; };
}; };
theme.extraConfig = "${lib.meta.getExe (pkgs.writeShellApplication { theme.extraConfig = "${
lib.meta.getExe (
pkgs.writeShellApplication {
name = "theme-gtk"; name = "theme-gtk";
runtimeInputs = with pkgs; [ dconf ]; runtimeInputs = with pkgs; [ dconf ];
text = '' text = ''
@@ -57,6 +66,8 @@ in
dconf write /org/gnome/desktop/interface/gtk-theme "'$GTK_THEME'" dconf write /org/gnome/desktop/interface/gtk-theme "'$GTK_THEME'"
dconf write /org/gnome/desktop/interface/color-scheme "'prefer-$MODE'" dconf write /org/gnome/desktop/interface/color-scheme "'prefer-$MODE'"
''; '';
})} &"; }
)
} &";
}; };
} }

View File

@@ -1,5 +1,12 @@
{ user ? throw "user argument is required" }: { config, lib, pkgs, ... }: {
user ? throw "user argument is required",
}:
{
config,
lib,
pkgs,
...
}:
let let
hmConfig = config.home-manager.users.${user.name}; hmConfig = config.home-manager.users.${user.name};
in in
@@ -133,11 +140,15 @@ in
}; };
}; };
theme.extraConfig = "${lib.meta.getExe (pkgs.writeShellApplication { theme.extraConfig = "${
lib.meta.getExe (
pkgs.writeShellApplication {
name = "reload-hyprland"; name = "reload-hyprland";
runtimeInputs = with pkgs; [ hyprland ]; runtimeInputs = with pkgs; [ hyprland ];
text = "exec hyprctl reload"; text = "exec hyprctl reload";
})} &"; }
)
} &";
home.sessionVariables.NIXOS_OZONE_WL = "1"; home.sessionVariables.NIXOS_OZONE_WL = "1";
}; };

View File

@@ -1,26 +1,38 @@
{ user ? throw "user argument is required" }: { config, lib, pkgs, ... }: {
user ? throw "user argument is required",
}:
{
config,
lib,
pkgs,
...
}:
let let
hmConfig = config.home-manager.users.${user.name}; hmConfig = config.home-manager.users.${user.name};
in in
{ {
home-manager.users.${user.name} = { home-manager.users.${user.name} = {
home = { home = {
packages = with pkgs; [ hyprshot swappy ]; packages = with pkgs; [
hyprshot
swappy
];
sessionVariables.HYPRSHOT_DIR = "${hmConfig.xdg.userDirs.pictures}/screenshots"; sessionVariables.HYPRSHOT_DIR = "${hmConfig.xdg.userDirs.pictures}/screenshots";
}; };
wayland.windowManager.hyprland.settings.bind = wayland.windowManager.hyprland.settings.bind =
let let
hyprshot = lib.meta.getExe pkgs.hyprshot; hyprshot = lib.meta.getExe pkgs.hyprshot;
date = "${pkgs.coreutils-full}/bin/date"; date = "${pkgs.coreutils}/bin/date";
filename = "\"$(${date} +'%Y-%m-%d-%H%M%S.png')\""; filename = "\"$(${date} +'%Y-%m-%d-%H%M%S.png')\"";
swappyWrapper = lib.meta.getExe (pkgs.writeShellApplication { swappyWrapper = lib.meta.getExe (
pkgs.writeShellApplication {
name = "swappy-wrapper"; name = "swappy-wrapper";
runtimeInputs = with pkgs; [ swappy ]; runtimeInputs = with pkgs; [ swappy ];
text = "exec swappy -f \"$1\""; text = "exec swappy -f \"$1\"";
}); }
);
in in
[ [
", Print, exec, ${hyprshot} -m output -m active -f ${filename}" ", Print, exec, ${hyprshot} -m output -m active -f ${filename}"

View File

@@ -1,5 +1,12 @@
{ user ? throw "user argument is required" }: { config, lib, pkgs, ... }: {
user ? throw "user argument is required",
}:
{
config,
lib,
pkgs,
...
}:
let let
hmConfig = config.home-manager.users.${user.name}; hmConfig = config.home-manager.users.${user.name};
in in
@@ -27,11 +34,15 @@ in
}; };
}; };
theme.extraConfig = "${lib.meta.getExe (pkgs.writeShellApplication { theme.extraConfig = "${
lib.meta.getExe (
pkgs.writeShellApplication {
name = "reload-kitty"; name = "reload-kitty";
runtimeInputs = with pkgs; [ procps ]; runtimeInputs = with pkgs; [ procps ];
text = "exec pkill kitty -SIGUSR1"; text = "exec pkill kitty -SIGUSR1";
})} &"; }
)
} &";
home.persistence."/cache${user.home}".directories = [ "${hmConfig.xdg.relativeCacheHome}/kitty" ]; home.persistence."/cache${user.home}".directories = [ "${hmConfig.xdg.relativeCacheHome}/kitty" ];
}; };

View File

@@ -1,5 +1,12 @@
{ user ? throw "user argument is required" }: { config, lib, pkgs, ... }: {
user ? throw "user argument is required",
}:
{
config,
lib,
pkgs,
...
}:
let let
hmConfig = config.home-manager.users.${user.name}; hmConfig = config.home-manager.users.${user.name};
in in
@@ -54,8 +61,8 @@ in
blur = builtins.toString hmConfig.theme.blur; blur = builtins.toString hmConfig.theme.blur;
opacity = builtins.toString hmConfig.theme.opacity; opacity = builtins.toString hmConfig.theme.opacity;
opacity_hex = builtins.toString (percentageToHex hmConfig.theme.opacity); opacity_hex = builtins.toString (percentageToHex hmConfig.theme.opacity);
opacity_shadow = builtins.toString (hmConfig.theme.opacity * .75); opacity_shadow = builtins.toString (hmConfig.theme.opacity * 0.75);
opacity_shadow_hex = builtins.toString (percentageToHex (hmConfig.theme.opacity * .75)); opacity_shadow_hex = builtins.toString (percentageToHex (hmConfig.theme.opacity * 0.75));
font_size = builtins.toString hmConfig.theme.font.size; font_size = builtins.toString hmConfig.theme.font.size;
font_sans_serif = builtins.head hmConfig.theme.font.sansSerif.names; font_sans_serif = builtins.head hmConfig.theme.font.sansSerif.names;
font_sans_serif_all = builtins.concatStringsSep ", " hmConfig.theme.font.sansSerif.names; font_sans_serif_all = builtins.concatStringsSep ", " hmConfig.theme.font.sansSerif.names;
@@ -72,7 +79,9 @@ in
}; };
}; };
theme.extraConfig = lib.mkBefore (lib.meta.getExe (pkgs.writeShellApplication { theme.extraConfig = lib.mkBefore (
lib.meta.getExe (
pkgs.writeShellApplication {
name = "theme-matugen"; name = "theme-matugen";
runtimeInputs = with pkgs; [ matugen ]; runtimeInputs = with pkgs; [ matugen ];
text = '' text = ''
@@ -81,6 +90,8 @@ in
--mode "$(cat "${hmConfig.theme.configDir}/mode")" \ --mode "$(cat "${hmConfig.theme.configDir}/mode")" \
--contrast ${builtins.toString hmConfig.theme.contrast} --contrast ${builtins.toString hmConfig.theme.contrast}
''; '';
})); }
)
);
}; };
} }

View File

@@ -1,5 +1,7 @@
{ user ? throw "user argument is required" }: { ... }: {
user ? throw "user argument is required",
}:
{ ... }:
{ {
home-manager.users.${user.name} = { home-manager.users.${user.name} = {
services.network-manager-applet.enable = true; services.network-manager-applet.enable = true;

View File

@@ -1,10 +1,15 @@
{ user ? throw "user argument is required" }: { pkgs, ... }: {
user ? throw "user argument is required",
}:
{ lib, pkgs, ... }:
{ {
home-manager.users.${user.name} = { home-manager.users.${user.name} = {
home.packages = with pkgs; [ pavucontrol ];
wayland.windowManager.hyprland.settings = wayland.windowManager.hyprland.settings =
let let
wpctl = "${pkgs.wireplumber}/bin/wpctl"; wpctl = "${pkgs.wireplumber}/bin/wpctl";
playerctl = lib.meta.getExe pkgs.playerctl;
in in
{ {
bindle = [ bindle = [
@@ -12,11 +17,17 @@
", XF86AudioLowerVolume, exec, ${wpctl} set-volume @DEFAULT_AUDIO_SINK@ -l 2.0 2%-" ", XF86AudioLowerVolume, exec, ${wpctl} set-volume @DEFAULT_AUDIO_SINK@ -l 2.0 2%-"
"CTRL, XF86AudioRaiseVolume, exec, ${wpctl} set-volume @DEFAULT_AUDIO_SOURCE@ -l 1.0 2%+" "CTRL, XF86AudioRaiseVolume, exec, ${wpctl} set-volume @DEFAULT_AUDIO_SOURCE@ -l 1.0 2%+"
"CTRL, XF86AudioLowerVolume, exec, ${wpctl} set-volume @DEFAULT_AUDIO_SOURCE@ -l 1.0 2%-" "CTRL, XF86AudioLowerVolume, exec, ${wpctl} set-volume @DEFAULT_AUDIO_SOURCE@ -l 1.0 2%-"
", XF86AudioNext, exec, ${playerctl} next"
", XF86AudioPrev, exec, ${playerctl} previous"
"CTRL, XF86AudioNext, exec, ${playerctl} position 10+"
"CTRL, XF86AudioPrev, exec, ${playerctl} position 10-"
]; ];
bindl = [ bindl = [
", XF86AudioMute, exec, ${wpctl} set-mute @DEFAULT_AUDIO_SINK@ toggle" ", XF86AudioMute, exec, ${wpctl} set-mute @DEFAULT_AUDIO_SINK@ toggle"
", XF86AudioMicMute, exec, ${wpctl} set-mute @DEFAULT_AUDIO_SOURCE@ toggle" ", XF86AudioMicMute, exec, ${wpctl} set-mute @DEFAULT_AUDIO_SOURCE@ toggle"
", XF86AudioPlay, exec, ${playerctl} play-pause"
", XF86AudioStop, exec, ${playerctl} stop"
]; ];
}; };
}; };

View File

@@ -0,0 +1,50 @@
{
user ? throw "user argument is required",
}:
{
lib,
config,
pkgs,
...
}:
let
hmConfig = config.home-manager.users.${user.name};
qalculate-gtk = pkgs.qalculate-gtk.overrideAttrs (oldAttrs: {
patches = oldAttrs.patches or [ ] ++ [ ./skip-save-prefs.patch ];
});
in
{
home-manager.users.${user.name} = {
home = {
packages = [ qalculate-gtk ];
persistence."/cache${user.home}".files = [
"${hmConfig.xdg.relativeConfigHome}/qalculate/qalculate-gtk.history"
];
};
xdg.configFile."qalculate/qalculate-gtk.cfg".source =
(pkgs.formats.ini { }).generate "qalculate-gtk.cfg"
{
General = {
allow_multiple_instances = 1;
width = 500;
save_history_separately = 1;
auto_update_exchange_rates = 1;
local_currency_conversion = 1;
use_binary_prefixes = 1;
persistent_keypad = 1;
copy_ascii = 1;
copy_ascii_without_units = 1;
};
Mode = {
calculate_as_you_type = 1;
excessive_parenthesis = 1;
};
};
wayland.windowManager.hyprland.settings = {
bind = [ ", XF86Calculator, exec, ${lib.meta.getExe qalculate-gtk}" ];
windowrulev2 = [ "float, class:(qalculate-gtk)" ];
};
};
}

View File

Before

Width:  |  Height:  |  Size: 216 KiB

After

Width:  |  Height:  |  Size: 216 KiB

View File

@@ -1,5 +1,12 @@
{ user ? throw "user argument is required" }: { config, lib, pkgs, ... }: {
user ? throw "user argument is required",
}:
{
config,
lib,
pkgs,
...
}:
let let
hmConfig = config.home-manager.users.${user.name}; hmConfig = config.home-manager.users.${user.name};
in in
@@ -34,9 +41,7 @@ in
xdg.configFile = xdg.configFile =
let let
qtConfig = (pkgs.formats.ini { }).generate "qt5ct.conf" { qtConfig = (pkgs.formats.ini { }).generate "qt5ct.conf" { Appearance.style = "kvantum"; };
Appearance.style = "kvantum";
};
in in
{ {
"qt5ct/qt5ct.conf".source = qtConfig; "qt5ct/qt5ct.conf".source = qtConfig;

View File

@@ -1,5 +1,12 @@
{ user ? throw "user argument is required" }: { config, lib, pkgs, ... }: {
user ? throw "user argument is required",
}:
{
config,
lib,
pkgs,
...
}:
let let
hmConfig = config.home-manager.users.${user.name}; hmConfig = config.home-manager.users.${user.name};
in in

View File

@@ -0,0 +1,64 @@
{
user ? throw "user argument is required",
}:
{
config,
lib,
pkgs,
...
}:
let
hmConfig = config.home-manager.users.${user.name};
themeSwww = lib.meta.getExe (
pkgs.writeShellApplication {
name = "theme-swww";
runtimeInputs = with pkgs; [
coreutils
swww
];
text = "exec swww img \"${hmConfig.theme.configDir}/wallpaper\"";
}
);
in
{
home-manager.users.${user.name} = {
home = {
packages = with pkgs; [ swww ];
persistence."/cache${user.home}".directories = [ "${hmConfig.xdg.relativeCacheHome}/swww" ];
};
systemd.user.services.swww = {
Unit = {
Description = "Wallpaper daemon";
BindsTo = [ "graphical-session.target" ];
After = [ "graphical-session.target" ];
};
Service = {
Type = "forking";
ExecStart = lib.meta.getExe (
pkgs.writeShellApplication {
name = "init-swww";
runtimeInputs = with pkgs; [ swww ];
text = "exec swww init";
}
);
ExecStartPost = themeSwww;
ExecStop = lib.meta.getExe (
pkgs.writeShellApplication {
name = "kill-swww";
runtimeInputs = with pkgs; [ swww ];
text = "exec swww kill";
}
);
};
Install.WantedBy = [ "graphical-session.target" ];
};
theme.extraConfig = lib.mkAfter "${themeSwww} &";
};
}

View File

@@ -1,5 +1,13 @@
{ user ? throw "user argument is required" }: { config, inputs, lib, pkgs, ... }: {
user ? throw "user argument is required",
}:
{
config,
inputs,
lib,
pkgs,
...
}:
let let
hmConfig = config.home-manager.users.${user.name}; hmConfig = config.home-manager.users.${user.name};
themeBin = lib.meta.getExe hmConfig.theme.pkg; themeBin = lib.meta.getExe hmConfig.theme.pkg;
@@ -14,7 +22,9 @@ in
]; ];
home = { home = {
activation.themeInit = inputs.home-manager.lib.hm.dag.entryAfter [ "writeBoundary" ] "run ${themeBin}"; activation.themeInit = inputs.home-manager.lib.hm.dag.entryAfter [
"writeBoundary"
] "run ${themeBin}";
persistence."/persist${user.home}".directories = [ "${hmConfig.xdg.relativeConfigHome}/theme" ]; persistence."/persist${user.home}".directories = [ "${hmConfig.xdg.relativeConfigHome}/theme" ];
}; };
}; };

View File

@@ -1,5 +1,13 @@
{ user ? throw "user argument is required" }: { config, inputs, lib, pkgs, ... }: {
user ? throw "user argument is required",
}:
{
config,
inputs,
lib,
pkgs,
...
}:
let let
hmConfig = config.home-manager.users.${user.name}; hmConfig = config.home-manager.users.${user.name};
in in
@@ -7,7 +15,10 @@ in
home-manager.users.${user.name} = { home-manager.users.${user.name} = {
programs.vscode = { programs.vscode = {
enable = true; enable = true;
mutableExtensionsDir = false; mutableExtensionsDir = false;
extensions = with pkgs.vscode-extensions; [ naumovs.color-highlight ];
userSettings = { userSettings = {
"diffEditor.ignoreTrimWhitespace" = false; "diffEditor.ignoreTrimWhitespace" = false;
"editor.accessibilitySupport" = "off"; "editor.accessibilitySupport" = "off";
@@ -65,9 +76,7 @@ in
}; };
}; };
imports = [ imports = [ ./langs/nix.nix ];
./langs/nix.nix
];
home.persistence = { home.persistence = {
"/persist${user.home}".directories = [ ".config/Code" ]; "/persist${user.home}".directories = [ ".config/Code" ];

View File

@@ -1,5 +1,4 @@
{ pkgs, ... }: { pkgs, ... }:
{ {
programs.vscode = { programs.vscode = {
userSettings = { userSettings = {
@@ -7,9 +6,7 @@
"nix.formatterPath" = "nixpkgs-fmt"; "nix.formatterPath" = "nixpkgs-fmt";
"nix.serverSettings" = { }; "nix.serverSettings" = { };
}; };
extensions = with pkgs; with vscode-extensions; [ extensions = with pkgs; with vscode-extensions; [ jnoortheen.nix-ide ];
jnoortheen.nix-ide
];
}; };
home.packages = with pkgs; [ home.packages = with pkgs; [

View File

@@ -1,5 +1,7 @@
{ user ? throw "user argument is required" }: { pkgs, ... }: {
user ? throw "user argument is required",
}:
{ pkgs, ... }:
{ {
home-manager.users.${user.name}.home.packages = with pkgs; [ wev ]; home-manager.users.${user.name}.home.packages = with pkgs; [ wev ];
} }

View File

@@ -1,5 +1,7 @@
{ user ? throw "user argument is required" }: { config, ... }: {
user ? throw "user argument is required",
}:
{ config, ... }:
let let
hmConfig = config.home-manager.users.${user.name}; hmConfig = config.home-manager.users.${user.name};
in in

View File

@@ -1,5 +0,0 @@
{ user ? throw "user argument is required" }: { pkgs, ... }:
{
home-manager.users.${user.name}.home.packages = with pkgs; [ pavucontrol ];
}

View File

@@ -1,21 +0,0 @@
{ user ? throw "user argument is required" }: { lib, pkgs, ... }:
{
home-manager.users.${user.name} = {
home.packages = with pkgs; [ playerctl ];
services.playerctld.enable = true;
wayland.windowManager.hyprland.settings.bindle =
let
playerctl = lib.meta.getExe pkgs.playerctl;
in
[
", XF86AudioPlay, exec, ${playerctl} play-pause"
", XF86AudioStop, exec, ${playerctl} stop"
", XF86AudioNext, exec, ${playerctl} next"
", XF86AudioPrev, exec, ${playerctl} previous"
"CTRL, XF86AudioNext, exec, ${playerctl} position 10+"
"CTRL, XF86AudioPrev, exec, ${playerctl} position 10-"
];
};
}

View File

@@ -1,39 +0,0 @@
{ user ? throw "user argument is required" }: { lib, config, pkgs, ... }:
let
hmConfig = config.home-manager.users.${user.name};
qalculate-gtk = pkgs.qalculate-gtk.overrideAttrs (oldAttrs: {
patches = oldAttrs.patches or [ ] ++ [ ./skip-save-prefs.patch ];
});
in
{
home-manager.users.${user.name} = {
home = {
packages = [ qalculate-gtk ];
persistence."/cache${user.home}".files = [ "${hmConfig.xdg.relativeConfigHome}/qalculate/qalculate-gtk.history" ];
};
xdg.configFile."qalculate/qalculate-gtk.cfg".source = (pkgs.formats.ini { }).generate "qalculate-gtk.cfg" {
General = {
allow_multiple_instances = 1;
width = 500;
save_history_separately = 1;
auto_update_exchange_rates = 1;
local_currency_conversion = 1;
use_binary_prefixes = 1;
persistent_keypad = 1;
copy_ascii = 1;
copy_ascii_without_units = 1;
};
Mode = {
calculate_as_you_type = 1;
excessive_parenthesis = 1;
};
};
wayland.windowManager.hyprland.settings = {
bind = [ ", XF86Calculator, exec, ${lib.meta.getExe qalculate-gtk}" ];
windowrulev2 = [ "float, class:(qalculate-gtk)" ];
};
};
}

View File

@@ -1,51 +0,0 @@
{ user ? throw "user argument is required" }: { config, lib, pkgs, ... }:
let
hmConfig = config.home-manager.users.${user.name};
themeSwww = lib.meta.getExe (pkgs.writeShellApplication {
name = "theme-swww";
runtimeInputs = with pkgs; [
coreutils-full
swww
];
text = "exec swww img \"${hmConfig.theme.configDir}/wallpaper\"";
});
in
{
home-manager.users.${user.name} = {
home = {
packages = with pkgs; [ swww ];
persistence."/cache${user.home}".directories = [ "${hmConfig.xdg.relativeCacheHome}/swww" ];
};
systemd.user.services.swww = {
Unit = {
Description = "Wallpaper daemon";
BindsTo = [ "graphical-session.target" ];
After = [ "graphical-session.target" ];
};
Service = {
Type = "forking";
ExecStart = lib.meta.getExe (pkgs.writeShellApplication {
name = "init-swww";
runtimeInputs = with pkgs; [ swww ];
text = "exec swww init";
});
ExecStartPost = themeSwww;
ExecStop = lib.meta.getExe (pkgs.writeShellApplication {
name = "kill-swww";
runtimeInputs = with pkgs; [ swww ];
text = "exec swww kill";
});
};
Install.WantedBy = [ "graphical-session.target" ];
};
theme.extraConfig = lib.mkAfter "${themeSwww} &";
};
}

Some files were not shown because too many files have changed in this diff Show More