chore: refactor user modules
This commit is contained in:
parent
15a39660eb
commit
f396b3a8fb
12
flake.nix
12
flake.nix
@ -88,10 +88,9 @@
|
|||||||
pkgs = nixpkgs.legacyPackages.x86_64-linux;
|
pkgs = nixpkgs.legacyPackages.x86_64-linux;
|
||||||
extraSpecialArgs = {
|
extraSpecialArgs = {
|
||||||
inherit inputs outputs;
|
inherit inputs outputs;
|
||||||
home-conf = "minimal";
|
|
||||||
};
|
};
|
||||||
modules = [
|
modules = [
|
||||||
./users/phundrak/alys.nix
|
./users/phundrak/host/alys.nix
|
||||||
inputs.sops-nix.homeManagerModules.sops
|
inputs.sops-nix.homeManagerModules.sops
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
@ -99,10 +98,9 @@
|
|||||||
pkgs = nixpkgs.legacyPackages.x86_64-linux;
|
pkgs = nixpkgs.legacyPackages.x86_64-linux;
|
||||||
extraSpecialArgs = {
|
extraSpecialArgs = {
|
||||||
inherit inputs outputs;
|
inherit inputs outputs;
|
||||||
home-conf = "fullHome";
|
|
||||||
};
|
};
|
||||||
modules = [
|
modules = [
|
||||||
./users/phundrak/marpa.nix
|
./users/phundrak/host/marpa.nix
|
||||||
inputs.sops-nix.homeManagerModules.sops
|
inputs.sops-nix.homeManagerModules.sops
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
@ -110,10 +108,9 @@
|
|||||||
pkgs = nixpkgs.legacyPackages.x86_64-linux;
|
pkgs = nixpkgs.legacyPackages.x86_64-linux;
|
||||||
extraSpecialArgs = {
|
extraSpecialArgs = {
|
||||||
inherit inputs outputs;
|
inherit inputs outputs;
|
||||||
home-conf = "fullHome";
|
|
||||||
};
|
};
|
||||||
modules = [
|
modules = [
|
||||||
./users/phundrak/gampo.nix
|
./users/phundrak/host/gampo.nix
|
||||||
inputs.sops-nix.homeManagerModules.sops
|
inputs.sops-nix.homeManagerModules.sops
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
@ -121,10 +118,9 @@
|
|||||||
pkgs = nixpkgs.legacyPackages.x86_64-linux;
|
pkgs = nixpkgs.legacyPackages.x86_64-linux;
|
||||||
extraSpecialArgs = {
|
extraSpecialArgs = {
|
||||||
inherit inputs outputs;
|
inherit inputs outputs;
|
||||||
home-conf = "minimal";
|
|
||||||
};
|
};
|
||||||
modules = [
|
modules = [
|
||||||
./users/phundrak/tilo.nix
|
./users/phundrak/host/tilo.nix
|
||||||
inputs.sops-nix.homeManagerModules.sops
|
inputs.sops-nix.homeManagerModules.sops
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
@ -23,7 +23,7 @@ in {
|
|||||||
description = "Lucien Cartier-Tilet";
|
description = "Lucien Cartier-Tilet";
|
||||||
extraGroups = ["networkmanager" "wheel" "docker" "dialout" "podman"];
|
extraGroups = ["networkmanager" "wheel" "docker" "dialout" "podman"];
|
||||||
shell = pkgs.zsh;
|
shell = pkgs.zsh;
|
||||||
openssh.authorizedKeys.keyFiles = lib.filesystem.listFilesRecursive ./keys;
|
openssh.authorizedKeys.keyFiles = lib.filesystem.listFilesRecursive ../../keys;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
programs.zsh.enable = true;
|
programs.zsh.enable = true;
|
||||||
|
@ -5,9 +5,9 @@
|
|||||||
...
|
...
|
||||||
}:
|
}:
|
||||||
with lib; let
|
with lib; let
|
||||||
cfg = config.modules.bat;
|
cfg = config.home.cli.bat;
|
||||||
in {
|
in {
|
||||||
options.modules.bat.extras = mkEnableOption "Enables extra packages for bat.";
|
options.home.cli.bat.extras = mkEnableOption "Enables extra packages for bat.";
|
||||||
config.programs.bat = {
|
config.programs.bat = {
|
||||||
enable = true;
|
enable = true;
|
||||||
config = {
|
config = {
|
29
users/modules/cli/default.nix
Normal file
29
users/modules/cli/default.nix
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
{
|
||||||
|
config,
|
||||||
|
lib,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
with lib; let
|
||||||
|
cfg = config.home.cli;
|
||||||
|
in {
|
||||||
|
imports = [
|
||||||
|
./bat.nix
|
||||||
|
./btop.nix
|
||||||
|
./direnv.nix
|
||||||
|
./eza.nix
|
||||||
|
./mu.nix
|
||||||
|
./nh.nix
|
||||||
|
./nix-index.nix
|
||||||
|
./scripts
|
||||||
|
./tealdeer.nix
|
||||||
|
./yt-dlp.nix
|
||||||
|
];
|
||||||
|
|
||||||
|
options.home.cli.fullDesktop = mkEnableOption "Enable all optional modules and options";
|
||||||
|
config.home.cli = {
|
||||||
|
bat.extras = mkDefault cfg.fullDesktop;
|
||||||
|
mu.enable = mkDefault cfg.fullDesktop;
|
||||||
|
scripts.enable = mkDefault cfg.fullDesktop;
|
||||||
|
yt-dlp.enable = mkDefault cfg.fullDesktop;
|
||||||
|
};
|
||||||
|
}
|
11
users/modules/cli/mu.nix
Normal file
11
users/modules/cli/mu.nix
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
{
|
||||||
|
config,
|
||||||
|
lib,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
with lib; let
|
||||||
|
cfg = config.home.cli.mu;
|
||||||
|
in {
|
||||||
|
options.home.cli.mu.enable = mkEnableOption "Enable mu";
|
||||||
|
config.programs.mu.enable = cfg.enable;
|
||||||
|
}
|
@ -4,9 +4,9 @@
|
|||||||
...
|
...
|
||||||
}:
|
}:
|
||||||
with lib; let
|
with lib; let
|
||||||
cfg = config.modules.nh;
|
cfg = config.home.cli.nh;
|
||||||
in {
|
in {
|
||||||
options.modules.nh.flake = mkOption {
|
options.home.cli.nh.flake = mkOption {
|
||||||
type = types.path;
|
type = types.path;
|
||||||
default = "/home/phundrak/.dotfiles";
|
default = "/home/phundrak/.dotfiles";
|
||||||
example = "/etc/nixos";
|
example = "/etc/nixos";
|
10
users/modules/cli/nix-index.nix
Normal file
10
users/modules/cli/nix-index.nix
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
{inputs, ...}: {
|
||||||
|
imports = [
|
||||||
|
inputs.nix-index-database.homeModules.nix-index
|
||||||
|
];
|
||||||
|
|
||||||
|
programs = {
|
||||||
|
nix-index.enable = true;
|
||||||
|
nix-index-database.comma.enable = true;
|
||||||
|
};
|
||||||
|
}
|
15
users/modules/cli/scripts/default.nix
Normal file
15
users/modules/cli/scripts/default.nix
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
{
|
||||||
|
pkgs,
|
||||||
|
lib,
|
||||||
|
config,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
with lib; let
|
||||||
|
cfg = config.home.cli.scripts;
|
||||||
|
files = filesystem.listFilesRecursive ./.;
|
||||||
|
scriptFiles = builtins.filter (path: baseNameOf path != "default.nix") files;
|
||||||
|
scripts = map (file: (import file {inherit pkgs config;})) scriptFiles;
|
||||||
|
in {
|
||||||
|
options.home.cli.scripts.enable = mkEnableOption "Add custom scripts to PATH";
|
||||||
|
config.home.packages = mkIf cfg.enable scripts;
|
||||||
|
}
|
@ -1,10 +1,10 @@
|
|||||||
{
|
{
|
||||||
pkgs,
|
pkgs,
|
||||||
emacsPackage,
|
config,
|
||||||
...
|
...
|
||||||
}:
|
}:
|
||||||
pkgs.writeShellScriptBin "launch-with-emacsclient" ''
|
pkgs.writeShellScriptBin "launch-with-emacsclient" ''
|
||||||
filename="$1"
|
filename="$1"
|
||||||
line="$2"
|
line="$2"
|
||||||
column="$3"
|
column="$3"
|
||||||
${emacsPackage}/bin/emacsclient +$line:$column "$filename"''
|
${config.home.dev.editors.emacs.package}/bin/emacsclient +$line:$column "$filename"''
|
18
users/modules/cli/yt-dlp.nix
Normal file
18
users/modules/cli/yt-dlp.nix
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
{
|
||||||
|
lib,
|
||||||
|
config,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
with lib; let
|
||||||
|
cfg = config.home.cli.yt-dlp;
|
||||||
|
in {
|
||||||
|
options.home.cli.yt-dlp.enable = mkEnableOption "Enable yt-dlp";
|
||||||
|
config.programs.yt-dlp = mkIf cfg.enable {
|
||||||
|
inherit (cfg) enable;
|
||||||
|
settings = {
|
||||||
|
embed-thumbnail = true;
|
||||||
|
embed-subs = true;
|
||||||
|
sub-langs = "all";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
@ -1,17 +1,29 @@
|
|||||||
{
|
{
|
||||||
|
config,
|
||||||
|
lib,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
with lib; let
|
||||||
|
cfg = config.home;
|
||||||
|
in {
|
||||||
imports = [
|
imports = [
|
||||||
./basics.nix
|
./basics.nix
|
||||||
./bat.nix
|
./cli
|
||||||
./btop.nix
|
./desktop
|
||||||
./direnv.nix
|
./dev
|
||||||
./eza.nix
|
./media
|
||||||
./gpg.nix
|
./services
|
||||||
./mopidy.nix
|
./security
|
||||||
./nh.nix
|
|
||||||
./nix-index.nix
|
|
||||||
./shell
|
./shell
|
||||||
./ssh.nix
|
|
||||||
./tealdeer.nix
|
|
||||||
./vcs
|
|
||||||
];
|
];
|
||||||
|
|
||||||
|
options.home.fullDesktop = mkEnableOption "Enable most modules";
|
||||||
|
config.home = {
|
||||||
|
cli.fullDesktop = mkDefault cfg.fullDesktop;
|
||||||
|
desktop.fullDesktop = mkDefault cfg.fullDesktop;
|
||||||
|
dev.fullDesktop = mkDefault cfg.fullDesktop;
|
||||||
|
media.fullDesktop = mkDefault cfg.fullDesktop;
|
||||||
|
security.fullDesktop = mkDefault cfg.fullDesktop;
|
||||||
|
services.fullDesktop = mkDefault cfg.fullDesktop;
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
32
users/modules/desktop/default.nix
Normal file
32
users/modules/desktop/default.nix
Normal file
@ -0,0 +1,32 @@
|
|||||||
|
{
|
||||||
|
lib,
|
||||||
|
config,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
with lib; let
|
||||||
|
cfg = config.home.desktop;
|
||||||
|
in {
|
||||||
|
imports = [
|
||||||
|
./emoji.nix
|
||||||
|
./eww.nix
|
||||||
|
./hyprland.nix
|
||||||
|
./kdeconnect.nix
|
||||||
|
./kitty.nix
|
||||||
|
./obs.nix
|
||||||
|
./qt.nix
|
||||||
|
./swaync.nix
|
||||||
|
./waybar.nix
|
||||||
|
./wlsunset.nix
|
||||||
|
./wofi.nix
|
||||||
|
];
|
||||||
|
|
||||||
|
options.home.desktop.fullDesktop = mkEnableOption "Enable options for graphical environments";
|
||||||
|
config.home.desktop = {
|
||||||
|
eww.enable = mkDefault cfg.fullDesktop;
|
||||||
|
hyprland.enable = mkDefault cfg.fullDesktop;
|
||||||
|
kdeconnect.enable = mkDefault cfg.fullDesktop;
|
||||||
|
kitty.enable = mkDefault cfg.fullDesktop;
|
||||||
|
obs.enable = mkDefault cfg.fullDesktop;
|
||||||
|
qt.enable = mkDefault cfg.fullDesktop;
|
||||||
|
};
|
||||||
|
}
|
14
users/modules/desktop/eww.nix
Normal file
14
users/modules/desktop/eww.nix
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
{
|
||||||
|
lib,
|
||||||
|
config,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
with lib; let
|
||||||
|
cfg = config.home.desktop.eww;
|
||||||
|
in {
|
||||||
|
options.home.desktop.eww.enable = mkEnableOption "Enable eww support";
|
||||||
|
config.programs.eww = mkIf cfg.enable {
|
||||||
|
inherit (cfg) enable;
|
||||||
|
configDir = ./eww-config;
|
||||||
|
};
|
||||||
|
}
|
@ -5,8 +5,9 @@
|
|||||||
...
|
...
|
||||||
}:
|
}:
|
||||||
with lib; let
|
with lib; let
|
||||||
cfg = config.modules.hyprland;
|
cfg = config.home.desktop.hyprland;
|
||||||
rofi-emoji = import ../scripts/rofi-emoji.nix {inherit pkgs;};
|
rofi-emoji = import ../cli/scripts/rofi-emoji.nix {inherit pkgs;};
|
||||||
|
laptops = ["gampo"];
|
||||||
in {
|
in {
|
||||||
imports = [
|
imports = [
|
||||||
./swaync.nix
|
./swaync.nix
|
||||||
@ -14,33 +15,34 @@ in {
|
|||||||
./wlsunset.nix
|
./wlsunset.nix
|
||||||
];
|
];
|
||||||
|
|
||||||
options.modules.hyprland = {
|
options.home.desktop.hyprland = {
|
||||||
enable = mkEnableOption "Enables Hyprland";
|
enable = mkEnableOption "Enables Hyprland";
|
||||||
swaync = mkEnableOption "Enables swaync";
|
|
||||||
emacsPkg = mkOption {
|
emacsPkg = mkOption {
|
||||||
type = types.package;
|
type = types.package;
|
||||||
default = pkgs.emacs;
|
default = config.home.dev.editors.emacs.package or pkgs.emacs;
|
||||||
|
# default = pkgs.emacs;
|
||||||
|
example = pkgs.emacs;
|
||||||
};
|
};
|
||||||
host = mkOption {
|
host = mkOption {
|
||||||
type = types.enum ["tilo" "gampo"];
|
type = types.enum ["gampo" "marpa"];
|
||||||
default = "tilo";
|
|
||||||
description = ''
|
description = ''
|
||||||
Which host is Hyprland running on.
|
Which host is Hyprland running on.
|
||||||
|
|
||||||
This helps determine the monitors layout.
|
This helps determine the monitors layout and enable battery support in waybar.
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
waybar = {
|
|
||||||
enable = mkEnableOption "Enables waybar.";
|
|
||||||
battery = mkEnableOption "Enables battery support.";
|
|
||||||
style = mkOption {
|
|
||||||
type = types.path;
|
|
||||||
example = ./style.css;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
|
|
||||||
config = mkIf cfg.enable {
|
config = mkIf cfg.enable {
|
||||||
|
home.desktop = {
|
||||||
|
swaync.enable = mkDefault true;
|
||||||
|
waybar = {
|
||||||
|
enable = mkDefault true;
|
||||||
|
battery = mkDefault (builtins.elem cfg.host laptops);
|
||||||
|
};
|
||||||
|
wlsunset.enable = mkDefault true;
|
||||||
|
wofi.enable = mkDefault true;
|
||||||
|
};
|
||||||
wayland.windowManager.hyprland = {
|
wayland.windowManager.hyprland = {
|
||||||
enable = true;
|
enable = true;
|
||||||
xwayland.enable = true;
|
xwayland.enable = true;
|
||||||
@ -58,7 +60,7 @@ in {
|
|||||||
};
|
};
|
||||||
monitor =
|
monitor =
|
||||||
{
|
{
|
||||||
"tilo" = [
|
"marpa" = [
|
||||||
"DP-1, 3440x1440@144, 1080x550, 1"
|
"DP-1, 3440x1440@144, 1080x550, 1"
|
||||||
"DP-2, 2560x1080@60, 0x0, 1, transform, 1"
|
"DP-2, 2560x1080@60, 0x0, 1, transform, 1"
|
||||||
];
|
];
|
||||||
@ -286,12 +288,5 @@ in {
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
modules = {
|
|
||||||
swaync.enable = cfg.swaync;
|
|
||||||
waybar = mkIf cfg.waybar.enable {
|
|
||||||
inherit (cfg.waybar) enable battery style;
|
|
||||||
};
|
|
||||||
wlsunset.enable = true;
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
}
|
}
|
14
users/modules/desktop/kdeconnect.nix
Normal file
14
users/modules/desktop/kdeconnect.nix
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
{
|
||||||
|
lib,
|
||||||
|
config,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
with lib; let
|
||||||
|
cfg = config.home.desktop.kdeconnect;
|
||||||
|
in {
|
||||||
|
options.home.desktop.kdeconnect.enable = mkEnableOption "Enable KDE Connect";
|
||||||
|
config.services.kdeconnect = mkIf cfg.enable {
|
||||||
|
enable = true;
|
||||||
|
indicator = true;
|
||||||
|
};
|
||||||
|
}
|
@ -1,6 +1,15 @@
|
|||||||
{pkgs, ...}: {
|
{
|
||||||
programs.kitty = {
|
pkgs,
|
||||||
enable = true;
|
config,
|
||||||
|
lib,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
with lib; let
|
||||||
|
cfg = config.home.desktop.kitty;
|
||||||
|
in {
|
||||||
|
options.home.desktop.kitty.enable = mkEnableOption "Enable kitty terminal";
|
||||||
|
config.programs.kitty = mkIf cfg.enable {
|
||||||
|
inherit (cfg) enable;
|
||||||
themeFile = "Nord";
|
themeFile = "Nord";
|
||||||
font = {
|
font = {
|
||||||
package = pkgs.cascadia-code;
|
package = pkgs.cascadia-code;
|
23
users/modules/desktop/obs.nix
Normal file
23
users/modules/desktop/obs.nix
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
{
|
||||||
|
config,
|
||||||
|
lib,
|
||||||
|
pkgs,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
with lib; let
|
||||||
|
cfg = config.home.desktop.obs;
|
||||||
|
in {
|
||||||
|
options.home.desktop.obs.enable = mkEnableOption "Enables OBS Studio";
|
||||||
|
config.programs.obs-studio = mkIf cfg.enable {
|
||||||
|
inherit (cfg) enable;
|
||||||
|
plugins = with pkgs.obs-studio-plugins; [
|
||||||
|
input-overlay
|
||||||
|
obs-backgroundremoval
|
||||||
|
obs-mute-filter
|
||||||
|
obs-pipewire-audio-capture
|
||||||
|
obs-source-clone
|
||||||
|
obs-source-record
|
||||||
|
obs-tuna
|
||||||
|
];
|
||||||
|
};
|
||||||
|
}
|
11
users/modules/desktop/qt.nix
Normal file
11
users/modules/desktop/qt.nix
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
{
|
||||||
|
lib,
|
||||||
|
config,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
with lib; let
|
||||||
|
cfg = config.home.desktop.qt;
|
||||||
|
in {
|
||||||
|
options.home.desktop.qt.enable = mkEnableOption "Enable Qt support";
|
||||||
|
config.qt.enable = cfg.enable;
|
||||||
|
}
|
@ -5,12 +5,9 @@
|
|||||||
...
|
...
|
||||||
}:
|
}:
|
||||||
with lib; let
|
with lib; let
|
||||||
cfg = config.modules.swaync;
|
cfg = config.home.desktop.swaync;
|
||||||
in {
|
in {
|
||||||
options.modules.swaync = {
|
options.home.desktop.swaync.enable = mkEnableOption "Enables swaync";
|
||||||
enable = mkEnableOption "Enables swaync";
|
|
||||||
};
|
|
||||||
|
|
||||||
config = mkIf cfg.enable {
|
config = mkIf cfg.enable {
|
||||||
services.swaync.enable = true;
|
services.swaync.enable = true;
|
||||||
home.packages = [pkgs.swaynotificationcenter];
|
home.packages = [pkgs.swaynotificationcenter];
|
@ -4,9 +4,9 @@
|
|||||||
...
|
...
|
||||||
}:
|
}:
|
||||||
with lib; let
|
with lib; let
|
||||||
cfg = config.modules.waybar;
|
cfg = config.home.desktop.waybar;
|
||||||
in {
|
in {
|
||||||
options.modules.waybar = {
|
options.home.desktop.waybar = {
|
||||||
enable = mkEnableOption "Enables waybar.";
|
enable = mkEnableOption "Enables waybar.";
|
||||||
battery = mkEnableOption "Enables battery support.";
|
battery = mkEnableOption "Enables battery support.";
|
||||||
style = mkOption {
|
style = mkOption {
|
@ -4,9 +4,9 @@
|
|||||||
...
|
...
|
||||||
}:
|
}:
|
||||||
with lib; let
|
with lib; let
|
||||||
cfg = config.modules.wlsunset;
|
cfg = config.home.desktop.wlsunset;
|
||||||
in {
|
in {
|
||||||
options.modules.wlsunset = {
|
options.home.desktop.wlsunset = {
|
||||||
enable = mkEnableOption "Enables wlsunset";
|
enable = mkEnableOption "Enables wlsunset";
|
||||||
latitude = mkOption {
|
latitude = mkOption {
|
||||||
type = with types; nullOr (oneOf [str ints.unsigned float]);
|
type = with types; nullOr (oneOf [str ints.unsigned float]);
|
@ -1,10 +1,18 @@
|
|||||||
{
|
{
|
||||||
programs.wofi = {
|
lib,
|
||||||
enable = true;
|
config,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
with lib; let
|
||||||
|
cfg = config.home.desktop.wofi;
|
||||||
|
in {
|
||||||
|
options.home.desktop.wofi.enable = mkEnableOption "Enable wofi support";
|
||||||
|
config.programs.wofi = mkIf cfg.enable {
|
||||||
|
inherit (cfg) enable;
|
||||||
settings = {
|
settings = {
|
||||||
modi = "ssh,drun,combi";
|
modi = "ssh,drun,combi";
|
||||||
sidebar-mode = false;
|
sidebar-mode = false;
|
||||||
width = 30;
|
width = 50;
|
||||||
line-margin = 10;
|
line-margin = 10;
|
||||||
lines = 6;
|
lines = 6;
|
||||||
columns = 2;
|
columns = 2;
|
20
users/modules/dev/default.nix
Normal file
20
users/modules/dev/default.nix
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
{
|
||||||
|
config,
|
||||||
|
lib,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
with lib; let
|
||||||
|
cfg = config.home.dev;
|
||||||
|
in {
|
||||||
|
imports = [
|
||||||
|
./editors
|
||||||
|
./ollama.nix
|
||||||
|
./vcs
|
||||||
|
];
|
||||||
|
|
||||||
|
options.home.dev.fullDesktop = mkEnableOption "Enables everything except AI";
|
||||||
|
config.home.dev = {
|
||||||
|
vcs.fullDesktop = mkDefault cfg.fullDesktop;
|
||||||
|
editors.fullDesktop = mkDefault cfg.fullDesktop;
|
||||||
|
};
|
||||||
|
}
|
20
users/modules/dev/editors/default.nix
Normal file
20
users/modules/dev/editors/default.nix
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
{
|
||||||
|
config,
|
||||||
|
lib,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
with lib; let
|
||||||
|
cfg = config.home.dev.editors;
|
||||||
|
in {
|
||||||
|
imports = [
|
||||||
|
./emacs.nix
|
||||||
|
];
|
||||||
|
|
||||||
|
options.home.dev.editors.fullDesktop = mkEnableOption "Enable all editors";
|
||||||
|
config.home.dev.editors.emacs = {
|
||||||
|
enable = mkDefault cfg.fullDesktop;
|
||||||
|
service = mkDefault cfg.fullDesktop;
|
||||||
|
mu4eMime = mkDefault cfg.fullDesktop;
|
||||||
|
org-protocol = mkDefault cfg.fullDesktop;
|
||||||
|
};
|
||||||
|
}
|
@ -11,9 +11,9 @@ with lib; let
|
|||||||
epkgs.pdf-tools
|
epkgs.pdf-tools
|
||||||
]
|
]
|
||||||
));
|
));
|
||||||
cfg = config.modules.emacs;
|
cfg = config.home.dev.editors.emacs;
|
||||||
in {
|
in {
|
||||||
options.modules.emacs = {
|
options.home.dev.editors.emacs = {
|
||||||
enable = mkEnableOption "enables Emacs";
|
enable = mkEnableOption "enables Emacs";
|
||||||
package = mkOption {
|
package = mkOption {
|
||||||
type = types.package;
|
type = types.package;
|
||||||
@ -25,6 +25,7 @@ in {
|
|||||||
};
|
};
|
||||||
|
|
||||||
config = {
|
config = {
|
||||||
|
home.packages = [pkgs.emacs-all-the-icons-fonts];
|
||||||
programs.emacs = mkIf cfg.enable {
|
programs.emacs = mkIf cfg.enable {
|
||||||
enable = true;
|
enable = true;
|
||||||
inherit (cfg) package;
|
inherit (cfg) package;
|
@ -4,9 +4,9 @@
|
|||||||
...
|
...
|
||||||
}:
|
}:
|
||||||
with lib; let
|
with lib; let
|
||||||
cfg = config.modules.ollama;
|
cfg = config.home.dev.ollama;
|
||||||
in {
|
in {
|
||||||
options.modules.ollama = {
|
options.home.dev.ollama = {
|
||||||
enable = mkEnableOption "Enables Ollama";
|
enable = mkEnableOption "Enables Ollama";
|
||||||
gpu = mkOption {
|
gpu = mkOption {
|
||||||
type = types.nullOr types.enum ["none" "amd" "nvidia"];
|
type = types.nullOr types.enum ["none" "amd" "nvidia"];
|
53
users/modules/dev/vcs/default.nix
Normal file
53
users/modules/dev/vcs/default.nix
Normal file
@ -0,0 +1,53 @@
|
|||||||
|
{
|
||||||
|
config,
|
||||||
|
lib,
|
||||||
|
pkgs,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
with lib; let
|
||||||
|
cfg = config.home.dev.vcs;
|
||||||
|
in {
|
||||||
|
imports = [./git.nix ./jujutsu.nix];
|
||||||
|
|
||||||
|
options.home.dev.vcs = {
|
||||||
|
fullDesktop = mkEnableOption "Enable all optional values";
|
||||||
|
name = mkOption {
|
||||||
|
type = types.str;
|
||||||
|
default = "Lucien Cartier-Tilet";
|
||||||
|
};
|
||||||
|
email = mkOption {
|
||||||
|
type = types.str;
|
||||||
|
default = "lucien@phundrak.com";
|
||||||
|
};
|
||||||
|
editor = mkOption {
|
||||||
|
type = types.str;
|
||||||
|
default = "${pkgs.emacs}/bin/emacsclient -c -a ${pkgs.emacs}/bin/emacs";
|
||||||
|
};
|
||||||
|
publicKey = {
|
||||||
|
content = mkOption {
|
||||||
|
type = types.nullOr types.str;
|
||||||
|
example = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIGj+J6N6SO+4P8dOZqfR1oiay2yxhhHnagH52avUqw5h";
|
||||||
|
default = null;
|
||||||
|
};
|
||||||
|
file = mkOption {
|
||||||
|
type = with types; nullOr path;
|
||||||
|
default = "/home/phundrak/.ssh/id_ed25519.pub";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
config.home.dev.vcs = {
|
||||||
|
git = {
|
||||||
|
enable = mkDefault true;
|
||||||
|
inherit (cfg) name email editor;
|
||||||
|
publicKeyFile = cfg.publicKey.file;
|
||||||
|
cliff = mkDefault cfg.fullDesktop;
|
||||||
|
completeConfig = mkDefault cfg.fullDesktop;
|
||||||
|
};
|
||||||
|
jj = {
|
||||||
|
enable = mkDefault true;
|
||||||
|
inherit (cfg) name email editor;
|
||||||
|
signing.sshKey = mkDefault (cfg.publicKey.file or cfg.publicKey.content);
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
@ -5,9 +5,9 @@
|
|||||||
...
|
...
|
||||||
}:
|
}:
|
||||||
with lib; let
|
with lib; let
|
||||||
cfg = config.modules.git;
|
cfg = config.home.dev.vcs.git;
|
||||||
in {
|
in {
|
||||||
options.modules.git = {
|
options.home.dev.vcs.git = {
|
||||||
enable = mkEnableOption "enables git";
|
enable = mkEnableOption "enables git";
|
||||||
email = mkOption {
|
email = mkOption {
|
||||||
type = types.str;
|
type = types.str;
|
||||||
@ -57,7 +57,11 @@ in {
|
|||||||
};
|
};
|
||||||
completeConfig = mkEnableOption "Complete configuration for workstations";
|
completeConfig = mkEnableOption "Complete configuration for workstations";
|
||||||
emacs = {
|
emacs = {
|
||||||
integration = mkEnableOption "enables Emacs integration";
|
integration = mkOption {
|
||||||
|
description = "enables Emacs integration";
|
||||||
|
type = types.bool;
|
||||||
|
default = config.home.dev.editors.emacs.enable;
|
||||||
|
};
|
||||||
pkg = mkOption {
|
pkg = mkOption {
|
||||||
type = types.package;
|
type = types.package;
|
||||||
default = pkgs.emacs;
|
default = pkgs.emacs;
|
||||||
@ -111,7 +115,7 @@ in {
|
|||||||
};
|
};
|
||||||
commit.gpgsign = cfg.publicKeyFile != null;
|
commit.gpgsign = cfg.publicKeyFile != null;
|
||||||
gpg.format = "ssh";
|
gpg.format = "ssh";
|
||||||
gpg.ssh.allowedSignersFile = (mkIf (cfg.publicKeyFile != null)) "~/.ssh/allowed_signers";
|
gpg.ssh.allowedSignersFile = "${config.home.homeDirectory}/.ssh/allowed_signers";
|
||||||
init.defaultBranch = "main";
|
init.defaultBranch = "main";
|
||||||
pull.rebase = true;
|
pull.rebase = true;
|
||||||
push = {
|
push = {
|
@ -5,9 +5,9 @@
|
|||||||
...
|
...
|
||||||
}:
|
}:
|
||||||
with lib; let
|
with lib; let
|
||||||
cfg = config.modules.jj;
|
cfg = config.home.dev.vcs.jj;
|
||||||
in {
|
in {
|
||||||
options.modules.jj = {
|
options.home.dev.vcs.jj = {
|
||||||
enable = mkEnableOption "enables jj";
|
enable = mkEnableOption "enables jj";
|
||||||
name = mkOption {
|
name = mkOption {
|
||||||
type = types.str;
|
type = types.str;
|
||||||
@ -19,7 +19,10 @@ in {
|
|||||||
};
|
};
|
||||||
editor = mkOption {
|
editor = mkOption {
|
||||||
type = types.str;
|
type = types.str;
|
||||||
default = "${pkgs.emacs}/bin/emacsclient -c -a ${pkgs.emacs}/bin/emacs";
|
default =
|
||||||
|
if config.home.dev.editors.emacs.enable
|
||||||
|
then "${pkgs.emacs}/bin/emacsclient -c -a ${pkgs.emacs}/bin/emacs"
|
||||||
|
else "${pkgs.nano}/bin/nano";
|
||||||
};
|
};
|
||||||
signing = {
|
signing = {
|
||||||
enable = mkEnableOption "enables signing jj commits";
|
enable = mkEnableOption "enables signing jj commits";
|
@ -1,6 +0,0 @@
|
|||||||
{
|
|
||||||
programs.eww = {
|
|
||||||
enable = true;
|
|
||||||
configDir = ./eww-config;
|
|
||||||
};
|
|
||||||
}
|
|
@ -1,3 +0,0 @@
|
|||||||
{
|
|
||||||
services.flatpak.enable = true;
|
|
||||||
}
|
|
@ -1,12 +0,0 @@
|
|||||||
{pkgs, ...}: {
|
|
||||||
programs.gpg = {
|
|
||||||
enable = true;
|
|
||||||
mutableKeys = true;
|
|
||||||
mutableTrust = true;
|
|
||||||
};
|
|
||||||
services.gpg-agent = {
|
|
||||||
enable = true;
|
|
||||||
enableSshSupport = true;
|
|
||||||
pinentry.package = pkgs.pinentry-emacs;
|
|
||||||
};
|
|
||||||
}
|
|
@ -1,6 +0,0 @@
|
|||||||
{
|
|
||||||
services.kdeconnect = {
|
|
||||||
enable = true;
|
|
||||||
indicator = true;
|
|
||||||
};
|
|
||||||
}
|
|
22
users/modules/media/default.nix
Normal file
22
users/modules/media/default.nix
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
{
|
||||||
|
config,
|
||||||
|
lib,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
with lib; let
|
||||||
|
cfg = config.home.media;
|
||||||
|
in {
|
||||||
|
imports = [
|
||||||
|
./mopidy.nix
|
||||||
|
./mpd.nix
|
||||||
|
./mpd-mpris.nix
|
||||||
|
./mpv.nix
|
||||||
|
];
|
||||||
|
|
||||||
|
options.home.media.fullDesktop = mkEnableOption "Enables everything";
|
||||||
|
config.home.media = {
|
||||||
|
mopidy.enable = mkDefault cfg.fullDesktop;
|
||||||
|
mpd.enable = mkDefault (cfg.fullDesktop or cfg.mpd-mpris.enable);
|
||||||
|
mpv.enable = mkDefault cfg.fullDesktop;
|
||||||
|
};
|
||||||
|
}
|
@ -5,9 +5,9 @@
|
|||||||
...
|
...
|
||||||
}:
|
}:
|
||||||
with lib; let
|
with lib; let
|
||||||
cfg = config.modules.mopidy;
|
cfg = config.home.media.mopidy;
|
||||||
in {
|
in {
|
||||||
options.modules.mopidy = {
|
options.home.media.mopidy = {
|
||||||
enable = mkEnableOption "Enables Mopidy.";
|
enable = mkEnableOption "Enables Mopidy.";
|
||||||
};
|
};
|
||||||
|
|
16
users/modules/media/mpd-mpris.nix
Normal file
16
users/modules/media/mpd-mpris.nix
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
{
|
||||||
|
config,
|
||||||
|
lib,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
with lib; let
|
||||||
|
cfg = config.home.media.mpd-mpris;
|
||||||
|
cfgMpd = config.home.media.mpd;
|
||||||
|
in {
|
||||||
|
options.home.media.mpd-mpris.enable = mkOption {
|
||||||
|
type = types.bool;
|
||||||
|
default = cfgMpd.enable;
|
||||||
|
example = false;
|
||||||
|
};
|
||||||
|
config.services.mpd-mpris.enable = cfg.enable;
|
||||||
|
}
|
30
users/modules/media/mpd.nix
Normal file
30
users/modules/media/mpd.nix
Normal file
@ -0,0 +1,30 @@
|
|||||||
|
{
|
||||||
|
lib,
|
||||||
|
config,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
with lib; let
|
||||||
|
cfg = config.home.media.mpd;
|
||||||
|
in {
|
||||||
|
options.home.media.mpd.enable = mkEnableOption "Enables MPD";
|
||||||
|
config.services.mpd = mkIf cfg.enable {
|
||||||
|
inherit (cfg) enable;
|
||||||
|
musicDirectory = "${config.home.homeDirectory}/Music";
|
||||||
|
playlistDirectory = "${config.home.homeDirectory}/Music/playlists";
|
||||||
|
network.startWhenNeeded = true;
|
||||||
|
extraConfig = ''
|
||||||
|
follow_outside_symlinks "yes"
|
||||||
|
follow_inside_symlinks "yes"
|
||||||
|
|
||||||
|
bind_to_address "localhost"
|
||||||
|
auto_update "yes"
|
||||||
|
|
||||||
|
audio_output {
|
||||||
|
type "fifo"
|
||||||
|
name "my_fifo"
|
||||||
|
path "/tmp/mpd.fifo"
|
||||||
|
format "44100:16:2"
|
||||||
|
}
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
}
|
@ -1,6 +1,15 @@
|
|||||||
{pkgs, ...}: {
|
{
|
||||||
programs.mpv = {
|
pkgs,
|
||||||
enable = true;
|
lib,
|
||||||
|
config,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
with lib; let
|
||||||
|
cfg = config.home.media.mpv;
|
||||||
|
in {
|
||||||
|
options.home.media.mpv.enable = mkEnableOption "Enable MPV";
|
||||||
|
config.programs.mpv = mkIf cfg.enable {
|
||||||
|
inherit (cfg) enable;
|
||||||
config = {
|
config = {
|
||||||
force-window = "immediate";
|
force-window = "immediate";
|
||||||
force-seekable = true; # force streams to be seekable
|
force-seekable = true; # force streams to be seekable
|
||||||
@ -16,7 +25,7 @@
|
|||||||
screenshot-format = "png";
|
screenshot-format = "png";
|
||||||
screenshot-high-bit-depth = true;
|
screenshot-high-bit-depth = true;
|
||||||
screenshot-png-compression = 6;
|
screenshot-png-compression = 6;
|
||||||
screenshot-directory = "~/Pictures/Screenshots/mpv";
|
screenshot-directory = "${config.home.homeDirectory}/Pictures/Screenshots/mpv";
|
||||||
|
|
||||||
deband = true;
|
deband = true;
|
||||||
deband-iterations = 2;
|
deband-iterations = 2;
|
@ -1,21 +0,0 @@
|
|||||||
{
|
|
||||||
services.mpd = {
|
|
||||||
enable = true;
|
|
||||||
musicDirectory = "/home/phundrak/Music";
|
|
||||||
playlistDirectory = "/home/phundrak/Music/playlists";
|
|
||||||
extraConfig = ''
|
|
||||||
follow_outside_symlinks "yes"
|
|
||||||
follow_inside_symlinks "yes"
|
|
||||||
|
|
||||||
bind_to_address "localhost"
|
|
||||||
auto_update "yes"
|
|
||||||
|
|
||||||
audio_output {
|
|
||||||
type "fifo"
|
|
||||||
name "my_fifo"
|
|
||||||
path "/tmp/mpd.fifo"
|
|
||||||
format "44100:16:2"
|
|
||||||
}
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
}
|
|
@ -1,8 +0,0 @@
|
|||||||
{inputs, ...}: {
|
|
||||||
imports = [
|
|
||||||
inputs.nix-index-database.homeModules.nix-index
|
|
||||||
];
|
|
||||||
|
|
||||||
programs.nix-index.enable = true;
|
|
||||||
programs.nix-index-database.comma.enable = true;
|
|
||||||
}
|
|
@ -1,3 +0,0 @@
|
|||||||
{
|
|
||||||
qt.enable = true;
|
|
||||||
}
|
|
18
users/modules/security/default.nix
Normal file
18
users/modules/security/default.nix
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
{
|
||||||
|
config,
|
||||||
|
lib,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
with lib; let
|
||||||
|
cfg = config.home.security;
|
||||||
|
in {
|
||||||
|
imports = [
|
||||||
|
./gpg.nix
|
||||||
|
./ssh.nix
|
||||||
|
];
|
||||||
|
options.home.security.fullDesktop = mkEnableOption "Enable all modules";
|
||||||
|
config.home.security = {
|
||||||
|
gpg.enable = mkDefault cfg.fullDesktop;
|
||||||
|
ssh.enable = mkDefault cfg.fullDesktop;
|
||||||
|
};
|
||||||
|
}
|
32
users/modules/security/gpg.nix
Normal file
32
users/modules/security/gpg.nix
Normal file
@ -0,0 +1,32 @@
|
|||||||
|
{
|
||||||
|
pkgs,
|
||||||
|
lib,
|
||||||
|
config,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
with lib; let
|
||||||
|
cfg = config.home.security.gpg;
|
||||||
|
in {
|
||||||
|
options.home.security.gpg = {
|
||||||
|
enable = mkEnableOption "Enable GPG";
|
||||||
|
pinentry.package = mkOption {
|
||||||
|
type = types.package;
|
||||||
|
default =
|
||||||
|
if config.home.dev.editors.emacs.enable
|
||||||
|
then pkgs.pinentry-emacs
|
||||||
|
else pkgs.pinentry-gtk2;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
config = mkIf cfg.enable {
|
||||||
|
programs.gpg = {
|
||||||
|
inherit (cfg) enable;
|
||||||
|
mutableKeys = true;
|
||||||
|
mutableTrust = true;
|
||||||
|
};
|
||||||
|
services.gpg-agent = {
|
||||||
|
enable = true;
|
||||||
|
enableSshSupport = true;
|
||||||
|
pinentry.package = cfg.pinentry.package;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
@ -4,9 +4,9 @@
|
|||||||
...
|
...
|
||||||
}:
|
}:
|
||||||
with lib; let
|
with lib; let
|
||||||
cfg = config.modules.ssh;
|
cfg = config.home.security.ssh;
|
||||||
in {
|
in {
|
||||||
options.modules.ssh = {
|
options.home.security.ssh = {
|
||||||
enable = mkEnableOption "enables SSH";
|
enable = mkEnableOption "enables SSH";
|
||||||
hosts = mkOption {
|
hosts = mkOption {
|
||||||
type = types.nullOr types.path;
|
type = types.nullOr types.path;
|
||||||
@ -17,7 +17,7 @@ in {
|
|||||||
config = {
|
config = {
|
||||||
programs.ssh = mkIf cfg.enable {
|
programs.ssh = mkIf cfg.enable {
|
||||||
enable = true;
|
enable = true;
|
||||||
includes = mkIf (cfg.hosts != null) [cfg.hosts];
|
includes = lists.optional (cfg.hosts != null) cfg.hosts;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
11
users/modules/services/blanket.nix
Normal file
11
users/modules/services/blanket.nix
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
{
|
||||||
|
lib,
|
||||||
|
config,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
with lib; let
|
||||||
|
cfg = config.home.services.blanket;
|
||||||
|
in {
|
||||||
|
options.home.services.blanket.enable = mkEnableOption "Enable blanket";
|
||||||
|
config.services.blanket.enable = cfg.enable;
|
||||||
|
}
|
22
users/modules/services/default.nix
Normal file
22
users/modules/services/default.nix
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
{
|
||||||
|
config,
|
||||||
|
lib,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
with lib; let
|
||||||
|
cfg = config.home.services;
|
||||||
|
in {
|
||||||
|
imports = [
|
||||||
|
./blanket.nix
|
||||||
|
./mbsync.nix
|
||||||
|
./mpris-proxy.nix
|
||||||
|
./playerctld.nix
|
||||||
|
];
|
||||||
|
options.home.services.fullDesktop = mkEnableOption "Enable all modules";
|
||||||
|
config.home.services = {
|
||||||
|
blanket.enable = mkDefault cfg.fullDesktop;
|
||||||
|
mbsync.enable = mkDefault cfg.fullDesktop;
|
||||||
|
mpris-proxy.enable = mkDefault cfg.fullDesktop;
|
||||||
|
playerctld.enable = mkDefault cfg.fullDesktop;
|
||||||
|
};
|
||||||
|
}
|
@ -4,26 +4,14 @@
|
|||||||
...
|
...
|
||||||
}:
|
}:
|
||||||
with lib; let
|
with lib; let
|
||||||
cfg = config.modules.mbsync;
|
cfg = config.home.services.mbsync;
|
||||||
in {
|
in {
|
||||||
options.modules.mbsync = {
|
options.home.services.mbsync = {
|
||||||
enable = mkEnableOption "Enables mbsync";
|
enable = mkEnableOption "Enables mbsync";
|
||||||
passwordFile = mkOption {
|
|
||||||
type = types.str;
|
|
||||||
example = "/var/email/password";
|
|
||||||
};
|
|
||||||
service.enable = mkOption {
|
service.enable = mkOption {
|
||||||
type = types.bool;
|
type = types.bool;
|
||||||
default = true;
|
default = true;
|
||||||
};
|
};
|
||||||
host = mkOption {
|
|
||||||
type = types.str;
|
|
||||||
default = "mail.phundrak.com";
|
|
||||||
};
|
|
||||||
user = mkOption {
|
|
||||||
type = types.str;
|
|
||||||
default = "lucien@phundrak.com";
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
|
|
||||||
config = mkIf cfg.enable {
|
config = mkIf cfg.enable {
|
11
users/modules/services/mpris-proxy.nix
Normal file
11
users/modules/services/mpris-proxy.nix
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
{
|
||||||
|
config,
|
||||||
|
lib,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
with lib; let
|
||||||
|
cfg = config.home.services.mpris-proxy;
|
||||||
|
in {
|
||||||
|
options.home.services.mpris-proxy.enable = mkEnableOption "Enable MPRIS forwarding towards bluetooth and MIDI";
|
||||||
|
config.services.mpris-proxy.enable = cfg.enable;
|
||||||
|
}
|
11
users/modules/services/playerctld.nix
Normal file
11
users/modules/services/playerctld.nix
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
{
|
||||||
|
config,
|
||||||
|
lib,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
with lib; let
|
||||||
|
cfg = config.home.services.playerctld;
|
||||||
|
in {
|
||||||
|
options.home.services.playerctld.enable = mkEnableOption "Enable playerctld daemon";
|
||||||
|
config.services.playerctld.enable = cfg.enable;
|
||||||
|
}
|
@ -4,9 +4,9 @@
|
|||||||
...
|
...
|
||||||
}:
|
}:
|
||||||
with lib; let
|
with lib; let
|
||||||
cfg = config.modules.bash;
|
cfg = config.home.shell.bash;
|
||||||
in {
|
in {
|
||||||
options.modules.bash = {
|
options.home.shell.bash = {
|
||||||
enable = mkEnableOption "Enables bash";
|
enable = mkEnableOption "Enables bash";
|
||||||
aliases = mkOption {
|
aliases = mkOption {
|
||||||
type = types.attrsOf types.str;
|
type = types.attrsOf types.str;
|
||||||
|
@ -61,7 +61,7 @@ with lib; let
|
|||||||
please = "sudo -A";
|
please = "sudo -A";
|
||||||
wget = "wget --hsts-file=\"$XDG_DATA_HOME/wget-hsts\" -c";
|
wget = "wget --hsts-file=\"$XDG_DATA_HOME/wget-hsts\" -c";
|
||||||
};
|
};
|
||||||
cfg = config.modules.shell;
|
cfg = config.home.shell;
|
||||||
in {
|
in {
|
||||||
imports = [
|
imports = [
|
||||||
./bash.nix
|
./bash.nix
|
||||||
@ -69,73 +69,22 @@ in {
|
|||||||
./starship.nix
|
./starship.nix
|
||||||
./tmux.nix
|
./tmux.nix
|
||||||
./zsh.nix
|
./zsh.nix
|
||||||
|
./zoxide.nix
|
||||||
];
|
];
|
||||||
|
options.home.shell.fullDesktop = mkEnableOption "Enable all shells";
|
||||||
options.modules.shell = {
|
config.home.shell = {
|
||||||
eatIntegration = mkEnableOption "Enable Emacs Eat integration in Bash or Zsh";
|
enableShellIntegration = cfg.bash.enable or cfg.zsh.enable or cfg.fish.enable;
|
||||||
enableBash = mkOption {
|
bash = {
|
||||||
type = types.bool;
|
aliases = mkDefault aliases;
|
||||||
default = true;
|
enable = mkDefault cfg.fullDesktop;
|
||||||
description = "Enables bash";
|
|
||||||
};
|
};
|
||||||
enableFish = mkOption {
|
fish = {
|
||||||
type = types.bool;
|
abbrs = mkDefault aliases;
|
||||||
default = true;
|
enable = mkDefault cfg.fullDesktop;
|
||||||
description = "Enables fish";
|
|
||||||
};
|
};
|
||||||
enableZsh = mkOption {
|
zsh = {
|
||||||
type = types.bool;
|
abbrs = mkDefault aliases;
|
||||||
default = true;
|
enable = mkDefault cfg.fullDesktop;
|
||||||
description = "Enables zsh";
|
|
||||||
};
|
|
||||||
starship = {
|
|
||||||
enable = mkEnableOption "Enables the starship prompt.";
|
|
||||||
jjIntegration = mkEnableOption "Enables Jujutsu integration in starship.";
|
|
||||||
};
|
|
||||||
tmux.enable = mkEnableOption "Enables tmux";
|
|
||||||
zoxide = {
|
|
||||||
enable = mkOption {
|
|
||||||
type = types.bool;
|
|
||||||
default = true;
|
|
||||||
description = "enables zoxide";
|
|
||||||
};
|
|
||||||
replaceCd = mkOption {
|
|
||||||
type = types.bool;
|
|
||||||
default = true;
|
|
||||||
description = "makes zoxide replace cd";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
config = {
|
|
||||||
home.shell = {
|
|
||||||
enableFishIntegration = mkDefault cfg.enableFish;
|
|
||||||
enableBashIntegration = mkDefault cfg.enableBash;
|
|
||||||
enableZshIntegration = mkDefault cfg.enableZsh;
|
|
||||||
};
|
|
||||||
|
|
||||||
modules = {
|
|
||||||
fish = {
|
|
||||||
enable = mkDefault cfg.enableFish;
|
|
||||||
abbrs = mkDefault aliases;
|
|
||||||
};
|
|
||||||
bash = {
|
|
||||||
enable = mkDefault cfg.enableBash;
|
|
||||||
aliases = mkDefault aliases;
|
|
||||||
};
|
|
||||||
zsh = {
|
|
||||||
enable = mkDefault cfg.enableZsh;
|
|
||||||
abbrs = mkDefault aliases;
|
|
||||||
};
|
|
||||||
tmux.enable = cfg.tmux.enable;
|
|
||||||
inherit (cfg) starship;
|
|
||||||
};
|
|
||||||
|
|
||||||
programs.zoxide = mkIf cfg.zoxide.enable {
|
|
||||||
enable = true;
|
|
||||||
options = mkIf cfg.zoxide.replaceCd [
|
|
||||||
"--cmd cd"
|
|
||||||
];
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -5,9 +5,9 @@
|
|||||||
...
|
...
|
||||||
}:
|
}:
|
||||||
with lib; let
|
with lib; let
|
||||||
cfg = config.modules.fish;
|
cfg = config.home.shell.fish;
|
||||||
in {
|
in {
|
||||||
options.modules.fish = {
|
options.home.shell.fish = {
|
||||||
enable = lib.mkEnableOption "enables fish";
|
enable = lib.mkEnableOption "enables fish";
|
||||||
abbrs = lib.mkOption {
|
abbrs = lib.mkOption {
|
||||||
type = types.attrsOf types.str;
|
type = types.attrsOf types.str;
|
||||||
|
@ -4,17 +4,21 @@
|
|||||||
...
|
...
|
||||||
}:
|
}:
|
||||||
with lib; let
|
with lib; let
|
||||||
cfg = config.modules.starship;
|
cfg = config.home.shell.starship;
|
||||||
in {
|
in {
|
||||||
options.modules.starship = {
|
options.home.shell.starship = {
|
||||||
enable = mkEnableOption "Enables the starship prompt.";
|
enable = mkEnableOption "Enables the starship prompt.";
|
||||||
jjIntegration = mkEnableOption "Enables Jujutsu integration in starship.";
|
jjIntegration = mkOption {
|
||||||
|
description = "Enable Jujutsu integration in starship";
|
||||||
|
default = config.programs.jujutsu.enable;
|
||||||
|
type = types.bool;
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
config.programs.starship = mkIf cfg.enable {
|
config.programs.starship = mkIf cfg.enable {
|
||||||
inherit (cfg) enable;
|
inherit (cfg) enable;
|
||||||
enableTransience = true;
|
enableTransience = true;
|
||||||
settings = {
|
settings = mkIf cfg.jjIntegration {
|
||||||
custom.jj = {
|
custom.jj = {
|
||||||
description = "The current jj status";
|
description = "The current jj status";
|
||||||
detect_folders = [".jj"];
|
detect_folders = [".jj"];
|
||||||
|
@ -5,9 +5,9 @@
|
|||||||
...
|
...
|
||||||
}:
|
}:
|
||||||
with lib; let
|
with lib; let
|
||||||
cfg = config.modules.tmux;
|
cfg = config.home.shell.tmux;
|
||||||
in {
|
in {
|
||||||
options.modules.tmux.enable = mkEnableOption "Enable tmux";
|
options.home.shell.tmux.enable = mkEnableOption "Enable tmux";
|
||||||
config.programs.tmux = mkIf cfg.enable {
|
config.programs.tmux = mkIf cfg.enable {
|
||||||
inherit (cfg) enable;
|
inherit (cfg) enable;
|
||||||
baseIndex = 1;
|
baseIndex = 1;
|
||||||
|
19
users/modules/shell/zoxide.nix
Normal file
19
users/modules/shell/zoxide.nix
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
{
|
||||||
|
lib,
|
||||||
|
config,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
with lib; let
|
||||||
|
cfg = config.home.shell.zoxide;
|
||||||
|
in {
|
||||||
|
options.home.shell.zoxide = {
|
||||||
|
enable = mkEnableOption "Enable zoxide";
|
||||||
|
replaceCd = mkEnableOption "Replace cd with zoxide";
|
||||||
|
};
|
||||||
|
config.programs.zoxide = mkIf cfg.enable {
|
||||||
|
inherit (cfg) enable;
|
||||||
|
options = mkIf cfg.replaceCd [
|
||||||
|
"--cmd cd"
|
||||||
|
];
|
||||||
|
};
|
||||||
|
}
|
@ -5,9 +5,9 @@
|
|||||||
...
|
...
|
||||||
}:
|
}:
|
||||||
with lib; let
|
with lib; let
|
||||||
cfg = config.modules.zsh;
|
cfg = config.home.shell.zsh;
|
||||||
in {
|
in {
|
||||||
options.modules.zsh = {
|
options.home.shell.zsh = {
|
||||||
enable = lib.mkEnableOption "Enables zsh";
|
enable = lib.mkEnableOption "Enables zsh";
|
||||||
abbrs = lib.mkOption {
|
abbrs = lib.mkOption {
|
||||||
type = types.attrsOf types.str;
|
type = types.attrsOf types.str;
|
||||||
@ -24,70 +24,73 @@ in {
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
config.programs.zsh = lib.mkIf cfg.enable {
|
config = lib.mkIf cfg.enable {
|
||||||
enable = true;
|
programs.zsh = {
|
||||||
autocd = true;
|
|
||||||
autosuggestion = {
|
|
||||||
enable = true;
|
enable = true;
|
||||||
strategy = ["match_prev_cmd" "completion"];
|
autocd = true;
|
||||||
};
|
autosuggestion = {
|
||||||
enableCompletion = true;
|
enable = true;
|
||||||
history = {
|
strategy = ["match_prev_cmd" "completion"];
|
||||||
findNoDups = true;
|
};
|
||||||
ignoreAllDups = true;
|
enableCompletion = true;
|
||||||
ignoreDups = true;
|
enableVteIntegration = true;
|
||||||
ignoreSpace = true;
|
history = {
|
||||||
path = "${config.xdg.dataHome}/zsh/zsh_history";
|
findNoDups = true;
|
||||||
saveNoDups = true;
|
ignoreAllDups = true;
|
||||||
};
|
ignoreDups = true;
|
||||||
historySubstringSearch.enable = true;
|
ignoreSpace = true;
|
||||||
initContent = with lib;
|
path = "${config.xdg.dataHome}/zsh/zsh_history";
|
||||||
concatLines [
|
saveNoDups = true;
|
||||||
''
|
};
|
||||||
bindkey -e
|
historySubstringSearch.enable = true;
|
||||||
bindkey '^p' history-search-backward
|
initContent = with lib;
|
||||||
bindkey '^n' history-search-forward
|
concatLines [
|
||||||
|
''
|
||||||
|
bindkey -e
|
||||||
|
bindkey '^p' history-search-backward
|
||||||
|
bindkey '^n' history-search-forward
|
||||||
|
|
||||||
# Completion styling
|
# Completion styling
|
||||||
zstyle ':completion:*' matcher-list 'm:{a-z}={A-Za-z}'
|
zstyle ':completion:*' matcher-list 'm:{a-z}={A-Za-z}'
|
||||||
zstyle ':completion:*' list-colors "''${(s.:.)LS_COLORS}"
|
zstyle ':completion:*' list-colors "''${(s.:.)LS_COLORS}"
|
||||||
zstyle ':completion:*' menu no
|
zstyle ':completion:*' menu no
|
||||||
zstyle ':fzf-tab:complete:cd:*' fzf-preview '${pkgs.eza}/bin/eza $realpath'
|
zstyle ':fzf-tab:complete:cd:*' fzf-preview '${pkgs.eza}/bin/eza $realpath'
|
||||||
''
|
''
|
||||||
(strings.optionalString cfg.eatIntegration ''[ -n "$EAT_SHELL_INTEGRATION_DIR" ] && source "$EAT_SHELL_INTEGRATION_DIR/zsh"'')
|
(strings.optionalString cfg.eatIntegration ''[ -n "$EAT_SHELL_INTEGRATION_DIR" ] && source "$EAT_SHELL_INTEGRATION_DIR/zsh"'')
|
||||||
cfg.zshrcExtra
|
cfg.zshrcExtra
|
||||||
];
|
];
|
||||||
oh-my-zsh = {
|
oh-my-zsh = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
plugins = [
|
||||||
|
"dirhistory"
|
||||||
|
"sudo"
|
||||||
|
];
|
||||||
|
};
|
||||||
plugins = [
|
plugins = [
|
||||||
"dirhistory"
|
{
|
||||||
"sudo"
|
name = "fzf-tab";
|
||||||
|
src = pkgs.fetchFromGitHub {
|
||||||
|
owner = "Aloxaf";
|
||||||
|
repo = "fzf-tab";
|
||||||
|
rev = "v1.2.0";
|
||||||
|
sha256 = "sha256-q26XVS/LcyZPRqDNwKKA9exgBByE0muyuNb0Bbar2lY=";
|
||||||
|
};
|
||||||
|
}
|
||||||
|
{
|
||||||
|
name = "zsh-autopair";
|
||||||
|
src = pkgs.fetchFromGitHub {
|
||||||
|
owner = "hlissner";
|
||||||
|
repo = "zsh-autopair";
|
||||||
|
rev = "449a7c3d095bc8f3d78cf37b9549f8bb4c383f3d";
|
||||||
|
sha256 = "sha256-3zvOgIi+q7+sTXrT+r/4v98qjeiEL4Wh64rxBYnwJvQ=";
|
||||||
|
};
|
||||||
|
}
|
||||||
];
|
];
|
||||||
};
|
syntaxHighlighting.enable = true;
|
||||||
plugins = [
|
zsh-abbr = {
|
||||||
{
|
enable = true;
|
||||||
name = "fzf-tab";
|
abbreviations = cfg.abbrs;
|
||||||
src = pkgs.fetchFromGitHub {
|
};
|
||||||
owner = "Aloxaf";
|
|
||||||
repo = "fzf-tab";
|
|
||||||
rev = "v1.2.0";
|
|
||||||
sha256 = "sha256-q26XVS/LcyZPRqDNwKKA9exgBByE0muyuNb0Bbar2lY=";
|
|
||||||
};
|
|
||||||
}
|
|
||||||
{
|
|
||||||
name = "zsh-autopair";
|
|
||||||
src = pkgs.fetchFromGitHub {
|
|
||||||
owner = "hlissner";
|
|
||||||
repo = "zsh-autopair";
|
|
||||||
rev = "449a7c3d095bc8f3d78cf37b9549f8bb4c383f3d";
|
|
||||||
sha256 = "sha256-3zvOgIi+q7+sTXrT+r/4v98qjeiEL4Wh64rxBYnwJvQ=";
|
|
||||||
};
|
|
||||||
}
|
|
||||||
];
|
|
||||||
syntaxHighlighting.enable = true;
|
|
||||||
zsh-abbr = {
|
|
||||||
enable = true;
|
|
||||||
abbreviations = cfg.abbrs;
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -1,113 +0,0 @@
|
|||||||
{
|
|
||||||
config,
|
|
||||||
lib,
|
|
||||||
pkgs,
|
|
||||||
...
|
|
||||||
}:
|
|
||||||
with lib; let
|
|
||||||
cfg = config.modules.vcs;
|
|
||||||
in {
|
|
||||||
imports = [./git.nix ./jujutsu.nix];
|
|
||||||
|
|
||||||
options.modules.vcs = {
|
|
||||||
git = {
|
|
||||||
enable = mkEnableOption "enables git";
|
|
||||||
cliff = mkEnableOption "enables git-cliff support";
|
|
||||||
sendmail = {
|
|
||||||
enable = mkOption {
|
|
||||||
type = types.bool;
|
|
||||||
default = true;
|
|
||||||
};
|
|
||||||
server = mkOption {
|
|
||||||
type = types.nullOr types.str;
|
|
||||||
default = "mail.phundrak.com";
|
|
||||||
};
|
|
||||||
user = mkOption {
|
|
||||||
type = types.nullOr types.str;
|
|
||||||
default = null;
|
|
||||||
};
|
|
||||||
encryption = mkOption {
|
|
||||||
type = types.enum ["tls" "ssl" "none"];
|
|
||||||
default = "none";
|
|
||||||
};
|
|
||||||
port = mkOption {
|
|
||||||
type = types.nullOr types.int;
|
|
||||||
default = 587;
|
|
||||||
};
|
|
||||||
passwordFile = mkOption {
|
|
||||||
type = types.nullOr types.path;
|
|
||||||
default = null;
|
|
||||||
description = ''
|
|
||||||
Path to a file containing the password necessary for authenticating
|
|
||||||
against the mailserver.
|
|
||||||
|
|
||||||
This file should contain the password only, with no newline.
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
};
|
|
||||||
browser = mkOption {
|
|
||||||
type = types.nullOr types.str;
|
|
||||||
example = "${pkgs.firefox}/bin/firefox";
|
|
||||||
default = null;
|
|
||||||
};
|
|
||||||
completeConfig = mkEnableOption "Complete configuration for workstations";
|
|
||||||
mergeTool = mkOption {
|
|
||||||
type = types.str;
|
|
||||||
default = "ediff";
|
|
||||||
};
|
|
||||||
emacs = {
|
|
||||||
integration = mkEnableOption "enables Emacs integration";
|
|
||||||
pkg = mkOption {
|
|
||||||
type = types.package;
|
|
||||||
default = pkgs.emacs;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
jj.enable = mkEnableOption "enables jujutsu";
|
|
||||||
name = mkOption {
|
|
||||||
type = types.str;
|
|
||||||
default = "Lucien Cartier-Tilet";
|
|
||||||
};
|
|
||||||
email = mkOption {
|
|
||||||
type = types.str;
|
|
||||||
default = "lucien@phundrak.com";
|
|
||||||
};
|
|
||||||
editor = mkOption {
|
|
||||||
type = types.str;
|
|
||||||
default = "${pkgs.emacs}/bin/emacsclient -c -a ${pkgs.emacs}/bin/emacs";
|
|
||||||
};
|
|
||||||
publicKey = {
|
|
||||||
content = mkOption {
|
|
||||||
type = types.nullOr types.str;
|
|
||||||
example = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIGj+J6N6SO+4P8dOZqfR1oiay2yxhhHnagH52avUqw5h";
|
|
||||||
default = null;
|
|
||||||
};
|
|
||||||
file = mkOption {
|
|
||||||
type = with types; nullOr path;
|
|
||||||
default = "/home/phundrak/.ssh/id_ed25519.pub";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
config = lib.mkIf (cfg.git.enable || cfg.jj.enable) {
|
|
||||||
home.file.".ssh/allowed_signers".text = mkIf (cfg.publicKey.content != null) (mkDefault ''
|
|
||||||
${cfg.email} namespaces="git" ${cfg.publicKey.content}
|
|
||||||
'');
|
|
||||||
modules = {
|
|
||||||
git = mkIf cfg.git.enable {
|
|
||||||
inherit (cfg.git) enable cliff sendmail browser completeConfig emacs mergeTool;
|
|
||||||
inherit (cfg) email name editor;
|
|
||||||
publicKeyFile = cfg.publicKey.file;
|
|
||||||
};
|
|
||||||
jj = mkIf cfg.jj.enable {
|
|
||||||
inherit (cfg.jj) enable;
|
|
||||||
inherit (cfg) name email editor;
|
|
||||||
signing.enable = cfg.publicKey.content != null;
|
|
||||||
signing.sshKey =
|
|
||||||
if (cfg.publicKey.file == null)
|
|
||||||
then cfg.publicKey.content
|
|
||||||
else cfg.publicKey.file;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
|
@ -1,10 +0,0 @@
|
|||||||
{
|
|
||||||
programs.yt-dlp = {
|
|
||||||
enable = true;
|
|
||||||
settings = {
|
|
||||||
embed-thumbnail = true;
|
|
||||||
embed-subs = true;
|
|
||||||
sub-langs = "all";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
|
@ -1,8 +0,0 @@
|
|||||||
{
|
|
||||||
imports = [./light-home.nix];
|
|
||||||
home.phundrak.sshKey = {
|
|
||||||
content = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIHTv1lb6d99O84jeh6GdjPm8Gnt/HncSRhGhmoTq7BMK lucien@phundrak.com";
|
|
||||||
file = "/home/phundrak/.ssh/id_ed25519.pub";
|
|
||||||
};
|
|
||||||
modules.nh.flake = "/home/phundrak/.dotfiles";
|
|
||||||
}
|
|
@ -7,7 +7,7 @@
|
|||||||
Sent from GNU/Emacs
|
Sent from GNU/Emacs
|
||||||
|
|
||||||
*** Sauvez un arbre, mangez un castor ***
|
*** Sauvez un arbre, mangez un castor ***
|
||||||
*** Save a tree, eat a beaver ***
|
*** Save a tree, eat a beaver ***
|
||||||
'';
|
'';
|
||||||
in {
|
in {
|
||||||
home.file.".signature" = {
|
home.file.".signature" = {
|
||||||
|
@ -1,7 +0,0 @@
|
|||||||
{
|
|
||||||
imports = [./home.nix];
|
|
||||||
home.phundrak.sshKey = {
|
|
||||||
content = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIBPhP4p9KGk6jSOxJzBu+RzJPHI6baT0o+xrgPeNRwfq lucien@phundrak.com";
|
|
||||||
file = "/home/phundrak/.ssh/id_ed25519.pub";
|
|
||||||
};
|
|
||||||
}
|
|
@ -1,7 +1,6 @@
|
|||||||
{
|
{
|
||||||
pkgs,
|
pkgs,
|
||||||
config,
|
config,
|
||||||
inputs,
|
|
||||||
...
|
...
|
||||||
}: {
|
}: {
|
||||||
imports = [
|
imports = [
|
||||||
@ -18,10 +17,9 @@
|
|||||||
epkgs.pdf-tools
|
epkgs.pdf-tools
|
||||||
]
|
]
|
||||||
));
|
));
|
||||||
askpass = import ../scripts/askpass.nix {inherit pkgs;};
|
askpass = import ../modules/cli/scripts/askpass.nix {inherit pkgs;};
|
||||||
launchWithEmacsclient = import ../scripts/launch-with-emacsclient.nix {
|
launchWithEmacsclient = import ../modules/cli/scripts/launch-with-emacsclient.nix {
|
||||||
inherit pkgs;
|
inherit pkgs config;
|
||||||
emacsPackage = emacsPkg;
|
|
||||||
};
|
};
|
||||||
in {
|
in {
|
||||||
sops.secrets = {
|
sops.secrets = {
|
||||||
@ -30,83 +28,21 @@
|
|||||||
"mopidy/spotify" = {};
|
"mopidy/spotify" = {};
|
||||||
};
|
};
|
||||||
|
|
||||||
home.sessionVariables = {
|
home = {
|
||||||
EDITOR = "${emacsPkg}/bin/emacsclient -c -a ${emacsPkg}/bin/emacs";
|
sessionVariables = {
|
||||||
LAUNCH_EDITOR = "${launchWithEmacsclient}/bin/launch-with-emacsclient";
|
EDITOR = "${emacsPkg}/bin/emacsclient -c -a ${emacsPkg}/bin/emacs";
|
||||||
SUDO_ASKPASS = "${askpass}/bin/askpass";
|
LAUNCH_EDITOR = "${launchWithEmacsclient}/bin/launch-with-emacsclient";
|
||||||
LSP_USE_PLISTS = "true";
|
SUDO_ASKPASS = "${askpass}/bin/askpass";
|
||||||
};
|
LSP_USE_PLISTS = "true";
|
||||||
|
};
|
||||||
|
|
||||||
modules = {
|
desktop.waybar.style = ./config/waybar/style.css;
|
||||||
shell = {
|
dev.ollama = {
|
||||||
eatIntegration = true;
|
|
||||||
starship.jjIntegration = true;
|
|
||||||
};
|
|
||||||
bat.extras = true;
|
|
||||||
packages.emacsPackage = emacsPkg;
|
|
||||||
mopidy.enable = true;
|
|
||||||
ollama.enable = true;
|
|
||||||
|
|
||||||
emacs = {
|
|
||||||
enable = true;
|
enable = true;
|
||||||
service = true;
|
gpu = "amd";
|
||||||
package = emacsPkg;
|
|
||||||
mu4eMime = true;
|
|
||||||
org-protocol = true;
|
|
||||||
};
|
};
|
||||||
hyprland = {
|
fullDesktop = true;
|
||||||
inherit emacsPkg;
|
shell.fish.enable = true;
|
||||||
enable = true;
|
|
||||||
swaync = true;
|
|
||||||
waybar = {
|
|
||||||
enable = true;
|
|
||||||
battery = true;
|
|
||||||
style = ./config/waybar/style.css;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
mbsync = {
|
|
||||||
enable = true;
|
|
||||||
passwordFile = config.sops.secrets.emailPassword.path;
|
|
||||||
};
|
|
||||||
ssh = {
|
|
||||||
enable = true;
|
|
||||||
hosts = config.sops.secrets."ssh/hosts".path;
|
|
||||||
};
|
|
||||||
vcs.git = {
|
|
||||||
browser = "${inputs.zen-browser.packages.${pkgs.system}.default}/bin/zen";
|
|
||||||
emacs = {
|
|
||||||
integration = true;
|
|
||||||
pkg = emacsPkg;
|
|
||||||
};
|
|
||||||
cliff = true;
|
|
||||||
sendmail = {
|
|
||||||
enable = true;
|
|
||||||
passwordFile = config.sops.secrets.emailPassword.path;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
programs = {
|
|
||||||
zsh.enableVteIntegration = true;
|
|
||||||
mu.enable = true;
|
|
||||||
obs-studio = {
|
|
||||||
enable = true;
|
|
||||||
plugins = with pkgs; [
|
|
||||||
obs-studio-plugins.input-overlay
|
|
||||||
obs-studio-plugins.obs-backgroundremoval
|
|
||||||
obs-studio-plugins.obs-mute-filter
|
|
||||||
obs-studio-plugins.obs-pipewire-audio-capture
|
|
||||||
obs-studio-plugins.obs-source-clone
|
|
||||||
obs-studio-plugins.obs-source-record
|
|
||||||
obs-studio-plugins.obs-tuna
|
|
||||||
];
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
services = {
|
|
||||||
blanket.enable = true;
|
|
||||||
mpris-proxy.enable = true;
|
|
||||||
playerctld.enable = true;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
manual.html.enable = true;
|
manual.html.enable = true;
|
||||||
|
10
users/phundrak/host/alys.nix
Normal file
10
users/phundrak/host/alys.nix
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
{config, ...}: {
|
||||||
|
imports = [../light-home.nix];
|
||||||
|
home = {
|
||||||
|
cli.nh.flake = "${config.home.homeDirectory}/nixos";
|
||||||
|
phundrak.sshKey = {
|
||||||
|
content = builtins.readFile ../../../keys/id_alys.pub;
|
||||||
|
# file = "${config.home.homeDirectory}/.ssh/id_ed25519.pub";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
11
users/phundrak/host/gampo.nix
Normal file
11
users/phundrak/host/gampo.nix
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
{config, ...}: {
|
||||||
|
imports = [../home.nix];
|
||||||
|
home = {
|
||||||
|
cli.nh.flake = "${config.home.homeDirectory}/nixos";
|
||||||
|
desktop.hyprland.host = "gampo";
|
||||||
|
phundrak.sshKey = {
|
||||||
|
content = builtins.readFile ../../../keys/id_gampo.pub;
|
||||||
|
# file = "${config.home.homeDirectory}/.ssh/id_ed25519.pub";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
11
users/phundrak/host/marpa.nix
Normal file
11
users/phundrak/host/marpa.nix
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
{config, ...}: {
|
||||||
|
imports = [../home.nix];
|
||||||
|
home = {
|
||||||
|
cli.nh.flake = "${config.home.homeDirectory}/nixos";
|
||||||
|
desktop.hyprland.host = "marpa";
|
||||||
|
phundrak.sshKey = {
|
||||||
|
content = builtins.readFile ../../../keys/id_marpa.pub;
|
||||||
|
# file = "${config.home.homeDirectory}/.ssh/id_ed25519.pub";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
10
users/phundrak/host/tilo.nix
Normal file
10
users/phundrak/host/tilo.nix
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
{config, ...}: {
|
||||||
|
imports = [../light-home.nix];
|
||||||
|
home = {
|
||||||
|
cli.nh.flake = "${config.home.homeDirectory}/nixos";
|
||||||
|
phundrak.sshKey = {
|
||||||
|
content = builtins.readFile ../../../keys/id_tilo.pub;
|
||||||
|
# file = "${config.home.homeDirectory}/.ssh/id_ed25519.pub";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
@ -33,11 +33,10 @@ in {
|
|||||||
age = {
|
age = {
|
||||||
# automatically import user SSH keys as age keys
|
# automatically import user SSH keys as age keys
|
||||||
sshKeyPaths = [
|
sshKeyPaths = [
|
||||||
"/home/phundrak/.ssh/id_ed25519"
|
"${config.home.homeDirectory}/.ssh/id_ed25519"
|
||||||
];
|
];
|
||||||
# this will use an age key that is expected to already be in the filesystem
|
# this will use an age key that is expected to already be in the filesystem
|
||||||
# keyFile = "/home/phundrak/.config/sops/age/keys.txt";
|
keyFile = "${config.home.homeDirectory}/.local/sops-nix/key.txt";
|
||||||
keyFile = "/home/phundrak/.local/sops-nix/key.txt";
|
|
||||||
# generate a new key if the key specified above does not exist
|
# generate a new key if the key specified above does not exist
|
||||||
generateKey = true;
|
generateKey = true;
|
||||||
};
|
};
|
||||||
@ -47,23 +46,35 @@ in {
|
|||||||
username = "phundrak";
|
username = "phundrak";
|
||||||
homeDirectory = "/home/phundrak";
|
homeDirectory = "/home/phundrak";
|
||||||
packages = [pkgs.tree pkgs.ncdu];
|
packages = [pkgs.tree pkgs.ncdu];
|
||||||
stateVersion = "24.11"; # Please read the comment before changing.
|
|
||||||
};
|
|
||||||
|
|
||||||
modules = {
|
phundrak.sshKey.file = "${config.home.homeDirectory}/.ssh/id_ed25519.pub";
|
||||||
shell = {
|
|
||||||
starship.enable = true;
|
dev.vcs = {
|
||||||
tmux.enable = true;
|
|
||||||
};
|
|
||||||
vcs = {
|
|
||||||
git.enable = true;
|
|
||||||
jj.enable = true;
|
jj.enable = true;
|
||||||
|
git.enable = true;
|
||||||
publicKey = cfg.sshKey;
|
publicKey = cfg.sshKey;
|
||||||
};
|
};
|
||||||
ssh = {
|
|
||||||
|
security.ssh = {
|
||||||
enable = true;
|
enable = true;
|
||||||
hosts = config.sops.secrets."ssh/hosts".path;
|
hosts = config.sops.secrets."ssh/hosts".path;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
shell = {
|
||||||
|
bash.enable = true;
|
||||||
|
zsh.enable = true;
|
||||||
|
starship = {
|
||||||
|
enable = true;
|
||||||
|
jjIntegration = true;
|
||||||
|
};
|
||||||
|
tmux.enable = true;
|
||||||
|
zoxide = {
|
||||||
|
enable = true;
|
||||||
|
replaceCd = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
stateVersion = "24.11"; # Do not modify!
|
||||||
};
|
};
|
||||||
|
|
||||||
manual.manpages.enable = true;
|
manual.manpages.enable = true;
|
||||||
|
@ -1,7 +0,0 @@
|
|||||||
{
|
|
||||||
imports = [./home.nix];
|
|
||||||
home.phundrak.sshKey = {
|
|
||||||
content = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIBPhP4p9KGk6jSOxJzBu+RzJPHI6baT0o+xrgPeNRwfq lucien@phundrak.com";
|
|
||||||
file = "/home/phundrak/.ssh/id_ed25519.pub";
|
|
||||||
};
|
|
||||||
}
|
|
@ -2,109 +2,90 @@
|
|||||||
pkgs,
|
pkgs,
|
||||||
inputs,
|
inputs,
|
||||||
lib,
|
lib,
|
||||||
config,
|
|
||||||
...
|
...
|
||||||
}:
|
}:
|
||||||
with lib; let
|
with lib; {
|
||||||
cfg = config.modules.packages;
|
home.packages = with pkgs; [
|
||||||
in {
|
# Terminal stuff
|
||||||
options.modules.packages.emacsPackage = mkOption {
|
duf
|
||||||
type = types.package;
|
ffmpeg
|
||||||
default = pkgs.emacs;
|
ripgrep-all
|
||||||
};
|
unzip
|
||||||
config.home.packages = with pkgs; let
|
|
||||||
scripts = import ../scripts {
|
|
||||||
inherit pkgs;
|
|
||||||
config.emacsPkg = cfg.emacsPackage;
|
|
||||||
};
|
|
||||||
in
|
|
||||||
[
|
|
||||||
flatpak
|
|
||||||
|
|
||||||
# LSP servers
|
# Fonts
|
||||||
bash-language-server
|
#nerdfonts
|
||||||
docker-language-server
|
noto-fonts-cjk-sans
|
||||||
kdePackages.qtdeclarative # For QML LSP
|
noto-fonts-cjk-serif
|
||||||
nil # Nix
|
tibetan-machine
|
||||||
python3 # for Emacs and LSP
|
|
||||||
yaml-language-server # Yaml (Docker, GitHub Actions, ...)
|
|
||||||
|
|
||||||
# Terminal stuff
|
# Browsers
|
||||||
duf
|
amfora
|
||||||
ffmpeg
|
|
||||||
ripgrep-all
|
|
||||||
unzip
|
|
||||||
|
|
||||||
# Fonts
|
# Media
|
||||||
#nerdfonts
|
ani-cli
|
||||||
noto-fonts-cjk-sans
|
audacity
|
||||||
noto-fonts-cjk-serif
|
plexamp
|
||||||
tibetan-machine
|
plex-desktop
|
||||||
|
spicetify-cli
|
||||||
|
spotify
|
||||||
|
pavucontrol # Volume control
|
||||||
|
|
||||||
# Browsers
|
# Social
|
||||||
amfora
|
vesktop # Discord alternative that works well with wayland
|
||||||
|
element-desktop
|
||||||
|
signal-desktop-bin
|
||||||
|
|
||||||
# Media
|
# Misc
|
||||||
ani-cli
|
bitwarden
|
||||||
audacity
|
gplates
|
||||||
plexamp
|
libnotify
|
||||||
plex-desktop
|
nextcloud-client
|
||||||
spicetify-cli
|
onlyoffice-bin
|
||||||
spotify
|
scrcpy
|
||||||
pavucontrol # Volume control
|
syncthing
|
||||||
|
watchmate
|
||||||
|
inputs.zen-browser.packages.${system}.default
|
||||||
|
inputs.pumo-system-info.packages.${system}.default
|
||||||
|
inputs.quickshell.packages.${system}.default
|
||||||
|
|
||||||
# Social
|
# Games
|
||||||
vesktop # Discord alternative that works well with wayland
|
atlauncher
|
||||||
element-desktop
|
heroic
|
||||||
signal-desktop-bin
|
modrinth-app
|
||||||
|
openmw
|
||||||
|
openttd-jgrpp
|
||||||
|
moonlight-qt
|
||||||
|
|
||||||
# Misc
|
# Gnome stuff
|
||||||
bitwarden
|
gnome-tweaks
|
||||||
gplates
|
gnomeExtensions.docker
|
||||||
libnotify
|
gnomeExtensions.syncthing-indicator
|
||||||
nextcloud-client
|
gnomeExtensions.tray-icons-reloaded
|
||||||
onlyoffice-bin
|
gthumb
|
||||||
scrcpy
|
|
||||||
syncthing
|
|
||||||
watchmate
|
|
||||||
inputs.zen-browser.packages.${system}.default
|
|
||||||
inputs.pumo-system-info.packages.${system}.default
|
|
||||||
inputs.quickshell.packages.${system}.default
|
|
||||||
|
|
||||||
# Games
|
# Graphics
|
||||||
atlauncher
|
inkscape
|
||||||
heroic
|
gimp
|
||||||
modrinth-app
|
gimpPlugins.fourier
|
||||||
openmw
|
gimpPlugins.farbfeld
|
||||||
openttd-jgrpp
|
|
||||||
moonlight-qt
|
|
||||||
|
|
||||||
# Emacs stuff
|
# Dev
|
||||||
emacs-all-the-icons-fonts
|
devenv
|
||||||
|
dive # A tool for exploring each layer in a docker image
|
||||||
|
grype # Vulnerability scanner for container images and filesystems
|
||||||
|
kicad # Working on my custom keyboard
|
||||||
|
podman-desktop
|
||||||
|
podman-compose
|
||||||
|
tectonic # better LaTeX engine
|
||||||
|
virt-manager
|
||||||
|
zeal
|
||||||
|
|
||||||
# Gnome stuff
|
## LSP servers
|
||||||
gnome-tweaks
|
bash-language-server
|
||||||
gnomeExtensions.docker
|
docker-language-server
|
||||||
gnomeExtensions.syncthing-indicator
|
kdePackages.qtdeclarative # For QML LSP
|
||||||
gnomeExtensions.tray-icons-reloaded
|
nil # Nix
|
||||||
gthumb
|
python3 # for Emacs and LSP
|
||||||
|
yaml-language-server # Yaml (Docker, GitHub Actions, ...)
|
||||||
# Graphics
|
];
|
||||||
inkscape
|
|
||||||
gimp
|
|
||||||
gimpPlugins.fourier
|
|
||||||
gimpPlugins.farbfeld
|
|
||||||
|
|
||||||
# Dev
|
|
||||||
devenv
|
|
||||||
dive # A tool for exploring each layer in a docker image
|
|
||||||
grype # Vulnerability scanner for container images and filesystems
|
|
||||||
kicad # Working on my custom keyboard
|
|
||||||
podman-desktop
|
|
||||||
podman-compose
|
|
||||||
tectonic # better LaTeX engine
|
|
||||||
virt-manager
|
|
||||||
zeal
|
|
||||||
]
|
|
||||||
++ scripts;
|
|
||||||
}
|
}
|
||||||
|
@ -1,12 +0,0 @@
|
|||||||
{
|
|
||||||
modules = {
|
|
||||||
emacs.enable = true;
|
|
||||||
kdeconnect.enable = true;
|
|
||||||
kitty.enable = true;
|
|
||||||
mbsync.enable = true;
|
|
||||||
mpd.enable = true;
|
|
||||||
mpv.enable = true;
|
|
||||||
wofi.enable = true;
|
|
||||||
yt-dlp.enable = true;
|
|
||||||
};
|
|
||||||
}
|
|
@ -1,8 +0,0 @@
|
|||||||
{
|
|
||||||
imports = [./light-home.nix];
|
|
||||||
home.phundrak.sshKey = {
|
|
||||||
content = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAILw9oiK8tZ5Vpz82RaRLpITU8qeJrT2hjvudGEDQu2QW lucien@phundrak.com";
|
|
||||||
file = "/home/phundrak/.ssh/id_ed25519.pub";
|
|
||||||
};
|
|
||||||
modules.nh.flake = "/tank/phundrak/nixos";
|
|
||||||
}
|
|
@ -1,19 +0,0 @@
|
|||||||
{
|
|
||||||
config,
|
|
||||||
pkgs,
|
|
||||||
...
|
|
||||||
}: let
|
|
||||||
askpass = import ./askpass.nix {inherit pkgs;};
|
|
||||||
in [
|
|
||||||
askpass
|
|
||||||
(import ./backup.nix {inherit pkgs;})
|
|
||||||
(import ./keygen.nix {inherit pkgs;})
|
|
||||||
(import ./launch-with-emacsclient.nix {
|
|
||||||
inherit pkgs;
|
|
||||||
emacsPackage = config.emacsPkg;
|
|
||||||
})
|
|
||||||
(import ./mp42webm.nix {inherit pkgs;})
|
|
||||||
(import ./plock.nix {inherit pkgs;})
|
|
||||||
(import ./screenshot.nix {inherit pkgs;})
|
|
||||||
(import ./sshbind.nix {inherit pkgs;})
|
|
||||||
]
|
|
Loading…
x
Reference in New Issue
Block a user