Move home-manager config to user module

This commit is contained in:
Erwin Boskma 2022-07-12 08:37:28 +02:00
parent 0a3c36e0da
commit 7e6ceaf681
Signed by: erwin
GPG key ID: 270B20D17394F7E5
4 changed files with 248 additions and 232 deletions

View file

@ -6,6 +6,10 @@ in
imports = [ ./hardware-configuration.nix ../../users/erwin ../../users/root ]; imports = [ ./hardware-configuration.nix ../../users/erwin ../../users/root ];
eboskma = { eboskma = {
users.erwin = {
enable = true;
home-manager = true;
};
# backscrub.enable = true; # backscrub.enable = true;
base = { base = {
plymouth.enable = true; plymouth.enable = true;

View file

@ -7,11 +7,8 @@
}: }:
with lib; let with lib; let
cfg = config.eboskma.desktop; cfg = config.eboskma.desktop;
bt = config.eboskma.bluetooth;
in in
{ {
# imports = [ ../../users/erwin.nix ../../users/root.nix ];
options.eboskma.desktop = { options.eboskma.desktop = {
enable = mkEnableOption "Enable default desktop configuration"; enable = mkEnableOption "Enable default desktop configuration";
home-manager = mkOption { home-manager = mkOption {
@ -21,216 +18,9 @@ in
Enable home-manager for this desktop Enable home-manager for this desktop
''; '';
}; };
terminal = mkOption {
type = types.str;
default = "foot";
description = "Terminal emulator to use. Specify the .desktop filename, e.g. 'foot' or 'Alacritty'";
};
}; };
config = mkIf cfg.enable { config = mkIf cfg.enable {
home-manager.users.erwin = mkIf cfg.home-manager {
_module.args.flake-inputs = inputs;
programs.home-manager.enable = true;
programs.command-not-found.enable = true;
services.blueman-applet.enable = bt.enable;
home.username = "erwin";
home.homeDirectory = "/home/erwin";
home.sessionVariables = {
EDITOR = "${pkgs.neovim}/bin/nvim";
};
nixpkgs.config = { allowUnfree = true; };
home.stateVersion = "21.11";
eboskma = {
programs = {
alacritty.enable = true;
bat.enable = true;
dropbox.enable = true;
dunst.enable = false;
emacs = {
enable = true;
daemon = true;
};
electron = {
enable = true;
wayland = true;
};
firefox = {
enable = true;
work = config.eboskma.base.work;
};
fish.enable = true;
foot.enable = true;
git = {
enable = true;
name = "Erwin Boskma";
email = "erwin@datarift.nl";
signingKey = "EE7ADEFE1D943C7B";
};
gpg.enable = true;
neovim.enable = true;
obs-studio.enable = true;
rclone = {
enable = true;
mounts = [
{
remote = "org-roam";
local = "/home/erwin/org-roam";
remoteConfig = {
type = "sftp";
host = "zh2088.rsync.net";
user = "zh2088";
key_file = "~/.ssh/id_ed25519-rsync.net";
md5sum_command = "md5 -r";
sha2sum_command = "sha1 -r";
};
}
];
};
rofi.enable = true;
vscode.enable = true;
solvespace.enable = true;
ssh.enable = true;
sway.enable = true;
tea = {
enable = true;
settings = {
logins = [
{
name = "datarift";
url = "https://git.datarift.nl";
token = "abc";
default = true;
ssh_host = "git.datarift.nl";
user = "erwin";
}
];
};
};
tmux.enable = true;
waybar.enable = true;
zathura.enable = true;
};
};
home.packages = with pkgs;
[
bandwhich
bitwarden
blink1-tool
bottom
fd
ffmpeg
ffmpeg.bin
git
gnome.nautilus
imagemagick
imv
iotop
(jetbrains.clion.override { jdk = pkgs.jetbrains.jdk; })
kicad
libnotify
libreoffice
mpv
nomachine-client
nordzy-cursor-theme
onefetch
pamedia
pass
quintom-cursor-theme
procs
ripgrep
signal-desktop
solo2-cli
steam
steamcmd
steam-tui
unzip
xdg-utils
wireshark
wl-clipboard
]
++ (with gst_all_1; [ gstreamer gstreamer.dev gst-plugins-base gst-plugins-good gst-plugins-bad gst-plugins-ugly gst-libav gst-vaapi ]);
xdg = {
enable = true;
mime.enable = true;
mimeApps = {
enable = true;
defaultApplications = {
"x-scheme-handler/http" = "firefox.desktop";
"x-scheme-handler/https" = "firefox.desktop";
"x-scheme-handler/chrome" = "firefox.desktop";
"x-scheme-handler/terminal" = "${cfg.terminal}.desktop";
"text/html" = "firefox.desktop";
"application/x-extension-htm" = "firefox.desktop";
"application/x-extension-html" = "firefox.desktop";
"application/x-extension-shtml" = "firefox.desktop";
"application/xhtml+xml" = "firefox.desktop";
"application/x-extension-xhtml" = "firefox.desktop";
"application/x-extension-xht" = "firefox.desktop";
};
associations = {
added = {
"image/jpeg" = "imv.desktop";
"image/png" = "imv.desktop";
"image/gif" = "imv.desktop";
"application/zip" = "org.gnome.FileRoller.desktop";
};
};
};
userDirs = {
enable = true;
createDirectories = true;
};
};
i18n.inputMethod = {
enabled = "fcitx5";
fcitx5.addons = with pkgs; [ fcitx5-m17n fcitx5-gtk fcitx5-configtool ];
};
gtk = {
enable = true;
theme = {
name = "Arc-Dark";
package = pkgs.arc-theme;
};
iconTheme = {
name = "Papirus-Dark";
package = pkgs.papirus-icon-theme;
};
gtk3 = {
bookmarks = [
"file:///home/erwin/workspace"
];
extraConfig = {
gtk-application-prefer-dark-theme = true;
gtk-cursor-theme-name = "Nordzy-cursors";
};
};
};
imports = [
{
nixpkgs.overlays = [
self-overlay
inputs.ha-now-playing.overlays.${pkgs.system}
inputs.pamedia.overlays.${pkgs.system}
inputs.emacs-overlay.overlay
];
}
] ++ (map (mod: (../../home-manager/modules + "/${mod}")) (builtins.attrNames (builtins.readDir ../../home-manager/modules)));
};
programs = { programs = {
dconf.enable = true; dconf.enable = true;
@ -246,7 +36,6 @@ in
}; };
extraPackages = with pkgs; [ extraPackages = with pkgs; [
swaylock-effects swaylock-effects
# swaylock
swayidle swayidle
swaynotificationcenter swaynotificationcenter
]; ];
@ -263,7 +52,6 @@ in
enable = true; enable = true;
wlr.enable = true; wlr.enable = true;
extraPortals = with pkgs; [ xdg-desktop-portal-gtk ]; extraPortals = with pkgs; [ xdg-desktop-portal-gtk ];
# gtkUsePortal = true;
}; };
}; };
@ -277,9 +65,6 @@ in
security = { security = {
pam.services.swaylock = { pam.services.swaylock = {
# text = ''
# auth include login
# '';
unixAuth = true; unixAuth = true;
setLoginUid = true; setLoginUid = true;
enableGnomeKeyring = true; enableGnomeKeyring = true;

View file

@ -1,4 +1,15 @@
{ pkgs, ... }: { { pkgs, config, lib, ... }:
with lib;
let
cfg = config.eboskma.users.erwin;
in
{
options.eboskma.users.erwin = { enable = mkEnableOption "user account for Erwin"; };
imports = [ ./desktop.nix ];
config = mkIf (cfg.enable) {
users.users.erwin = { users.users.erwin = {
isNormalUser = true; isNormalUser = true;
home = "/home/erwin"; home = "/home/erwin";
@ -13,4 +24,5 @@
}; };
nix.settings.allowed-users = [ "erwin" ]; nix.settings.allowed-users = [ "erwin" ];
};
} }

View file

@ -1,14 +1,229 @@
{ pkgs { pkgs
, config , config
, lib , lib
, inputs
, self-overlay
, ... , ...
}: }:
with lib; let with lib; let
cfg = config.eboskma.desktop; cfg = config.eboskma.users.erwin;
bt = config.eboskma.bluetooth;
in in
{ {
options.eboskma.desktop = { enable = mkEnableOption "desktop configuration"; }; options.eboskma.users.erwin = {
home-manager = mkEnableOption "home-manager";
terminal = mkOption {
type = types.str;
default = "foot";
description = "Terminal emulator to use. Specify the .desktop filename, e.g. 'foot' or 'Alacritty'";
};
};
config = config =
mkIf cfg.enable { }; mkIf cfg.home-manager {
home-manager.users.erwin = mkIf cfg.home-manager {
_module.args.flake-inputs = inputs;
programs.home-manager.enable = true;
programs.command-not-found.enable = true;
services.blueman-applet.enable = bt.enable;
home.username = "erwin";
home.homeDirectory = "/home/erwin";
home.sessionVariables = {
EDITOR = "${pkgs.neovim}/bin/nvim";
};
nixpkgs.config = { allowUnfree = true; };
home.stateVersion = "21.11";
eboskma = {
programs = {
alacritty.enable = true;
bat.enable = true;
dropbox.enable = true;
dunst.enable = false;
emacs = {
enable = true;
daemon = true;
};
electron = {
enable = true;
wayland = true;
};
firefox = {
enable = true;
work = config.eboskma.base.work;
};
fish.enable = true;
foot.enable = true;
git = {
enable = true;
name = "Erwin Boskma";
email = "erwin@datarift.nl";
signingKey = "EE7ADEFE1D943C7B";
};
gpg.enable = true;
neovim.enable = true;
obs-studio.enable = true;
rclone = {
enable = true;
mounts = [
{
remote = "org-roam";
local = "/home/erwin/org-roam";
remoteConfig = {
type = "sftp";
host = "zh2088.rsync.net";
user = "zh2088";
key_file = "~/.ssh/id_ed25519-rsync.net";
md5sum_command = "md5 -r";
sha2sum_command = "sha1 -r";
};
}
];
};
rofi.enable = true;
vscode.enable = true;
solvespace.enable = true;
ssh.enable = true;
sway.enable = true;
tea = {
enable = true;
settings = {
logins = [
{
name = "datarift";
url = "https://git.datarift.nl";
token = "abc";
default = true;
ssh_host = "git.datarift.nl";
user = "erwin";
}
];
};
};
tmux.enable = true;
waybar.enable = true;
zathura.enable = true;
};
};
home.packages = with pkgs;
[
bandwhich
bitwarden
blink1-tool
bottom
fd
ffmpeg
ffmpeg.bin
git
gnome.nautilus
imagemagick
imv
iotop
(jetbrains.clion.override { jdk = pkgs.jetbrains.jdk; })
kicad
libnotify
libreoffice
mpv
nomachine-client
nordzy-cursor-theme
onefetch
pamedia
pass
quintom-cursor-theme
procs
ripgrep
signal-desktop
solo2-cli
steam
steamcmd
steam-tui
super-slicer
unzip
xdg-utils
wireshark
wl-clipboard
]
++ (with gst_all_1; [ gstreamer gstreamer.dev gst-plugins-base gst-plugins-good gst-plugins-bad gst-plugins-ugly gst-libav gst-vaapi ]);
xdg = {
enable = true;
mime.enable = true;
mimeApps = {
enable = true;
defaultApplications = {
"x-scheme-handler/http" = "firefox.desktop";
"x-scheme-handler/https" = "firefox.desktop";
"x-scheme-handler/chrome" = "firefox.desktop";
"x-scheme-handler/terminal" = "${cfg.terminal}.desktop";
"text/html" = "firefox.desktop";
"application/x-extension-htm" = "firefox.desktop";
"application/x-extension-html" = "firefox.desktop";
"application/x-extension-shtml" = "firefox.desktop";
"application/xhtml+xml" = "firefox.desktop";
"application/x-extension-xhtml" = "firefox.desktop";
"application/x-extension-xht" = "firefox.desktop";
};
associations = {
added = {
"image/jpeg" = "imv.desktop";
"image/png" = "imv.desktop";
"image/gif" = "imv.desktop";
"application/zip" = "org.gnome.FileRoller.desktop";
};
};
};
userDirs = {
enable = true;
createDirectories = true;
};
};
i18n.inputMethod = {
enabled = "fcitx5";
fcitx5.addons = with pkgs; [ fcitx5-m17n fcitx5-gtk fcitx5-configtool ];
};
gtk = {
enable = true;
theme = {
name = "Arc-Dark";
package = pkgs.arc-theme;
};
iconTheme = {
name = "Papirus-Dark";
package = pkgs.papirus-icon-theme;
};
gtk3 = {
bookmarks = [
"file:///home/erwin/workspace"
];
extraConfig = {
gtk-application-prefer-dark-theme = true;
gtk-cursor-theme-name = "Nordzy-cursors";
};
};
};
imports = [
{
nixpkgs.overlays = [
self-overlay
inputs.ha-now-playing.overlays.${pkgs.system}
inputs.pamedia.overlays.${pkgs.system}
inputs.emacs-overlay.overlay
];
}
] ++ (map (mod: (../../home-manager/modules + "/${mod}")) (builtins.attrNames (builtins.readDir ../../home-manager/modules)));
};
};
} }