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

View File

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

View File

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

View File

@@ -1,35 +1,32 @@
{ config, lib, ... }:
let
users = lib.attrsets.filterAttrs (_: config: config.isNormalUser) config.users.users;
in
{
home-manager.users = lib.attrsets.mapAttrs
(user: cfg: ({
xdg = {
enable = true;
mimeApps.enable = true;
home-manager.users = lib.attrsets.mapAttrs (user: cfg: {
xdg = {
enable = true;
mimeApps.enable = true;
userDirs = {
enable = true;
extraConfig = {
XDG_VM_DIR = "${cfg.home}/VMs";
XDG_GIT_DIR = "${cfg.home}/git";
};
userDirs = {
enable = true;
extraConfig = {
XDG_VM_DIR = "${cfg.home}/VMs";
XDG_GIT_DIR = "${cfg.home}/git";
};
};
};
home.persistence."/persist${cfg.home}".directories = [
"Desktop" # userDirs.desktop
"Documents" # userDirs.documents
"Downloads" # userDirs.download
"Music" # userDirs.music
"Pictures" # userDirs.pictures
"Templates" # userDirs.templates
"Videos" # userDirs.videos
"VMs"
"git"
];
}))
users;
home.persistence."/persist${cfg.home}".directories = [
"Desktop" # userDirs.desktop
"Documents" # userDirs.documents
"Downloads" # userDirs.download
"Music" # userDirs.music
"Pictures" # userDirs.pictures
"Templates" # userDirs.templates
"Videos" # userDirs.videos
"VMs"
"git"
];
}) users;
}

View File

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

View File

@@ -1,22 +1,26 @@
{ lib, ... }:
let
userOptions = with lib; with types; { config, ... }: {
options.email = mkOption {
type = nullOr str;
description = "Email address of the user.";
};
userOptions =
with lib;
with types;
{ config, ... }:
{
options.email = mkOption {
type = nullOr str;
description = "Email address of the user.";
};
options.fullName = mkOption {
type = nullOr str;
description = "Full name of the user.";
options.fullName = mkOption {
type = nullOr str;
description = "Full name of the user.";
};
};
};
in
{
options = with lib; with types; {
users.users = mkOption {
type = attrsOf (submodule userOptions);
options =
with lib;
with types;
{
users.users = mkOption { type = attrsOf (submodule userOptions); };
};
};
}

View File

@@ -1,32 +1,43 @@
{ config, pkgs, lib, ... }:
{
config,
pkgs,
lib,
...
}:
let
cfg = config.wayland.windowManager.hyprland;
in
{
options.wayland.windowManager.hyprland = with lib; with types; {
initExtraConfig = mkOption {
type = lines;
default = "";
description = "Extra configuration lines to add to exec-once";
};
options.wayland.windowManager.hyprland =
with lib;
with types;
{
initExtraConfig = mkOption {
type = lines;
default = "";
description = "Extra configuration lines to add to exec-once";
};
reloadExtraConfig = mkOption {
type = lines;
default = "";
description = "Extra configuration lines to add to exec";
reloadExtraConfig = mkOption {
type = lines;
default = "";
description = "Extra configuration lines to add to exec";
};
};
};
config = {
wayland.windowManager.hyprland.settings.exec-once = lib.meta.getExe (pkgs.writeShellApplication {
name = "init-hyprland";
text = cfg.initExtraConfig;
});
wayland.windowManager.hyprland.settings.exec-once = lib.meta.getExe (
pkgs.writeShellApplication {
name = "init-hyprland";
text = cfg.initExtraConfig;
}
);
wayland.windowManager.hyprland.settings.exec = lib.meta.getExe (pkgs.writeShellApplication {
name = "reload-hyprland";
text = cfg.reloadExtraConfig;
});
wayland.windowManager.hyprland.settings.exec = lib.meta.getExe (
pkgs.writeShellApplication {
name = "reload-hyprland";
text = cfg.reloadExtraConfig;
}
);
};
}

View File

@@ -1,18 +1,25 @@
{ config, pkgs, lib, ... }:
{
config,
pkgs,
lib,
...
}:
let
cfg = config.programs.matugen;
in
{
# https://github.com/Theaninova/matugen/blob/add-home-manager-module/hm-module.nix
options.programs.matugen = with lib; with types; {
enable = mkEnableOption "matugen";
package = mkPackageOption pkgs "matugen" { };
settings = mkOption {
type = attrsOf anything;
description = "Settings to write to config.toml.";
options.programs.matugen =
with lib;
with types;
{
enable = mkEnableOption "matugen";
package = mkPackageOption pkgs "matugen" { };
settings = mkOption {
type = attrsOf anything;
description = "Settings to write to config.toml.";
};
};
};
config = lib.mkIf cfg.enable {
home.packages = [ cfg.package ];

View File

@@ -1,11 +1,18 @@
{ config, lib, pkgs, ... }:
{
config,
lib,
pkgs,
...
}:
let
cfg = config.theme;
init = pkgs.writeShellApplication {
name = "theme";
runtimeInputs = with pkgs; [ coreutils-full ];
bashOptions = [ "nounset" "pipefail" ];
runtimeInputs = with pkgs; [ coreutils ];
bashOptions = [
"nounset"
"pipefail"
];
runtimeEnv = {
CONFIG = cfg.configDir;
DEFAULT_WALLPAPER = cfg.wallpaper;
@@ -17,336 +24,348 @@ let
in
{
# https://github.com/Theaninova/TheaninovOS/blob/master/modules/home-manager/theme/md3-evo.nix
options.theme = with lib; with types; {
enable = mkEnableOption "theme";
options.theme =
with lib;
with types;
{
enable = mkEnableOption "theme";
configDir = mkOption {
type = str;
default = "${config.xdg.configHome}/theme";
description = "The path to the theme config directory.";
};
wallpaper = mkOption {
type = path;
description = "The path to the default wallpaper";
};
pkg = mkOption {
type = package;
default = init;
readOnly = true;
description = "The package containing the `theme` script";
};
extraConfig = mkOption {
type = lines;
default = "";
description = "Extra configuration lines to add to the theme script.";
};
flavour = mkOption {
type = enum [
"content"
"expressive"
"fidelity"
"fruit-salad"
"monochrome"
"neutral"
"rainbow"
"tonal-spot"
];
default = "tonal-spot";
description = "The flavour of the theme.";
};
mode = mkOption {
type = enum [ "dark" "light" ];
default = "dark";
description = "The default mode of the theme.";
};
contrast = mkOption {
type = numbers.between (-1) 1;
default = 0;
description = "Use a modified contrast.";
};
opacity = mkOption {
type = numbers.between 0 1;
default = 1;
description = "The opacity of apps.";
};
radius = mkOption {
type = ints.unsigned;
default = 8;
description = "The radius of corners.";
};
padding = mkOption {
type = ints.unsigned;
default = 8;
description = "The padding of windows.";
};
blur = mkOption {
type = ints.unsigned;
default = 0;
description = "The blur amount of windows.";
};
color = {
semantic = {
blend = mkOption {
type = bool;
default = false;
description = "Blend the colors.";
};
danger = mkOption {
type = str;
default = "#ff0000";
description = "The color of danger.";
};
warning = mkOption {
type = str;
default = "#ffff00";
description = "The color of warning.";
};
success = mkOption {
type = str;
default = "#00ff00";
description = "The color of success.";
};
info = mkOption {
type = str;
default = "#0000ff";
description = "The color of info.";
};
configDir = mkOption {
type = str;
default = "${config.xdg.configHome}/theme";
description = "The path to the theme config directory.";
};
syntax = {
blend = mkOption {
type = bool;
default = true;
description = "Blend the colors.";
};
keywords = mkOption {
type = str;
default = "#ff8000";
description = "The color of keywords.";
};
functions = mkOption {
type = str;
default = "#0000ff";
description = "The color of functions.";
};
properties = mkOption {
type = str;
default = "#ff00ff";
description = "The color of properties.";
};
constants = mkOption {
type = str;
default = "#ff00ff";
description = "The color of constants.";
};
strings = mkOption {
type = str;
default = "#00ff00";
description = "The color of variables.";
};
numbers = mkOption {
type = str;
default = "#00ffff";
description = "The color of numbers.";
};
structures = mkOption {
type = str;
default = "#ffff00";
description = "The color of structures.";
};
types = mkOption {
type = str;
default = "#00ffff";
description = "The color of types.";
};
wallpaper = mkOption {
type = path;
description = "The path to the default wallpaper";
};
ansi = {
blend = mkOption {
type = bool;
default = true;
description = "Blend the colors.";
};
red = mkOption {
type = str;
default = "#ff0000";
description = "The color of red.";
};
green = mkOption {
type = str;
default = "#00ff00";
description = "The color of green.";
};
yellow = mkOption {
type = str;
default = "#ffff00";
description = "The color of yellow.";
};
orange = mkOption {
type = str;
default = "#ff8000";
description = "The color of orange.";
};
blue = mkOption {
type = str;
default = "#0000ff";
description = "The color of blue.";
};
magenta = mkOption {
type = str;
default = "#ff00ff";
description = "The color of magenta.";
};
cyan = mkOption {
type = str;
default = "#00ffff";
description = "The color of cyan.";
};
};
};
font = {
sansSerif = {
names = mkOption {
type = listOf str;
default = [ "Roboto" ];
description = "The sans serif font families.";
};
packages = mkOption {
type = listOf package;
default = with pkgs; [ roboto ];
description = "The sans serif font packages.";
};
pkg = mkOption {
type = package;
default = init;
readOnly = true;
description = "The package containing the `theme` script";
};
serif = {
names = mkOption {
type = listOf str;
default = [ "Roboto Serif" ];
description = "The serif font families.";
};
packages = mkOption {
type = listOf package;
default = with pkgs; [ roboto-serif ];
description = "The serif font packages.";
};
extraConfig = mkOption {
type = lines;
default = "";
description = "Extra configuration lines to add to the theme script.";
};
monospace = {
names = mkOption {
type = listOf str;
default = [ "JetBrainsMono Nerd Font" ];
description = "The monospace font families.";
};
packages = mkOption {
type = listOf package;
default = with pkgs; [ (nerdfonts.override { fonts = [ "JetBrainsMono" ]; }) ];
description = "The monospace font packages.";
};
};
emoji = {
names = mkOption {
type = listOf str;
default = [ "Noto Emoji" "Font Awesome" ];
description = "The emoji font families.";
};
packages = mkOption {
type = listOf package;
default = with pkgs; [ noto-fonts-color-emoji font-awesome ];
description = "The emoji font packages.";
};
};
size = mkOption {
type = ints.positive;
default = 12;
description = "The font size.";
};
};
icon = {
names = mkOption {
type = listOf str;
default = [ "Adwaita" ];
description = "The icon theme names.";
};
packages = mkOption {
type = listOf package;
default = with pkgs; [
adwaita-icon-theme
nixos-icons
flavour = mkOption {
type = enum [
"content"
"expressive"
"fidelity"
"fruit-salad"
"monochrome"
"neutral"
"rainbow"
"tonal-spot"
];
description = "The icon theme packages.";
default = "tonal-spot";
description = "The flavour of the theme.";
};
mode = mkOption {
type = enum [
"dark"
"light"
];
default = "dark";
description = "The default mode of the theme.";
};
contrast = mkOption {
type = numbers.between (-1) 1;
default = 0;
description = "Use a modified contrast.";
};
opacity = mkOption {
type = numbers.between 0 1;
default = 1;
description = "The opacity of apps.";
};
radius = mkOption {
type = ints.unsigned;
default = 8;
description = "The radius of corners.";
};
padding = mkOption {
type = ints.unsigned;
default = 8;
description = "The padding of windows.";
};
blur = mkOption {
type = ints.unsigned;
default = 0;
description = "The blur amount of windows.";
};
color = {
semantic = {
blend = mkOption {
type = bool;
default = false;
description = "Blend the colors.";
};
danger = mkOption {
type = str;
default = "#ff0000";
description = "The color of danger.";
};
warning = mkOption {
type = str;
default = "#ffff00";
description = "The color of warning.";
};
success = mkOption {
type = str;
default = "#00ff00";
description = "The color of success.";
};
info = mkOption {
type = str;
default = "#0000ff";
description = "The color of info.";
};
};
syntax = {
blend = mkOption {
type = bool;
default = true;
description = "Blend the colors.";
};
keywords = mkOption {
type = str;
default = "#ff8000";
description = "The color of keywords.";
};
functions = mkOption {
type = str;
default = "#0000ff";
description = "The color of functions.";
};
properties = mkOption {
type = str;
default = "#ff00ff";
description = "The color of properties.";
};
constants = mkOption {
type = str;
default = "#ff00ff";
description = "The color of constants.";
};
strings = mkOption {
type = str;
default = "#00ff00";
description = "The color of variables.";
};
numbers = mkOption {
type = str;
default = "#00ffff";
description = "The color of numbers.";
};
structures = mkOption {
type = str;
default = "#ffff00";
description = "The color of structures.";
};
types = mkOption {
type = str;
default = "#00ffff";
description = "The color of types.";
};
};
ansi = {
blend = mkOption {
type = bool;
default = true;
description = "Blend the colors.";
};
red = mkOption {
type = str;
default = "#ff0000";
description = "The color of red.";
};
green = mkOption {
type = str;
default = "#00ff00";
description = "The color of green.";
};
yellow = mkOption {
type = str;
default = "#ffff00";
description = "The color of yellow.";
};
orange = mkOption {
type = str;
default = "#ff8000";
description = "The color of orange.";
};
blue = mkOption {
type = str;
default = "#0000ff";
description = "The color of blue.";
};
magenta = mkOption {
type = str;
default = "#ff00ff";
description = "The color of magenta.";
};
cyan = mkOption {
type = str;
default = "#00ffff";
description = "The color of cyan.";
};
};
};
font = {
sansSerif = {
names = mkOption {
type = listOf str;
default = [ "Roboto" ];
description = "The sans serif font families.";
};
packages = mkOption {
type = listOf package;
default = with pkgs; [ roboto ];
description = "The sans serif font packages.";
};
};
serif = {
names = mkOption {
type = listOf str;
default = [ "Roboto Serif" ];
description = "The serif font families.";
};
packages = mkOption {
type = listOf package;
default = with pkgs; [ roboto-serif ];
description = "The serif font packages.";
};
};
monospace = {
names = mkOption {
type = listOf str;
default = [ "JetBrainsMono Nerd Font" ];
description = "The monospace font families.";
};
packages = mkOption {
type = listOf package;
default = with pkgs; [ (nerdfonts.override { fonts = [ "JetBrainsMono" ]; }) ];
description = "The monospace font packages.";
};
};
emoji = {
names = mkOption {
type = listOf str;
default = [
"Noto Emoji"
"Font Awesome"
];
description = "The emoji font families.";
};
packages = mkOption {
type = listOf package;
default = with pkgs; [
noto-fonts-color-emoji
font-awesome
];
description = "The emoji font packages.";
};
};
size = mkOption {
type = ints.positive;
default = 12;
description = "The font size.";
};
};
icon = {
names = mkOption {
type = listOf str;
default = [ "Adwaita" ];
description = "The icon theme names.";
};
packages = mkOption {
type = listOf package;
default = with pkgs; [
adwaita-icon-theme
nixos-icons
];
description = "The icon theme packages.";
};
};
cursor = {
names = mkOption {
type = listOf str;
default = [ "Adwaita" ];
description = "The cursor names.";
};
packages = mkOption {
type = listOf package;
default = with pkgs; [ adwaita-icon-theme ];
description = "The cursor theme packages.";
};
size = mkOption {
type = ints.positive;
default = 32;
description = "The cursor size.";
};
};
};
cursor = {
names = mkOption {
type = listOf str;
default = [ "Adwaita" ];
description = "The cursor names.";
};
packages = mkOption {
type = listOf package;
default = with pkgs; [ adwaita-icon-theme ];
description = "The cursor theme packages.";
};
size = mkOption {
type = ints.positive;
default = 32;
description = "The cursor size.";
};
};
};
config = lib.mkIf cfg.enable {
home = {
packages =
[ cfg.pkg ] ++
cfg.font.sansSerif.packages ++
cfg.font.serif.packages ++
cfg.font.monospace.packages ++
cfg.font.emoji.packages ++
cfg.icon.packages ++
cfg.cursor.packages;
[ cfg.pkg ]
++ cfg.font.sansSerif.packages
++ cfg.font.serif.packages
++ cfg.font.monospace.packages
++ cfg.font.emoji.packages
++ cfg.icon.packages
++ cfg.cursor.packages;
pointerCursor = {
name = builtins.head cfg.cursor.names;

View File

@@ -1,48 +1,42 @@
{ config, lib, ... }:
let
cfg = config.xdg;
in
{
options.xdg = with lib; with types; {
relativeCacheHome = mkOption {
type = str;
default = ".cache";
description = "Relative path to directory holding application caches.";
};
options.xdg =
with lib;
with types;
{
relativeCacheHome = mkOption {
type = str;
default = ".cache";
description = "Relative path to directory holding application caches.";
};
cacheHome = mkOption {
default = "${config.home.homeDirectory}/${cfg.relativeCacheHome}";
};
cacheHome = mkOption { default = "${config.home.homeDirectory}/${cfg.relativeCacheHome}"; };
relativeConfigHome = mkOption {
type = str;
default = ".config";
description = "Relative path to directory holding application configurations.";
};
relativeConfigHome = mkOption {
type = str;
default = ".config";
description = "Relative path to directory holding application configurations.";
};
configHome = mkOption {
default = "${config.home.homeDirectory}/${cfg.relativeConfigHome}";
};
configHome = mkOption { default = "${config.home.homeDirectory}/${cfg.relativeConfigHome}"; };
relativeDataHome = mkOption {
type = str;
default = ".local/share";
description = "Relative path to directory holding application data.";
};
relativeDataHome = mkOption {
type = str;
default = ".local/share";
description = "Relative path to directory holding application data.";
};
dataHome = mkOption {
default = "${config.home.homeDirectory}/${cfg.relativeDataHome}";
};
dataHome = mkOption { default = "${config.home.homeDirectory}/${cfg.relativeDataHome}"; };
relativeStateHome = mkOption {
type = str;
default = ".local/state";
description = "Relative path to directory holding application states.";
};
relativeStateHome = mkOption {
type = str;
default = ".local/state";
description = "Relative path to directory holding application states.";
};
stateHome = mkOption {
default = "${config.home.homeDirectory}/${cfg.relativeStateHome}";
stateHome = mkOption { 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
hmConfig = config.home-manager.users.${user.name};
in
@@ -22,11 +29,13 @@ in
};
hooks = {
commit-msg = lib.meta.getExe (pkgs.writeShellApplication {
name = "git-commit-msg-hook";
runtimeInputs = with pkgs; [ git ];
text = builtins.readFile ./commit-msg.sh;
});
commit-msg = lib.meta.getExe (
pkgs.writeShellApplication {
name = "git-commit-msg-hook";
runtimeInputs = with pkgs; [ git ];
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
hmConfig = config.home-manager.users.${user.name};
gpgPath = "${hmConfig.xdg.dataHome}/gnupg";
@@ -20,25 +27,33 @@ in
systemd.user = {
services.gpg-agent-import =
let
init = lib.meta.getExe (pkgs.writeShellApplication {
name = "import-gpg-keys";
runtimeInputs = with pkgs; [
coreutils-full
gnugrep
gnupg
];
runtimeEnv = {
GNUPGHOME = gpgPath;
HOME = user.home;
};
text = builtins.readFile ./import-gpg-keys.sh;
});
init = lib.meta.getExe (
pkgs.writeShellApplication {
name = "import-gpg-keys";
runtimeInputs = with pkgs; [
coreutils
gnugrep
gnupg
];
runtimeEnv = {
GNUPGHOME = gpgPath;
HOME = user.home;
};
text = builtins.readFile ./import-gpg-keys.sh;
}
);
in
{
Unit = {
Description = "Auto-import GPG keys";
Requires = [ "sops-nix.service" "gpg-agent.socket" ];
After = [ "sops-nix.service" "gpg-agent.socket" ];
Requires = [
"sops-nix.service"
"gpg-agent.socket"
];
After = [
"sops-nix.service"
"gpg-agent.socket"
];
};
Service = {

View File

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

View File

@@ -1,5 +1,7 @@
{ pkgs ? import <nixpkgs> { }, ... }:
{
pkgs ? import <nixpkgs> { },
...
}:
pkgs.stdenv.mkDerivation {
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
hmConfig = config.home-manager.users.${user.name};
agsConfig = (import ./config { inherit pkgs; });
agsConfig = import ./config { inherit pkgs; };
in
{
home-manager.users.${user.name} = {
@@ -23,7 +31,10 @@ in
systemd.user = {
targets.tray.Unit = {
BindsTo = [ "ags.service" ];
After = [ "graphical-session.target" "ags.service" ];
After = [
"graphical-session.target"
"ags.service"
];
};
services.ags = {
@@ -37,20 +48,22 @@ in
Type = "notify";
NotifyAccess = "all";
ExecStart = lib.meta.getExe (pkgs.writeShellApplication {
name = "init-ags";
runtimeInputs = with pkgs; [
inputs.ags.packages.${stdenv.hostPlatform.system}.default
sassc
hyprland
nixos-icons
rofi-wayland
wl-clipboard
cliphist
libdbusmenu-gtk3
];
text = "exec ags";
});
ExecStart = lib.meta.getExe (
pkgs.writeShellApplication {
name = "init-ags";
runtimeInputs = with pkgs; [
inputs.ags.packages.${stdenv.hostPlatform.system}.default
sassc
hyprland
nixos-icons
rofi-wayland
wl-clipboard
cliphist
libdbusmenu-gtk3
];
text = "exec ags";
}
);
};
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;

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} = {
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
hmConfig = config.home-manager.users.${user.name};
in
{
home-manager.users.${user.name} = {
home = {
packages = with pkgs; [ wl-clipboard cliphist ];
packages = with pkgs; [
wl-clipboard
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} = {
programs.firefox = {
@@ -47,38 +49,59 @@
"Wikipedia (en)".metaData.alias = "@w";
"Nix Packages" = {
urls = [{
template = "https://search.nixos.org/packages";
params = [
{ name = "type"; value = "packages"; }
{ name = "query"; value = "{searchTerms}"; }
];
}];
urls = [
{
template = "https://search.nixos.org/packages";
params = [
{
name = "type";
value = "packages";
}
{
name = "query";
value = "{searchTerms}";
}
];
}
];
icon = "${pkgs.nixos-icons}/share/icons/hicolor/scalable/apps/nix-snowflake.svg";
definedAliases = [ "@np" ];
};
"Nix Options" = {
urls = [{
template = "https://search.nixos.org/options";
params = [
{ name = "type"; value = "options"; }
{ name = "query"; value = "{searchTerms}"; }
];
}];
urls = [
{
template = "https://search.nixos.org/options";
params = [
{
name = "type";
value = "options";
}
{
name = "query";
value = "{searchTerms}";
}
];
}
];
icon = "${pkgs.nixos-icons}/share/icons/hicolor/scalable/apps/nix-snowflake.svg";
definedAliases = [ "@no" ];
};
"Home Manager Options" = {
urls = [{
template = "https://home-manager-options.extranix.com/";
params = [
{ name = "query"; value = "{searchTerms}"; }
];
}];
urls = [
{
template = "https://home-manager-options.extranix.com/";
params = [
{
name = "query";
value = "{searchTerms}";
}
];
}
];
icon = "${pkgs.nixos-icons}/share/icons/hicolor/scalable/apps/nix-snowflake.svg";
definedAliases = [ "@nh" ];
@@ -88,9 +111,7 @@
};
};
wayland.windowManager.hyprland.settings.bind = [
"$mod, b, exec, ${lib.meta.getExe pkgs.firefox}"
];
wayland.windowManager.hyprland.settings.bind = [ "$mod, b, exec, ${lib.meta.getExe pkgs.firefox}" ];
home.persistence = {
"/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
hmConfig = config.home-manager.users.${user.name};
in
@@ -42,21 +49,25 @@ in
};
};
theme.extraConfig = "${lib.meta.getExe (pkgs.writeShellApplication {
name = "theme-gtk";
runtimeInputs = with pkgs; [ dconf ];
text = ''
MODE=$(cat "${hmConfig.theme.configDir}/mode")
theme.extraConfig = "${
lib.meta.getExe (
pkgs.writeShellApplication {
name = "theme-gtk";
runtimeInputs = with pkgs; [ dconf ];
text = ''
MODE=$(cat "${hmConfig.theme.configDir}/mode")
if [ "$MODE" = "light" ]; then
GTK_THEME="adw-gtk3"
else
GTK_THEME="adw-gtk3-dark"
fi
if [ "$MODE" = "light" ]; then
GTK_THEME="adw-gtk3"
else
GTK_THEME="adw-gtk3-dark"
fi
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/gtk-theme "'$GTK_THEME'"
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
hmConfig = config.home-manager.users.${user.name};
in
@@ -133,11 +140,15 @@ in
};
};
theme.extraConfig = "${lib.meta.getExe (pkgs.writeShellApplication {
name = "reload-hyprland";
runtimeInputs = with pkgs; [ hyprland ];
text = "exec hyprctl reload";
})} &";
theme.extraConfig = "${
lib.meta.getExe (
pkgs.writeShellApplication {
name = "reload-hyprland";
runtimeInputs = with pkgs; [ hyprland ];
text = "exec hyprctl reload";
}
)
} &";
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
hmConfig = config.home-manager.users.${user.name};
in
{
home-manager.users.${user.name} = {
home = {
packages = with pkgs; [ hyprshot swappy ];
packages = with pkgs; [
hyprshot
swappy
];
sessionVariables.HYPRSHOT_DIR = "${hmConfig.xdg.userDirs.pictures}/screenshots";
};
wayland.windowManager.hyprland.settings.bind =
let
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')\"";
swappyWrapper = lib.meta.getExe (pkgs.writeShellApplication {
name = "swappy-wrapper";
runtimeInputs = with pkgs; [ swappy ];
text = "exec swappy -f \"$1\"";
});
swappyWrapper = lib.meta.getExe (
pkgs.writeShellApplication {
name = "swappy-wrapper";
runtimeInputs = with pkgs; [ swappy ];
text = "exec swappy -f \"$1\"";
}
);
in
[
", 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
hmConfig = config.home-manager.users.${user.name};
in
@@ -27,11 +34,15 @@ in
};
};
theme.extraConfig = "${lib.meta.getExe (pkgs.writeShellApplication {
name = "reload-kitty";
runtimeInputs = with pkgs; [ procps ];
text = "exec pkill kitty -SIGUSR1";
})} &";
theme.extraConfig = "${
lib.meta.getExe (
pkgs.writeShellApplication {
name = "reload-kitty";
runtimeInputs = with pkgs; [ procps ];
text = "exec pkill kitty -SIGUSR1";
}
)
} &";
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
hmConfig = config.home-manager.users.${user.name};
in
@@ -54,8 +61,8 @@ in
blur = builtins.toString hmConfig.theme.blur;
opacity = builtins.toString hmConfig.theme.opacity;
opacity_hex = builtins.toString (percentageToHex hmConfig.theme.opacity);
opacity_shadow = builtins.toString (hmConfig.theme.opacity * .75);
opacity_shadow_hex = builtins.toString (percentageToHex (hmConfig.theme.opacity * .75));
opacity_shadow = builtins.toString (hmConfig.theme.opacity * 0.75);
opacity_shadow_hex = builtins.toString (percentageToHex (hmConfig.theme.opacity * 0.75));
font_size = builtins.toString hmConfig.theme.font.size;
font_sans_serif = builtins.head hmConfig.theme.font.sansSerif.names;
font_sans_serif_all = builtins.concatStringsSep ", " hmConfig.theme.font.sansSerif.names;
@@ -72,15 +79,19 @@ in
};
};
theme.extraConfig = lib.mkBefore (lib.meta.getExe (pkgs.writeShellApplication {
name = "theme-matugen";
runtimeInputs = with pkgs; [ matugen ];
text = ''
exec matugen image "${hmConfig.theme.configDir}/wallpaper" \
--type scheme-${hmConfig.theme.flavour} \
--mode "$(cat "${hmConfig.theme.configDir}/mode")" \
--contrast ${builtins.toString hmConfig.theme.contrast}
'';
}));
theme.extraConfig = lib.mkBefore (
lib.meta.getExe (
pkgs.writeShellApplication {
name = "theme-matugen";
runtimeInputs = with pkgs; [ matugen ];
text = ''
exec matugen image "${hmConfig.theme.configDir}/wallpaper" \
--type scheme-${hmConfig.theme.flavour} \
--mode "$(cat "${hmConfig.theme.configDir}/mode")" \
--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} = {
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.packages = with pkgs; [ pavucontrol ];
wayland.windowManager.hyprland.settings =
let
wpctl = "${pkgs.wireplumber}/bin/wpctl";
playerctl = lib.meta.getExe pkgs.playerctl;
in
{
bindle = [
@@ -12,11 +17,17 @@
", 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, 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 = [
", XF86AudioMute, exec, ${wpctl} set-mute @DEFAULT_AUDIO_SINK@ 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
hmConfig = config.home-manager.users.${user.name};
in
@@ -34,9 +41,7 @@ in
xdg.configFile =
let
qtConfig = (pkgs.formats.ini { }).generate "qt5ct.conf" {
Appearance.style = "kvantum";
};
qtConfig = (pkgs.formats.ini { }).generate "qt5ct.conf" { Appearance.style = "kvantum"; };
in
{
"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
hmConfig = config.home-manager.users.${user.name};
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
hmConfig = config.home-manager.users.${user.name};
themeBin = lib.meta.getExe hmConfig.theme.pkg;
@@ -14,7 +22,9 @@ in
];
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" ];
};
};

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
hmConfig = config.home-manager.users.${user.name};
in
@@ -7,7 +15,10 @@ in
home-manager.users.${user.name} = {
programs.vscode = {
enable = true;
mutableExtensionsDir = false;
extensions = with pkgs.vscode-extensions; [ naumovs.color-highlight ];
userSettings = {
"diffEditor.ignoreTrimWhitespace" = false;
"editor.accessibilitySupport" = "off";
@@ -65,9 +76,7 @@ in
};
};
imports = [
./langs/nix.nix
];
imports = [ ./langs/nix.nix ];
home.persistence = {
"/persist${user.home}".directories = [ ".config/Code" ];

View File

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

View File

@@ -1,5 +1,7 @@
{ user ? throw "user argument is required" }: { config, ... }:
{
user ? throw "user argument is required",
}:
{ config, ... }:
let
hmConfig = config.home-manager.users.${user.name};
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} &";
};
}

View File

@@ -1,15 +0,0 @@
{ user ? throw "user argument is required" }: { ... }:
{
networking.firewall = {
allowedTCPPorts = [ 22000 ];
allowedUDPPorts = [ 21027 22000 ];
};
home-manager.users.${user.name} = {
services.syncthing = {
enable = true;
extraOptions = [ "-no-default-folder" ];
};
};
}

View File

@@ -1,16 +1,19 @@
{ config, ... }:
let
user = config.users.users.nick;
in
{
imports = [
../common
(import ../configs/zsh { inherit user; })
(import ../configs/git { inherit user; })
(import ../configs/neovim { inherit user; })
(import ../configs/gpg-agent { inherit user; })
(import ../configs/btop { inherit user; })
(import ../configs/console/bluetooth { inherit user; })
(import ../configs/console/brightnessctl { inherit user; })
(import ../configs/console/btop { inherit user; })
(import ../configs/console/git { inherit user; })
(import ../configs/console/gpg-agent { inherit user; })
(import ../configs/console/neovim { inherit user; })
(import ../configs/console/pipewire { inherit user; })
(import ../configs/console/syncthing { inherit user; })
(import ../configs/console/zsh { inherit user; })
];
sops.secrets.nick-password = {

View File

@@ -1,36 +1,35 @@
{ autologin ? false }: { config, lib, ... }:
{
autologin ? false,
}:
{ config, lib, ... }:
let
user = config.users.users.nick;
in
{
imports = [
./nogui.nix
(import ../configs/theme { inherit user; })
(import ../configs/matugen { inherit user; })
(import ../configs/firefox { inherit user; })
(import ../configs/hyprland { inherit user; })
(import ../configs/hyprshot { inherit user; })
(import ../configs/cliphist { inherit user; })
(import ../configs/ags { inherit user; })
(import ../configs/wev { inherit user; })
(import ../configs/networkmanager { inherit user; })
(import ../configs/bluetooth { inherit user; })
(import ../configs/blueman { inherit user; })
(import ../configs/cbatticon { inherit user; })
(import ../configs/syncthing { inherit user; })
(import ../configs/brightnessctl { inherit user; })
(import ../configs/pavucontrol { inherit user; })
(import ../configs/pipewire { inherit user; })
(import ../configs/playerctl { inherit user; })
(import ../configs/rofi { inherit user; })
(import ../configs/swww { inherit user; })
(import ../configs/kitty { inherit user; })
(import ../configs/gtk { inherit user; })
(import ../configs/qt { inherit user; })
(import ../configs/x11 { inherit user; })
(import ../configs/vscode { inherit user; })
(import ../configs/qalculate { inherit user; })
./console.nix
(import ../configs/gui/ags { inherit user; })
(import ../configs/gui/bluetooth { inherit user; })
(import ../configs/gui/brightnessctl { inherit user; })
(import ../configs/gui/btop { inherit user; })
# (import ../configs/gui/cbatticon { inherit user; })
(import ../configs/gui/cliphist { inherit user; })
(import ../configs/gui/firefox { inherit user; })
(import ../configs/gui/gtk { inherit user; })
(import ../configs/gui/hyprland { inherit user; })
(import ../configs/gui/hyprshot { inherit user; })
(import ../configs/gui/kitty { inherit user; })
(import ../configs/gui/matugen { inherit user; })
(import ../configs/gui/networking { inherit user; })
(import ../configs/gui/pipewire { inherit user; })
(import ../configs/gui/qalculate { inherit user; })
(import ../configs/gui/qt { inherit user; })
(import ../configs/gui/rofi { inherit user; })
(import ../configs/gui/swww { inherit user; })
(import ../configs/gui/theme { inherit user; })
(import ../configs/gui/vscode { inherit user; })
(import ../configs/gui/wev { inherit user; })
(import ../configs/gui/x11 { inherit user; })
];
home-manager.users.nick = {