mirror of
https://github.com/Swarsel/.dotfiles.git
synced 2025-12-06 09:07:21 +01:00
refactor: indirections f. user,[home,flake,xdg]Dir
This commit is contained in:
parent
5c207050a3
commit
9c1df052a2
34 changed files with 416 additions and 281 deletions
|
|
@ -1,8 +1,11 @@
|
|||
{ self, lib, config, pkgs, ... }:
|
||||
let
|
||||
inherit (config.swarselsystems) homeDir isPublic;
|
||||
in
|
||||
{
|
||||
|
||||
# needed for elfeed
|
||||
sops.secrets.fever = lib.mkIf (!config.swarselsystems.isPublic) { path = "${config.home.homeDirectory}/.emacs.d/.fever"; };
|
||||
sops.secrets.fever = lib.mkIf (!isPublic) { path = "${homeDir}/.emacs.d/.fever"; };
|
||||
|
||||
# enable emacs overlay for bleeding edge features
|
||||
# also read init.el file and install use-package packages
|
||||
|
|
@ -68,7 +71,7 @@
|
|||
|
||||
services.emacs = {
|
||||
enable = true;
|
||||
# socketActivation.enable = false;
|
||||
# startWithUserSession = "graphical";
|
||||
socketActivation.enable = false;
|
||||
startWithUserSession = "graphical";
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -14,12 +14,13 @@ in
|
|||
DISPLAY = ":0";
|
||||
SWARSEL_LO_RES = config.swarselsystems.lowResolution;
|
||||
SWARSEL_HI_RES = config.swarselsystems.highResolution;
|
||||
};
|
||||
systemd.user.sessionVariables = {
|
||||
SWARSEL_LEON_MAIL = leonMail;
|
||||
SWARSEL_NAUTILUS_MAIL = nautilusMail;
|
||||
SWARSEL_MRSWARSEL_MAIL = mrswarselMail;
|
||||
SWARSEL_SWARSEL_MAIL = swarselMail;
|
||||
SWARSEL_FULLNAME = fullName;
|
||||
SWARSEL_MAIL_ALL = allMailAddresses;
|
||||
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,7 @@
|
|||
{ self, pkgs, ... }:
|
||||
{ self, config, pkgs, ... }:
|
||||
let
|
||||
inherit (config.swarselsystems) mainUser homeDir;
|
||||
in
|
||||
{
|
||||
services.gpg-agent = {
|
||||
enable = true;
|
||||
|
|
@ -28,7 +31,7 @@
|
|||
|
||||
# assure correct permissions
|
||||
systemd.user.tmpfiles.rules = [
|
||||
"d /home/swarsel/.gnupg 700 swarsel users"
|
||||
"d ${homeDir}/.gnupg 700 ${mainUser} users"
|
||||
];
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,7 @@
|
|||
{ lib, config, ... }:
|
||||
let
|
||||
inherit (config.swarselsystems) mainUser;
|
||||
in
|
||||
{
|
||||
nix = lib.mkIf (!config.swarselsystems.isNixos) {
|
||||
settings = {
|
||||
|
|
@ -9,7 +12,7 @@
|
|||
"cgroups"
|
||||
"pipe-operators"
|
||||
];
|
||||
trusted-users = [ "@wheel" "swarsel" ];
|
||||
trusted-users = [ "@wheel" "${mainUser}" ];
|
||||
connect-timeout = 5;
|
||||
bash-prompt-prefix = "[33m$SHLVL:\\w [0m";
|
||||
bash-prompt = "$(if [[ $? -gt 0 ]]; then printf \"[31m\"; else printf \"[32m\"; fi)\[\e[1m\]λ\[\e[0m\] [0m";
|
||||
|
|
@ -26,14 +29,15 @@
|
|||
nixpkgs.overlays = lib.mkIf config.swarselsystems.isNixos (lib.mkForce null);
|
||||
|
||||
programs.home-manager.enable = lib.mkIf (!config.swarselsystems.isNixos) true;
|
||||
targets.genericLinux.enable = lib.mkIf (!config.swarselsystems.isNixos) true;
|
||||
|
||||
home = {
|
||||
username = lib.mkDefault "swarsel";
|
||||
homeDirectory = lib.mkDefault "/home/${config.home.username}";
|
||||
username = lib.mkDefault mainUser;
|
||||
homeDirectory = lib.mkDefault "/home/${mainUser}";
|
||||
stateVersion = lib.mkDefault "23.05";
|
||||
keyboard.layout = "us";
|
||||
sessionVariables = {
|
||||
FLAKE = "${config.home.homeDirectory}/.dotfiles";
|
||||
FLAKE = "/home/${mainUser}/.dotfiles";
|
||||
};
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -1,17 +1,20 @@
|
|||
{ config, lib, ... }:
|
||||
let
|
||||
inherit (config.swarselsystems) homeDir xdgDir;
|
||||
in
|
||||
{
|
||||
sops = lib.mkIf (!config.swarselsystems.isPublic) {
|
||||
age.sshKeyPaths = [ "${config.home.homeDirectory}/.ssh/sops" "${config.home.homeDirectory}/.ssh/ssh_host_ed25519_key" ];
|
||||
defaultSopsFile = lib.swarselsystems.mkIfElseList config.swarselsystems.isBtrfs "/persist/.dotfiles/secrets/general/secrets.yaml" "${config.home.homeDirectory}/.dotfiles/secrets/general/secrets.yaml";
|
||||
age.sshKeyPaths = [ "${homeDir}/.ssh/sops" "${homeDir}/.ssh/ssh_host_ed25519_key" ];
|
||||
defaultSopsFile = lib.swarselsystems.mkIfElseList config.swarselsystems.isBtrfs "/persist/.dotfiles/secrets/general/secrets.yaml" "${homeDir}/.dotfiles/secrets/general/secrets.yaml";
|
||||
|
||||
validateSopsFiles = false;
|
||||
secrets = {
|
||||
mrswarsel = { path = "/run/user/1000/secrets/mrswarsel"; };
|
||||
nautilus = { path = "/run/user/1000/secrets/nautilus"; };
|
||||
leon = { path = "/run/user/1000/secrets/leon"; };
|
||||
swarselmail = { path = "/run/user/1000/secrets/swarselmail"; };
|
||||
github_notif = { path = "/run/user/1000/secrets/github_notif"; };
|
||||
u2f_keys = { path = "${config.home.homeDirectory}/.config/Yubico/u2f_keys"; };
|
||||
mrswarsel = { path = "${xdgDir}/secrets/mrswarsel"; };
|
||||
nautilus = { path = "${xdgDir}/secrets/nautilus"; };
|
||||
leon = { path = "${xdgDir}/secrets/leon"; };
|
||||
swarselmail = { path = "${xdgDir}/secrets/swarselmail"; };
|
||||
github_notif = { path = "${xdgDir}/secrets/github_notif"; };
|
||||
u2f_keys = { path = "${homeDir}/.config/Yubico/u2f_keys"; };
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,13 +1,16 @@
|
|||
{ config, pkgs, lib, ... }:
|
||||
let
|
||||
inherit (config.swarselsystems) flakePath;
|
||||
in
|
||||
{
|
||||
programs.zsh = {
|
||||
enable = true;
|
||||
shellAliases = lib.recursiveUpdate
|
||||
{
|
||||
hg = "history | grep";
|
||||
hmswitch = "home-manager --flake ${config.swarselsystems.flakePath}#$(whoami)@$(hostname) switch |& nom";
|
||||
nswitch = "sudo nixos-rebuild --flake ${config.swarselsystems.flakePath}#$(hostname) --show-trace --log-format internal-json -v switch |& nom --json";
|
||||
nboot = "sudo nixos-rebuild --flake ${config.swarselsystems.flakePath}#$(hostname) --show-trace --log-format internal-json -v boot |& nom --json";
|
||||
hmswitch = "home-manager --flake ${flakePath}#$(whoami)@$(hostname) switch |& nom";
|
||||
nswitch = "sudo nixos-rebuild --flake ${flakePath}#$(hostname) --show-trace --log-format internal-json -v switch |& nom --json";
|
||||
nboot = "sudo nixos-rebuild --flake ${flakePath}#$(hostname) --show-trace --log-format internal-json -v boot |& nom --json";
|
||||
magit = "emacsclient -nc -e \"(magit-status)\"";
|
||||
config = "git --git-dir=$HOME/.cfg/ --work-tree=$HOME";
|
||||
g = "git";
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue