mirror of
https://github.com/Swarsel/.dotfiles.git
synced 2025-12-06 00:57:22 +01:00
refactor: [WIP] add hm and server profiles
This commit is contained in:
parent
bd95ef4c9b
commit
9034735f84
38 changed files with 2559 additions and 2178 deletions
|
|
@ -807,6 +807,7 @@ My work machine. Built for more security, this is the gold standard of my config
|
|||
isBtrfs = true;
|
||||
isLinux = true;
|
||||
sharescreen = "eDP-2";
|
||||
profiles.personal = true;
|
||||
};
|
||||
in
|
||||
{
|
||||
|
|
@ -829,6 +830,7 @@ My work machine. Built for more security, this is the gold standard of my config
|
|||
inputs.home-manager.nixosModules.home-manager
|
||||
{
|
||||
home-manager.users."${primaryUser}".imports = [
|
||||
"${self}/profiles/home"
|
||||
"${modulesPath}/home/optional/gaming.nix"
|
||||
"${modulesPath}/home/optional/work.nix"
|
||||
];
|
||||
|
|
@ -892,7 +894,6 @@ My work machine. Built for more security, this is the gold standard of my config
|
|||
|
||||
swarselsystems = lib.recursiveUpdate
|
||||
{
|
||||
profiles.personal = true;
|
||||
wallpaper = self + /wallpaper/lenovowp.png;
|
||||
hasBluetooth = true;
|
||||
hasFingerprint = true;
|
||||
|
|
@ -902,7 +903,9 @@ My work machine. Built for more security, this is the gold standard of my config
|
|||
}
|
||||
sharedOptions;
|
||||
|
||||
home-manager.users."${primaryUser}".swarselsystems = lib.recursiveUpdate
|
||||
home-manager.users."${primaryUser}" = {
|
||||
home.stateVersion = lib.mkForce "23.05";
|
||||
swarselsystems = lib.recursiveUpdate
|
||||
{
|
||||
isLaptop = true;
|
||||
isNixos = true;
|
||||
|
|
@ -1030,6 +1033,7 @@ My work machine. Built for more security, this is the gold standard of my config
|
|||
};
|
||||
}
|
||||
sharedOptions;
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -3805,10 +3809,11 @@ Modules that need to be loaded on the NixOS level. Note that these will not be a
|
|||
#+begin_src nix :tangle profiles/nixos/default.nix
|
||||
{ lib, ... }:
|
||||
let
|
||||
moduleNames = lib.swarselsystems.readNix "profiles/nixos";
|
||||
profileNames = lib.swarselsystems.readNix "profiles/nixos";
|
||||
in
|
||||
lib.swarselsystems.mkProfiles moduleNames "nixos"
|
||||
|
||||
{
|
||||
imports = lib.swarselsystems.mkImports profileNames "profiles/nixos";
|
||||
}
|
||||
#+end_src
|
||||
|
||||
***** Personal
|
||||
|
|
@ -3816,9 +3821,9 @@ Modules that need to be loaded on the NixOS level. Note that these will not be a
|
|||
#+begin_src nix :tangle profiles/nixos/personal/default.nix :mkdirp yes
|
||||
{ lib, config, ... }:
|
||||
{
|
||||
options.swarselsystems.profiles.personalz = lib.mkEnableOption "is this a personal host";
|
||||
config = lib.mkIf config.swarselsystems.profiles.personalz {
|
||||
config.swarselsystems.modules = {
|
||||
options.swarselsystems.profiles.personal = lib.mkEnableOption "is this a personal host";
|
||||
config = lib.mkIf config.swarselsystems.profiles.personal {
|
||||
swarselsystems.modules = {
|
||||
packages = lib.mkDefault true;
|
||||
general = lib.mkDefault true;
|
||||
home-manager = lib.mkDefault true;
|
||||
|
|
@ -3868,6 +3873,78 @@ Modules that need to be loaded on the NixOS level. Note that these will not be a
|
|||
|
||||
#+end_src
|
||||
|
||||
***** Local Server
|
||||
|
||||
#+begin_src nix :tangle profiles/nixos/localserver/default.nix :mkdirp yes
|
||||
{ lib, config, ... }:
|
||||
{
|
||||
options.swarselsystems.profiles.server.local = lib.mkEnableOption "is this a local server";
|
||||
config = lib.mkIf config.swarselsystems.profiles.server.local {
|
||||
swarselsystems = {
|
||||
# common modules
|
||||
modules = {
|
||||
nix-ld = lib.mkDefault true;
|
||||
home-manager = lib.mkDefault true;
|
||||
home-managerExtra = lib.mkDefault true;
|
||||
xserver = lib.mkDefault true;
|
||||
gc = lib.mkDefault true;
|
||||
storeOptimize = lib.mkDefault true;
|
||||
time = lib.mkDefault true;
|
||||
users = lib.mkDefault true;
|
||||
};
|
||||
# server modules
|
||||
# server = {
|
||||
# kavita = lib.mkDefault true;
|
||||
# jellyfin = lib.mkDefault true;
|
||||
# navidrome = lib.mkDefault true;
|
||||
# spotifyd = lib.mkDefault true;
|
||||
# mpd = lib.mkDefault true;
|
||||
# matrix = lib.mkDefault true;
|
||||
# nextcloud = lib.mkDefault true;
|
||||
# immich = lib.mkDefault true;
|
||||
# paperless = lib.mkDefault true;
|
||||
# transmission = lib.mkDefault true;
|
||||
# syncthing = lib.mkDefault true;
|
||||
# monitoring = lib.mkDefault true;
|
||||
# emacs = lib.mkDefault true;
|
||||
# freshrss = lib.mkDefault true;
|
||||
# };
|
||||
};
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#+end_src
|
||||
***** OCI Sync Server
|
||||
|
||||
#+begin_src nix :tangle profiles/nixos/syncserver/default.nix :mkdirp yes
|
||||
{ lib, config, ... }:
|
||||
{
|
||||
options.swarselsystems.profiles.server.sync = lib.mkEnableOption "is this a oci sync server";
|
||||
config = lib.mkIf config.swarselsystems.profiles.server.sync {
|
||||
swarselsystems = {
|
||||
# common modules
|
||||
modules = {
|
||||
nix-ld = lib.mkDefault true;
|
||||
home-manager = lib.mkDefault true;
|
||||
home-managerExtra = lib.mkDefault true;
|
||||
xserver = lib.mkDefault true;
|
||||
gc = lib.mkDefault true;
|
||||
storeOptimize = lib.mkDefault true;
|
||||
time = lib.mkDefault true;
|
||||
users = lib.mkDefault true;
|
||||
};
|
||||
# server modules
|
||||
# server = {
|
||||
# forgejo = lib.mkDefault true;
|
||||
# ankisync = lib.mkDefault true;
|
||||
# };
|
||||
};
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#+end_src
|
||||
**** home-manager
|
||||
:PROPERTIES:
|
||||
:CUSTOM_ID: h:ced5841f-c088-4d88-b3a1-7d62aad8837b
|
||||
|
|
@ -3878,9 +3955,53 @@ This holds modules that are to be used on most hosts. These are also the most im
|
|||
#+BEGIN_src nix :tangle profiles/home/default.nix
|
||||
{ lib, ... }:
|
||||
let
|
||||
moduleNames = lib.swarselsystems.readNix "profiles/home";
|
||||
profileNames = lib.swarselsystems.readNix "profiles/home";
|
||||
in
|
||||
lib.swarselsystems.mkProfiles moduleNames "home"
|
||||
{
|
||||
imports = lib.swarselsystems.mkImports profileNames "profiles/home";
|
||||
}
|
||||
#+end_src
|
||||
|
||||
***** Personal
|
||||
|
||||
#+begin_src nix :tangle profiles/home/personal/default.nix :mkdirp yes
|
||||
{ lib, config, ... }:
|
||||
{
|
||||
options.swarselsystems.profiles.personal = lib.mkEnableOption "is this a personal host";
|
||||
config = lib.mkIf config.swarselsystems.profiles.personal {
|
||||
swarselsystems.modules = {
|
||||
packages = lib.mkDefault true;
|
||||
ownpackages = lib.mkDefault true;
|
||||
general = lib.mkDefault true;
|
||||
nixgl = lib.mkDefault true;
|
||||
sops = lib.mkDefault true;
|
||||
yubikey = lib.mkDefault true;
|
||||
ssh = lib.mkDefault true;
|
||||
stylix = lib.mkDefault true;
|
||||
desktop = lib.mkDefault true;
|
||||
symlink = lib.mkDefault true;
|
||||
env = lib.mkDefault true;
|
||||
programs = lib.mkDefault true;
|
||||
nix-index = lib.mkDefault true;
|
||||
direnv = lib.mkDefault true;
|
||||
eza = lib.mkDefault true;
|
||||
git = lib.mkDefault true;
|
||||
fuzzel = lib.mkDefault true;
|
||||
starship = lib.mkDefault true;
|
||||
kitty = lib.mkDefault true;
|
||||
zsh = lib.mkDefault true;
|
||||
zellij = lib.mkDefault true;
|
||||
tmux = lib.mkDefault true;
|
||||
mail = lib.mkDefault true;
|
||||
emacs = lib.mkDefault true;
|
||||
waybar = lib.mkDefault true;
|
||||
firefox = lib.mkDefault true;
|
||||
gnome-keyring = lib.mkDefault true;
|
||||
};
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#+end_src
|
||||
|
||||
*** Library functions
|
||||
|
|
@ -8014,7 +8135,7 @@ Options that I need specifically at work. There are more options at [[#h:f0b2ea9
|
|||
|
||||
udev.extraRules = ''
|
||||
# share screen when dongle detected
|
||||
SUBSYSTEM=="usb", ACTION=="add", ATTRS{idVendor}=="04e8", ATTRS{idProduct}=="6860", TAG+="systemd", ENV{SYSTEMD_WANTS}="swarsel-screenshare.service"
|
||||
SUBSYSTEM=="usb", ACTION=="add", ATTRS{idVendor}=="343c", ATTRS{idProduct}=="0000", TAG+="systemd", ENV{SYSTEMD_WANTS}="swarsel-screenshare.service"
|
||||
|
||||
# lock screen when yubikey removed
|
||||
ACTION=="remove", ENV{PRODUCT}=="3/1050/407/110", RUN+="${pkgs.systemd}/bin/systemctl suspend"
|
||||
|
|
@ -8426,6 +8547,8 @@ Again, we adapt =nix= to our needs, enable the home-manager command for non-NixO
|
|||
inherit (config.swarselsystems) mainUser;
|
||||
in
|
||||
{
|
||||
options.swarselsystems.modules.general = lib.mkEnableOption "general nix settings";
|
||||
config = lib.mkIf config.swarselsystems.modules.general {
|
||||
nix = lib.mkIf (!config.swarselsystems.isNixos) {
|
||||
settings = {
|
||||
experimental-features = [
|
||||
|
|
@ -8463,6 +8586,7 @@ Again, we adapt =nix= to our needs, enable the home-manager command for non-NixO
|
|||
FLAKE = "/home/${mainUser}/.dotfiles";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
}
|
||||
#+end_src
|
||||
|
|
@ -8481,16 +8605,17 @@ It can be set to either:
|
|||
- a PCI id in the form =vendor_id:device_id=
|
||||
|
||||
#+begin_src nix :tangle modules/home/common/nixgl.nix
|
||||
{ lib, config, nixgl, ... }:
|
||||
{
|
||||
{ lib, config, nixgl, ... }:
|
||||
{
|
||||
options.swarselsystems = {
|
||||
modules.nixgl = lib.mkEnableOption "nixgl settings";
|
||||
isSecondaryGpu = lib.mkEnableOption "device has a secondary GPU";
|
||||
SecondaryGpuCard = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
default = "";
|
||||
};
|
||||
};
|
||||
config = {
|
||||
config = lib.mkIf config.swarselsystems.modules.nixgl {
|
||||
nixGL = lib.mkIf (!config.swarselsystems.isNixos) {
|
||||
inherit (nixgl) packages;
|
||||
defaultWrapper = lib.mkDefault "mesa";
|
||||
|
|
@ -8506,7 +8631,7 @@ It can be set to either:
|
|||
];
|
||||
};
|
||||
};
|
||||
}
|
||||
}
|
||||
#+end_src
|
||||
|
||||
**** Installed packages
|
||||
|
|
@ -8528,9 +8653,11 @@ Programming languages and default lsp's are defined here: [[#h:0e7e8bea-ec58-499
|
|||
This holds packages that I can use as provided, or with small modifications (as in the =texlive= package that needs special configuration).
|
||||
|
||||
#+begin_src nix :tangle modules/home/common/packages.nix
|
||||
{ pkgs, ... }:
|
||||
{ lib, config, pkgs, ... }:
|
||||
|
||||
{
|
||||
{
|
||||
options.swarselsystems.modules.packages = lib.mkEnableOption "packages settings";
|
||||
config = lib.mkIf config.swarselsystems.modules.packages {
|
||||
home.packages = with pkgs; [
|
||||
|
||||
# audio stuff
|
||||
|
|
@ -8706,7 +8833,8 @@ This holds packages that I can use as provided, or with small modifications (as
|
|||
noto-fonts
|
||||
noto-fonts-cjk-sans
|
||||
];
|
||||
}
|
||||
};
|
||||
}
|
||||
#+end_src
|
||||
|
||||
***** Self-defined
|
||||
|
|
@ -8717,9 +8845,11 @@ This holds packages that I can use as provided, or with small modifications (as
|
|||
This is just a separate container for derivations defined in [[#h:64a5cc16-6b16-4802-b421-c67ccef853e1][Packages]]. This is a good idea so that I do not lose track of package names I have defined myself, as this was once a problem in the past already.
|
||||
|
||||
#+begin_src nix :tangle modules/home/common/custom-packages.nix
|
||||
{ config, pkgs, ... }:
|
||||
{ lib, config, pkgs, ... }:
|
||||
|
||||
{
|
||||
options.swarselsystems.modules.ownpackages = lib.mkEnableOption "own packages settings";
|
||||
config = lib.mkIf config.swarselsystems.modules.ownpackages {
|
||||
home.packages = with pkgs; lib.mkIf (!config.swarselsystems.isPublic) [
|
||||
pass-fuzzel
|
||||
cura5
|
||||
|
|
@ -8746,6 +8876,7 @@ This is just a separate container for derivations defined in [[#h:64a5cc16-6b16-
|
|||
|
||||
rustdesk-vbc
|
||||
];
|
||||
};
|
||||
}
|
||||
#+end_src
|
||||
|
||||
|
|
@ -8769,6 +8900,8 @@ I use sops-nix to handle secrets that I want to have available on my machines at
|
|||
inherit (config.swarselsystems) homeDir xdgDir;
|
||||
in
|
||||
{
|
||||
options.swarselsystems.modules.sops = lib.mkEnableOption "sops settings";
|
||||
config = lib.mkIf config.swarselsystems.modules.sops {
|
||||
sops = lib.mkIf (!config.swarselsystems.isPublic) {
|
||||
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";
|
||||
|
|
@ -8783,6 +8916,7 @@ I use sops-nix to handle secrets that I want to have available on my machines at
|
|||
u2f_keys = { path = "${homeDir}/.config/Yubico/u2f_keys"; };
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
#+end_src
|
||||
|
||||
|
|
@ -8792,19 +8926,22 @@ I use sops-nix to handle secrets that I want to have available on my machines at
|
|||
:END:
|
||||
|
||||
#+begin_src nix :tangle modules/home/common/yubikey.nix
|
||||
{ lib, nix-secrets, ... }:
|
||||
{ lib, config, nix-secrets, ... }:
|
||||
let
|
||||
secretsDirectory = builtins.toString nix-secrets;
|
||||
yubikey1 = lib.swarselsystems.getSecret "${secretsDirectory}/yubikey/yubikey1";
|
||||
yubikey2 = lib.swarselsystems.getSecret "${secretsDirectory}/yubikey/yubikey2";
|
||||
in
|
||||
{
|
||||
options.swarselsystems.modules.yubikey = lib.mkEnableOption "yubikey settings";
|
||||
config = lib.mkIf config.swarselsystems.modules.yubikey {
|
||||
pam.yubico.authorizedYubiKeys = {
|
||||
ids = [
|
||||
"${yubikey1}"
|
||||
"${yubikey2}"
|
||||
];
|
||||
};
|
||||
};
|
||||
}
|
||||
#+end_src
|
||||
|
||||
|
|
@ -8816,8 +8953,10 @@ I use sops-nix to handle secrets that I want to have available on my machines at
|
|||
It is very convenient to have SSH aliases in place for machines that I use. This is mainly used for some server machines and some university clusters. We also enable agent forwarding to have our Yubikey SSH key accessible on the remote host.
|
||||
|
||||
#+begin_src nix :tangle modules/home/common/ssh.nix
|
||||
_:
|
||||
{ lib, config, ... }:
|
||||
{
|
||||
options.swarselsystems.modules.ssh = lib.mkEnableOption "ssh settings";
|
||||
config = lib.mkIf config.swarselsystems.modules.ssh {
|
||||
programs.ssh = {
|
||||
enable = true;
|
||||
forwardAgent = true;
|
||||
|
|
@ -8852,6 +8991,7 @@ It is very convenient to have SSH aliases in place for machines that I use. This
|
|||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
#+end_src
|
||||
|
||||
|
|
@ -8869,12 +9009,15 @@ This section has been notably empty ever since switching to stylix. Only Emacs i
|
|||
#+begin_src nix :noweb yes :tangle modules/home/common/stylix.nix
|
||||
{ lib, config, ... }:
|
||||
{
|
||||
options.swarselsystems.modules.stylix = lib.mkEnableOption "stylix settings";
|
||||
config = lib.mkIf config.swarselsystems.modules.stylix {
|
||||
stylix = lib.mkIf (!config.swarselsystems.isNixos) (lib.recursiveUpdate
|
||||
{
|
||||
image = config.swarselsystems.wallpaper;
|
||||
targets = config.swarselsystems.stylixHomeTargets;
|
||||
}
|
||||
config.swarselsystems.stylix);
|
||||
};
|
||||
}
|
||||
#+end_src
|
||||
|
||||
|
|
@ -8888,9 +9031,10 @@ Some programs lack a dmenu launcher - I define them myself here.
|
|||
TODO: Non-NixOS machines (=sp3) should not use these by default, but instead the programs prefixed with "nixGL". I need to figure out how to automate this process, as it is not feasible to write desktop entries for all programs installed on that machine.
|
||||
|
||||
#+begin_src nix :tangle modules/home/common/desktop.nix
|
||||
|
||||
_:
|
||||
{ lib, config, ... }:
|
||||
{
|
||||
options.swarselsystems.modules.desktop = lib.mkEnableOption "desktop settings";
|
||||
config = lib.mkIf config.swarselsystems.modules.desktop {
|
||||
xdg.desktopEntries = {
|
||||
|
||||
cura = {
|
||||
|
|
@ -8980,6 +9124,7 @@ TODO: Non-NixOS machines (=sp3) should not use these by default, but instead the
|
|||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
#+end_src
|
||||
|
||||
|
|
@ -8996,8 +9141,10 @@ Also, we link some files to the users XDG configuration home:
|
|||
Also in firefox `about:config > toolkit.legacyUserProfileCustomizations.stylesheets` to true.
|
||||
|
||||
#+begin_src nix :tangle modules/home/common/symlink.nix
|
||||
{ self, lib, ... }:
|
||||
{ self, lib, config, ... }:
|
||||
{
|
||||
options.swarselsystems.modules.symlink = lib.mkEnableOption "symlink settings";
|
||||
config = lib.mkIf config.swarselsystems.modules.symlink {
|
||||
home.file = {
|
||||
"init.el" = lib.mkDefault {
|
||||
source = self + /programs/emacs/init.el;
|
||||
|
|
@ -9024,6 +9171,7 @@ Also in firefox `about:config > toolkit.legacyUserProfileCustomizations.styleshe
|
|||
"tridactyl/themes/swarsel.css".source = self + /programs/firefox/tridactyl/themes/swarsel.css;
|
||||
"swayidle/config".source = self + /programs/swayidle/config;
|
||||
};
|
||||
};
|
||||
}
|
||||
#+end_src
|
||||
|
||||
|
|
@ -9046,6 +9194,8 @@ Sets environment variables. Here I am only setting the EDITOR variable, most var
|
|||
allMailAddresses = lib.swarselsystems.getSecret "${secretsDirectory}/mail/list";
|
||||
in
|
||||
{
|
||||
options.swarselsystems.modules.env = lib.mkEnableOption "env settings";
|
||||
config = lib.mkIf config.swarselsystems.modules.env {
|
||||
home.sessionVariables = {
|
||||
EDITOR = "e -w";
|
||||
DISPLAY = ":0";
|
||||
|
|
@ -9060,6 +9210,7 @@ Sets environment variables. Here I am only setting the EDITOR variable, most var
|
|||
SWARSEL_FULLNAME = fullName;
|
||||
SWARSEL_MAIL_ALL = allMailAddresses;
|
||||
};
|
||||
};
|
||||
}
|
||||
#+end_src
|
||||
|
||||
|
|
@ -9071,8 +9222,10 @@ Sets environment variables. Here I am only setting the EDITOR variable, most var
|
|||
This section is for programs that require no further configuration. zsh Integration is enabled by default for these.
|
||||
|
||||
#+begin_src nix :tangle modules/home/common/programs.nix
|
||||
{ pkgs, ... }:
|
||||
{ lib, config, pkgs, ... }:
|
||||
{
|
||||
options.swarselsystems.modules.programs = lib.mkEnableOption "programs settings";
|
||||
config = lib.mkIf config.swarselsystems.modules.programs {
|
||||
programs = {
|
||||
bottom.enable = true;
|
||||
imv.enable = true;
|
||||
|
|
@ -9092,6 +9245,7 @@ This section is for programs that require no further configuration. zsh Integrat
|
|||
fzf.enable = true;
|
||||
zoxide.enable = true;
|
||||
};
|
||||
};
|
||||
}
|
||||
#+end_src
|
||||
|
||||
|
|
@ -9103,8 +9257,10 @@ This section is for programs that require no further configuration. zsh Integrat
|
|||
nix-index provides a way to find out which packages are provided by which derivations. By default it also comes with a replacement for =command-not-found.sh=, however, the implementation is based on a channel based setup. I like consistency, so I replace the command with one that provides a flakes-based output.
|
||||
|
||||
#+begin_src nix :tangle modules/home/common/nix-index.nix
|
||||
{ self, pkgs, ... }:
|
||||
{ self, lib, config, pkgs, ... }:
|
||||
{
|
||||
options.swarselsystems.modules.nix-index = lib.mkEnableOption "nix-index settings";
|
||||
config = lib.mkIf config.swarselsystems.modules.nix-index {
|
||||
programs.nix-index =
|
||||
let
|
||||
commandNotFound = pkgs.runCommandLocal "command-not-found.sh" { } ''
|
||||
|
|
@ -9123,6 +9279,7 @@ nix-index provides a way to find out which packages are provided by which deriva
|
|||
paths = [ commandNotFound ];
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
#+end_src
|
||||
|
||||
|
|
@ -9134,8 +9291,10 @@ nix-index provides a way to find out which packages are provided by which deriva
|
|||
Enables password store with the =pass-otp= extension which allows me to store and generate one-time-passwords.
|
||||
|
||||
#+begin_src nix :tangle modules/home/common/password-store.nix
|
||||
{ pkgs, ... }:
|
||||
{ lib, config, pkgs, ... }:
|
||||
{
|
||||
options.swarselsystems.modules.passwordstore = lib.mkEnableOption "passwordstore settings";
|
||||
config = lib.mkIf config.swarselsystems.modules.passwordstore {
|
||||
programs.password-store = {
|
||||
enable = true;
|
||||
settings = {
|
||||
|
|
@ -9143,6 +9302,7 @@ Enables password store with the =pass-otp= extension which allows me to store an
|
|||
};
|
||||
package = pkgs.pass.withExtensions (exts: [ exts.pass-otp ]);
|
||||
};
|
||||
};
|
||||
}
|
||||
#+end_src
|
||||
|
||||
|
|
@ -9154,13 +9314,16 @@ Enables password store with the =pass-otp= extension which allows me to store an
|
|||
Enables direnv, which I use for nearly all of my nix dev flakes.
|
||||
|
||||
#+begin_src nix :tangle modules/home/common/direnv.nix
|
||||
_:
|
||||
{ lib, config, ... }:
|
||||
{
|
||||
options.swarselsystems.modules.direnv = lib.mkEnableOption "direnv settings";
|
||||
config = lib.mkIf config.swarselsystems.modules.direnv {
|
||||
programs.direnv = {
|
||||
enable = true;
|
||||
silent = true;
|
||||
nix-direnv.enable = true;
|
||||
};
|
||||
};
|
||||
}
|
||||
#+end_src
|
||||
|
||||
|
|
@ -9172,8 +9335,10 @@ Enables direnv, which I use for nearly all of my nix dev flakes.
|
|||
Eza provides me with a better =ls= command and some other useful aliases.
|
||||
|
||||
#+begin_src nix :tangle modules/home/common/eza.nix
|
||||
_:
|
||||
{ lib, config, ... }:
|
||||
{
|
||||
options.swarselsystems.modules.eza = lib.mkEnableOption "eza settings";
|
||||
config = lib.mkIf config.swarselsystems.modules.eza {
|
||||
programs.eza = {
|
||||
enable = true;
|
||||
icons = "auto";
|
||||
|
|
@ -9183,6 +9348,7 @@ Eza provides me with a better =ls= command and some other useful aliases.
|
|||
"--group-directories-first"
|
||||
];
|
||||
};
|
||||
};
|
||||
}
|
||||
#+end_src
|
||||
|
||||
|
|
@ -9194,13 +9360,15 @@ Eza provides me with a better =ls= command and some other useful aliases.
|
|||
Here I set up my git config, automatic signing of commits, useful aliases for my ost used commands (for when I am not using [[#h:d2c7323d-f8c6-4f23-b70a-930e3e4ecce5][Magit]]) as well as a git template defined in [[#h:5ef03803-e150-41bc-b603-e80d60d96efc][Linking dotfiles]].
|
||||
|
||||
#+begin_src nix :tangle modules/home/common/git.nix
|
||||
{ lib, nix-secrets, ... }:
|
||||
{ lib, config, nix-secrets, ... }:
|
||||
let
|
||||
secretsDirectory = builtins.toString nix-secrets;
|
||||
leonMail = lib.swarselsystems.getSecret "${secretsDirectory}/mail/leon";
|
||||
fullName = lib.swarselsystems.getSecret "${secretsDirectory}/info/fullname";
|
||||
in
|
||||
{
|
||||
options.swarselsystems.modules.git = lib.mkEnableOption "git settings";
|
||||
config = lib.mkIf config.swarselsystems.modules.git {
|
||||
programs.git = {
|
||||
enable = true;
|
||||
aliases = {
|
||||
|
|
@ -9237,6 +9405,7 @@ Here I set up my git config, automatic signing of commits, useful aliases for my
|
|||
}
|
||||
];
|
||||
};
|
||||
};
|
||||
}
|
||||
#+end_src
|
||||
|
||||
|
|
@ -9248,8 +9417,10 @@ Here I set up my git config, automatic signing of commits, useful aliases for my
|
|||
Here I only need to set basic layout options - the rest is being managed by stylix.
|
||||
|
||||
#+begin_src nix :tangle modules/home/common/fuzzel.nix
|
||||
_:
|
||||
{ lib, config, ... }:
|
||||
{
|
||||
options.swarselsystems.modules.fuzzel = lib.mkEnableOption "fuzzel settings";
|
||||
config = lib.mkIf config.swarselsystems.modules.fuzzel {
|
||||
programs.fuzzel = {
|
||||
enable = true;
|
||||
settings = {
|
||||
|
|
@ -9261,6 +9432,7 @@ Here I only need to set basic layout options - the rest is being managed by styl
|
|||
border.radius = "0";
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
#+end_src
|
||||
|
||||
|
|
@ -9272,8 +9444,10 @@ Here I only need to set basic layout options - the rest is being managed by styl
|
|||
Starship makes my =zsh= look cooler! I have symbols for most programming languages and toolchains, also I build my own powerline.
|
||||
|
||||
#+begin_src nix :tangle modules/home/common/starship.nix
|
||||
_:
|
||||
{ lib, config, ... }:
|
||||
{
|
||||
options.swarselsystems.modules.starship = lib.mkEnableOption "starship settings";
|
||||
config = lib.mkIf config.swarselsystems.modules.starship {
|
||||
programs.starship = {
|
||||
enable = true;
|
||||
enableZshIntegration = true;
|
||||
|
|
@ -9392,6 +9566,7 @@ Starship makes my =zsh= look cooler! I have symbols for most programming languag
|
|||
scala.symbol = " ";
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
#+end_src
|
||||
|
||||
|
|
@ -9405,8 +9580,10 @@ Kitty is the terminal emulator of choice for me, it is nice to configure using n
|
|||
The theme is handled by stylix.
|
||||
|
||||
#+begin_src nix :tangle modules/home/common/kitty.nix
|
||||
_:
|
||||
{ lib, config, ... }:
|
||||
{
|
||||
options.swarselsystems.modules.kitty = lib.mkEnableOption "kitty settings";
|
||||
config = lib.mkIf config.swarselsystems.modules.kitty {
|
||||
programs.kitty = {
|
||||
enable = true;
|
||||
keybindings = { };
|
||||
|
|
@ -9416,6 +9593,7 @@ The theme is handled by stylix.
|
|||
notify_on_cmd_finish = "always 20";
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
#+end_src
|
||||
|
||||
|
|
@ -9435,12 +9613,13 @@ Here we set some aliases (some of them should be shellApplications instead) as w
|
|||
in
|
||||
{
|
||||
options.swarselsystems = {
|
||||
modules.zsh = lib.mkEnableOption "zsh settings";
|
||||
shellAliases = lib.mkOption {
|
||||
type = lib.types.attrsOf lib.types.str;
|
||||
default = { };
|
||||
};
|
||||
};
|
||||
config = {
|
||||
config = lib.mkIf config.swarselsystems.modules.zsh {
|
||||
programs.zsh = {
|
||||
enable = true;
|
||||
shellAliases = lib.recursiveUpdate
|
||||
|
|
@ -9548,9 +9727,10 @@ Here we set some aliases (some of them should be shellApplications instead) as w
|
|||
:CUSTOM_ID: h:00de4901-631c-4b4c-86ce-d9d6e62ed8c7
|
||||
:END:
|
||||
#+begin_src nix :tangle modules/home/common/zellij.nix
|
||||
{ self, config, pkgs, ... }:
|
||||
{ self, lib, config, pkgs, ... }:
|
||||
{
|
||||
|
||||
options.swarselsystems.modules.zellij = lib.mkEnableOption "zellij settings";
|
||||
config = lib.mkIf config.swarselsystems.modules.zellij {
|
||||
programs.zellij = {
|
||||
enable = true;
|
||||
enableZshIntegration = true;
|
||||
|
|
@ -9564,6 +9744,7 @@ Here we set some aliases (some of them should be shellApplications instead) as w
|
|||
"zellij/config.kdl".text = import "${self}/programs/zellij/config.kdl.nix" { inherit config; };
|
||||
"zellij/layouts/default.kdl".text = import "${self}/programs/zellij/layouts/default.kdl.nix" { inherit config pkgs; };
|
||||
};
|
||||
};
|
||||
|
||||
}
|
||||
#+end_src
|
||||
|
|
@ -9572,8 +9753,7 @@ Here we set some aliases (some of them should be shellApplications instead) as w
|
|||
:CUSTOM_ID: h:45de9430-f925-4df6-9db6-bffb5b8f1604
|
||||
:END:
|
||||
#+begin_src nix :tangle modules/home/common/tmux.nix
|
||||
|
||||
{ pkgs, ... }:
|
||||
{ lib, config, pkgs, ... }:
|
||||
let
|
||||
tmux-super-fingers = pkgs.tmuxPlugins.mkTmuxPlugin
|
||||
{
|
||||
|
|
@ -9588,7 +9768,8 @@ Here we set some aliases (some of them should be shellApplications instead) as w
|
|||
};
|
||||
in
|
||||
{
|
||||
|
||||
options.swarselsystems.modules.tmux = lib.mkEnableOption "tmux settings";
|
||||
config = lib.mkIf config.swarselsystems.modules.tmux {
|
||||
home.packages = with pkgs; [
|
||||
lsof
|
||||
sesh
|
||||
|
|
@ -9669,6 +9850,7 @@ Here we set some aliases (some of them should be shellApplications instead) as w
|
|||
|
||||
'';
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -9691,6 +9873,8 @@ Normally I use 4 mail accounts - here I set them all up. Three of them are Googl
|
|||
fullName = lib.swarselsystems.getSecret "${secretsDirectory}/info/fullname";
|
||||
in
|
||||
{
|
||||
options.swarselsystems.modules.mail = lib.mkEnableOption "mail settings";
|
||||
config = lib.mkIf config.swarselsystems.modules.mail {
|
||||
programs = {
|
||||
mbsync = {
|
||||
enable = true;
|
||||
|
|
@ -9825,6 +10009,7 @@ Normally I use 4 mail accounts - here I set them all up. Three of them are Googl
|
|||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
#+end_src
|
||||
|
||||
|
|
@ -9843,7 +10028,8 @@ Lastly, I am defining some more packages here that the parser has problems findi
|
|||
inherit (config.swarselsystems) homeDir isPublic;
|
||||
in
|
||||
{
|
||||
|
||||
options.swarselsystems.modules.emacs = lib.mkEnableOption "emacs settings";
|
||||
config = lib.mkIf config.swarselsystems.modules.emacs {
|
||||
# needed for elfeed
|
||||
sops.secrets.fever = lib.mkIf (!isPublic) { path = "${homeDir}/.emacs.d/.fever"; };
|
||||
|
||||
|
|
@ -9914,6 +10100,7 @@ Lastly, I am defining some more packages here that the parser has problems findi
|
|||
socketActivation.enable = false;
|
||||
startWithUserSession = "graphical";
|
||||
};
|
||||
};
|
||||
}
|
||||
#+end_src
|
||||
|
||||
|
|
@ -9957,6 +10144,7 @@ The rest of the related configuration is found here:
|
|||
in
|
||||
{
|
||||
options.swarselsystems = {
|
||||
modules.waybar = lib.mkEnableOption "waybar settings";
|
||||
cpuCount = lib.mkOption {
|
||||
type = lib.types.int;
|
||||
default = 8;
|
||||
|
|
@ -9985,7 +10173,7 @@ The rest of the related configuration is found here:
|
|||
internal = true;
|
||||
};
|
||||
};
|
||||
config = {
|
||||
config = lib.mkIf config.swarselsystems.modules.waybar {
|
||||
swarselsystems = {
|
||||
waybarModules = lib.mkIf config.swarselsystems.isLaptop (modulesLeft ++ [
|
||||
"battery"
|
||||
|
|
@ -10260,6 +10448,8 @@ I used to build the firefox addon =bypass-paywalls-clean= myself here, but the m
|
|||
#+begin_src nix :tangle modules/home/common/firefox.nix
|
||||
{ config, pkgs, lib, ... }:
|
||||
{
|
||||
options.swarselsystems.modules.firefox = lib.mkEnableOption "firefox settings";
|
||||
config = lib.mkIf config.swarselsystems.modules.firefox {
|
||||
programs.firefox = {
|
||||
enable = true;
|
||||
package = pkgs.firefox; # uses overrides
|
||||
|
|
@ -10404,6 +10594,7 @@ I used to build the firefox addon =bypass-paywalls-clean= myself here, but the m
|
|||
config.swarselsystems.firefox;
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
#+end_src
|
||||
|
||||
|
|
@ -10424,9 +10615,12 @@ Used for storing sessions in e.g. Nextcloud
|
|||
#+begin_src nix :tangle modules/home/common/gnome-keyring.nix
|
||||
{ lib, config, ... }:
|
||||
{
|
||||
options.swarselsystems.modules.gnome-keyring = lib.mkEnableOption "gnome keyring settings";
|
||||
config = lib.mkIf config.swarselsystems.modules.gnome-keyring {
|
||||
services.gnome-keyring = lib.mkIf (!config.swarselsystems.isNixos) {
|
||||
enable = true;
|
||||
};
|
||||
};
|
||||
}
|
||||
#+end_src
|
||||
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@ let
|
|||
isBtrfs = true;
|
||||
isLinux = true;
|
||||
sharescreen = "eDP-2";
|
||||
profiles.personal = true;
|
||||
};
|
||||
in
|
||||
{
|
||||
|
|
@ -28,6 +29,7 @@ in
|
|||
inputs.home-manager.nixosModules.home-manager
|
||||
{
|
||||
home-manager.users."${primaryUser}".imports = [
|
||||
"${self}/profiles/home"
|
||||
"${modulesPath}/home/optional/gaming.nix"
|
||||
"${modulesPath}/home/optional/work.nix"
|
||||
];
|
||||
|
|
@ -91,7 +93,6 @@ in
|
|||
|
||||
swarselsystems = lib.recursiveUpdate
|
||||
{
|
||||
profiles.personal = true;
|
||||
wallpaper = self + /wallpaper/lenovowp.png;
|
||||
hasBluetooth = true;
|
||||
hasFingerprint = true;
|
||||
|
|
@ -101,7 +102,9 @@ in
|
|||
}
|
||||
sharedOptions;
|
||||
|
||||
home-manager.users."${primaryUser}".swarselsystems = lib.recursiveUpdate
|
||||
home-manager.users."${primaryUser}" = {
|
||||
home.stateVersion = lib.mkForce "23.05";
|
||||
swarselsystems = lib.recursiveUpdate
|
||||
{
|
||||
isLaptop = true;
|
||||
isNixos = true;
|
||||
|
|
@ -229,4 +232,5 @@ in
|
|||
};
|
||||
}
|
||||
sharedOptions;
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,8 @@
|
|||
{ config, pkgs, ... }:
|
||||
{ lib, config, pkgs, ... }:
|
||||
|
||||
{
|
||||
options.swarselsystems.modules.ownpackages = lib.mkEnableOption "own packages settings";
|
||||
config = lib.mkIf config.swarselsystems.modules.ownpackages {
|
||||
home.packages = with pkgs; lib.mkIf (!config.swarselsystems.isPublic) [
|
||||
pass-fuzzel
|
||||
cura5
|
||||
|
|
@ -27,4 +29,5 @@
|
|||
|
||||
rustdesk-vbc
|
||||
];
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,7 @@
|
|||
_:
|
||||
{ lib, config, ... }:
|
||||
{
|
||||
options.swarselsystems.modules.desktop = lib.mkEnableOption "desktop settings";
|
||||
config = lib.mkIf config.swarselsystems.modules.desktop {
|
||||
xdg.desktopEntries = {
|
||||
|
||||
cura = {
|
||||
|
|
@ -89,4 +91,5 @@ _:
|
|||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,8 +1,11 @@
|
|||
_:
|
||||
{ lib, config, ... }:
|
||||
{
|
||||
options.swarselsystems.modules.direnv = lib.mkEnableOption "direnv settings";
|
||||
config = lib.mkIf config.swarselsystems.modules.direnv {
|
||||
programs.direnv = {
|
||||
enable = true;
|
||||
silent = true;
|
||||
nix-direnv.enable = true;
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,7 +3,8 @@ let
|
|||
inherit (config.swarselsystems) homeDir isPublic;
|
||||
in
|
||||
{
|
||||
|
||||
options.swarselsystems.modules.emacs = lib.mkEnableOption "emacs settings";
|
||||
config = lib.mkIf config.swarselsystems.modules.emacs {
|
||||
# needed for elfeed
|
||||
sops.secrets.fever = lib.mkIf (!isPublic) { path = "${homeDir}/.emacs.d/.fever"; };
|
||||
|
||||
|
|
@ -74,4 +75,5 @@ in
|
|||
socketActivation.enable = false;
|
||||
startWithUserSession = "graphical";
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -9,6 +9,8 @@ let
|
|||
allMailAddresses = lib.swarselsystems.getSecret "${secretsDirectory}/mail/list";
|
||||
in
|
||||
{
|
||||
options.swarselsystems.modules.env = lib.mkEnableOption "env settings";
|
||||
config = lib.mkIf config.swarselsystems.modules.env {
|
||||
home.sessionVariables = {
|
||||
EDITOR = "e -w";
|
||||
DISPLAY = ":0";
|
||||
|
|
@ -23,4 +25,5 @@ in
|
|||
SWARSEL_FULLNAME = fullName;
|
||||
SWARSEL_MAIL_ALL = allMailAddresses;
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,7 @@
|
|||
_:
|
||||
{ lib, config, ... }:
|
||||
{
|
||||
options.swarselsystems.modules.eza = lib.mkEnableOption "eza settings";
|
||||
config = lib.mkIf config.swarselsystems.modules.eza {
|
||||
programs.eza = {
|
||||
enable = true;
|
||||
icons = "auto";
|
||||
|
|
@ -9,4 +11,5 @@ _:
|
|||
"--group-directories-first"
|
||||
];
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,7 @@
|
|||
{ config, pkgs, lib, ... }:
|
||||
{
|
||||
options.swarselsystems.modules.firefox = lib.mkEnableOption "firefox settings";
|
||||
config = lib.mkIf config.swarselsystems.modules.firefox {
|
||||
programs.firefox = {
|
||||
enable = true;
|
||||
package = pkgs.firefox; # uses overrides
|
||||
|
|
@ -144,4 +146,5 @@
|
|||
config.swarselsystems.firefox;
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,7 @@
|
|||
_:
|
||||
{ lib, config, ... }:
|
||||
{
|
||||
options.swarselsystems.modules.fuzzel = lib.mkEnableOption "fuzzel settings";
|
||||
config = lib.mkIf config.swarselsystems.modules.fuzzel {
|
||||
programs.fuzzel = {
|
||||
enable = true;
|
||||
settings = {
|
||||
|
|
@ -11,4 +13,5 @@ _:
|
|||
border.radius = "0";
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,10 +1,12 @@
|
|||
{ lib, nix-secrets, ... }:
|
||||
{ lib, config, nix-secrets, ... }:
|
||||
let
|
||||
secretsDirectory = builtins.toString nix-secrets;
|
||||
leonMail = lib.swarselsystems.getSecret "${secretsDirectory}/mail/leon";
|
||||
fullName = lib.swarselsystems.getSecret "${secretsDirectory}/info/fullname";
|
||||
in
|
||||
{
|
||||
options.swarselsystems.modules.git = lib.mkEnableOption "git settings";
|
||||
config = lib.mkIf config.swarselsystems.modules.git {
|
||||
programs.git = {
|
||||
enable = true;
|
||||
aliases = {
|
||||
|
|
@ -41,4 +43,5 @@ in
|
|||
}
|
||||
];
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,9 @@
|
|||
{ lib, config, ... }:
|
||||
{
|
||||
options.swarselsystems.modules.gnome-keyring = lib.mkEnableOption "gnome keyring settings";
|
||||
config = lib.mkIf config.swarselsystems.modules.gnome-keyring {
|
||||
services.gnome-keyring = lib.mkIf (!config.swarselsystems.isNixos) {
|
||||
enable = true;
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,7 @@
|
|||
_:
|
||||
{ lib, config, ... }:
|
||||
{
|
||||
options.swarselsystems.modules.kitty = lib.mkEnableOption "kitty settings";
|
||||
config = lib.mkIf config.swarselsystems.modules.kitty {
|
||||
programs.kitty = {
|
||||
enable = true;
|
||||
keybindings = { };
|
||||
|
|
@ -9,4 +11,5 @@ _:
|
|||
notify_on_cmd_finish = "always 20";
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -8,6 +8,8 @@ let
|
|||
fullName = lib.swarselsystems.getSecret "${secretsDirectory}/info/fullname";
|
||||
in
|
||||
{
|
||||
options.swarselsystems.modules.mail = lib.mkEnableOption "mail settings";
|
||||
config = lib.mkIf config.swarselsystems.modules.mail {
|
||||
programs = {
|
||||
mbsync = {
|
||||
enable = true;
|
||||
|
|
@ -142,4 +144,5 @@ in
|
|||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,7 @@
|
|||
{ self, pkgs, ... }:
|
||||
{ self, lib, config, pkgs, ... }:
|
||||
{
|
||||
options.swarselsystems.modules.nix-index = lib.mkEnableOption "nix-index settings";
|
||||
config = lib.mkIf config.swarselsystems.modules.nix-index {
|
||||
programs.nix-index =
|
||||
let
|
||||
commandNotFound = pkgs.runCommandLocal "command-not-found.sh" { } ''
|
||||
|
|
@ -18,4 +20,5 @@
|
|||
paths = [ commandNotFound ];
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,13 +1,14 @@
|
|||
{ lib, config, nixgl, ... }:
|
||||
{
|
||||
options.swarselsystems = {
|
||||
modules.nixgl = lib.mkEnableOption "nixgl settings";
|
||||
isSecondaryGpu = lib.mkEnableOption "device has a secondary GPU";
|
||||
SecondaryGpuCard = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
default = "";
|
||||
};
|
||||
};
|
||||
config = {
|
||||
config = lib.mkIf config.swarselsystems.modules.nixgl {
|
||||
nixGL = lib.mkIf (!config.swarselsystems.isNixos) {
|
||||
inherit (nixgl) packages;
|
||||
defaultWrapper = lib.mkDefault "mesa";
|
||||
|
|
|
|||
|
|
@ -1,6 +1,8 @@
|
|||
{ pkgs, ... }:
|
||||
{ lib, config, pkgs, ... }:
|
||||
|
||||
{
|
||||
options.swarselsystems.modules.packages = lib.mkEnableOption "packages settings";
|
||||
config = lib.mkIf config.swarselsystems.modules.packages {
|
||||
home.packages = with pkgs; [
|
||||
|
||||
# audio stuff
|
||||
|
|
@ -176,4 +178,5 @@
|
|||
noto-fonts
|
||||
noto-fonts-cjk-sans
|
||||
];
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,7 @@
|
|||
{ pkgs, ... }:
|
||||
{ lib, config, pkgs, ... }:
|
||||
{
|
||||
options.swarselsystems.modules.passwordstore = lib.mkEnableOption "passwordstore settings";
|
||||
config = lib.mkIf config.swarselsystems.modules.passwordstore {
|
||||
programs.password-store = {
|
||||
enable = true;
|
||||
settings = {
|
||||
|
|
@ -7,4 +9,5 @@
|
|||
};
|
||||
package = pkgs.pass.withExtensions (exts: [ exts.pass-otp ]);
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,7 @@
|
|||
{ pkgs, ... }:
|
||||
{ lib, config, pkgs, ... }:
|
||||
{
|
||||
options.swarselsystems.modules.programs = lib.mkEnableOption "programs settings";
|
||||
config = lib.mkIf config.swarselsystems.modules.programs {
|
||||
programs = {
|
||||
bottom.enable = true;
|
||||
imv.enable = true;
|
||||
|
|
@ -19,4 +21,5 @@
|
|||
fzf.enable = true;
|
||||
zoxide.enable = true;
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,6 +3,8 @@ let
|
|||
inherit (config.swarselsystems) mainUser;
|
||||
in
|
||||
{
|
||||
options.swarselsystems.modules.general = lib.mkEnableOption "general nix settings";
|
||||
config = lib.mkIf config.swarselsystems.modules.general {
|
||||
nix = lib.mkIf (!config.swarselsystems.isNixos) {
|
||||
settings = {
|
||||
experimental-features = [
|
||||
|
|
@ -40,5 +42,6 @@ in
|
|||
FLAKE = "/home/${mainUser}/.dotfiles";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,6 +3,8 @@ let
|
|||
inherit (config.swarselsystems) homeDir xdgDir;
|
||||
in
|
||||
{
|
||||
options.swarselsystems.modules.sops = lib.mkEnableOption "sops settings";
|
||||
config = lib.mkIf config.swarselsystems.modules.sops {
|
||||
sops = lib.mkIf (!config.swarselsystems.isPublic) {
|
||||
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";
|
||||
|
|
@ -17,4 +19,5 @@ in
|
|||
u2f_keys = { path = "${homeDir}/.config/Yubico/u2f_keys"; };
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,7 @@
|
|||
_:
|
||||
{ lib, config, ... }:
|
||||
{
|
||||
options.swarselsystems.modules.ssh = lib.mkEnableOption "ssh settings";
|
||||
config = lib.mkIf config.swarselsystems.modules.ssh {
|
||||
programs.ssh = {
|
||||
enable = true;
|
||||
forwardAgent = true;
|
||||
|
|
@ -34,4 +36,5 @@ _:
|
|||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,7 @@
|
|||
_:
|
||||
{ lib, config, ... }:
|
||||
{
|
||||
options.swarselsystems.modules.starship = lib.mkEnableOption "starship settings";
|
||||
config = lib.mkIf config.swarselsystems.modules.starship {
|
||||
programs.starship = {
|
||||
enable = true;
|
||||
enableZshIntegration = true;
|
||||
|
|
@ -118,4 +120,5 @@ _:
|
|||
scala.symbol = " ";
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,9 +1,12 @@
|
|||
{ lib, config, ... }:
|
||||
{
|
||||
options.swarselsystems.modules.stylix = lib.mkEnableOption "stylix settings";
|
||||
config = lib.mkIf config.swarselsystems.modules.stylix {
|
||||
stylix = lib.mkIf (!config.swarselsystems.isNixos) (lib.recursiveUpdate
|
||||
{
|
||||
image = config.swarselsystems.wallpaper;
|
||||
targets = config.swarselsystems.stylixHomeTargets;
|
||||
}
|
||||
config.swarselsystems.stylix);
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -180,13 +180,18 @@
|
|||
"${modifier}+Print" = "exec screenshare";
|
||||
# exec swaymsg move workspace to "$(swaymsg -t get_outputs | jq '[.[] | select(.active == true)] | .[(map(.focused) | index(true) + 1) % length].name')"
|
||||
# "XF86AudioRaiseVolume" = "exec pa 5%";
|
||||
"XF86AudioRaiseVolume" = "exec pamixer -i 5";
|
||||
# "XF86AudioRaiseVolume" = "exec pamixer -i 5";
|
||||
"XF86AudioRaiseVolume" = "exec swayosd-client --output-volume raise";
|
||||
# "XF86AudioLowerVolume" = "exec pactl set-sink-volume @DEFAULT_SINK@ -5%";
|
||||
"XF86AudioLowerVolume" = "exec pamixer -d 5";
|
||||
# "XF86AudioLowerVolume" = "exec pamixer -d 5";
|
||||
"XF86AudioLowerVolume" = "exec swayosd-client --output-volume lower";
|
||||
# "XF86AudioMute" = "exec pactl set-sink-mute @DEFAULT_SINK@ toggle";
|
||||
"XF86AudioMute" = "exec pamixer -t";
|
||||
"XF86MonBrightnessUp" = "exec brightnessctl set +5%";
|
||||
"XF86MonBrightnessDown" = "exec brightnessctl set 5%-";
|
||||
# "XF86AudioMute" = "exec pamixer -t";
|
||||
"XF86AudioMute" = "exec swayosd-client --output-volume mute-toggle";
|
||||
# "XF86MonBrightnessUp" = "exec brightnessctl set +5%";
|
||||
"XF86MonBrightnessUp" = "exec swayosd-client --brightness raise";
|
||||
# "XF86MonBrightnessDown" = "exec brightnessctl set 5%-";
|
||||
"XF86MonBrightnessDown" = "exec swayosd-client --brightness lower";
|
||||
"XF86Display" = "exec wl-mirror eDP-1";
|
||||
}
|
||||
config.swarselsystems.keybindings;
|
||||
|
|
@ -388,6 +393,7 @@
|
|||
|
||||
exec kanshi
|
||||
exec_always kill -1 $(pidof kanshi)
|
||||
exec swayosd-server
|
||||
|
||||
bindswitch --locked lid:on exec kanshictl switch lidclosed
|
||||
bindswitch --locked lid:off exec kanshictl switch lidopen
|
||||
|
|
|
|||
|
|
@ -1,5 +1,7 @@
|
|||
{ self, lib, ... }:
|
||||
{ self, lib, config, ... }:
|
||||
{
|
||||
options.swarselsystems.modules.symlink = lib.mkEnableOption "symlink settings";
|
||||
config = lib.mkIf config.swarselsystems.modules.symlink {
|
||||
home.file = {
|
||||
"init.el" = lib.mkDefault {
|
||||
source = self + /programs/emacs/init.el;
|
||||
|
|
@ -26,4 +28,5 @@
|
|||
"tridactyl/themes/swarsel.css".source = self + /programs/firefox/tridactyl/themes/swarsel.css;
|
||||
"swayidle/config".source = self + /programs/swayidle/config;
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
{ pkgs, ... }:
|
||||
{ lib, config, pkgs, ... }:
|
||||
let
|
||||
tmux-super-fingers = pkgs.tmuxPlugins.mkTmuxPlugin
|
||||
{
|
||||
|
|
@ -13,7 +13,8 @@ let
|
|||
};
|
||||
in
|
||||
{
|
||||
|
||||
options.swarselsystems.modules.tmux = lib.mkEnableOption "tmux settings";
|
||||
config = lib.mkIf config.swarselsystems.modules.tmux {
|
||||
home.packages = with pkgs; [
|
||||
lsof
|
||||
sesh
|
||||
|
|
@ -94,4 +95,5 @@ in
|
|||
|
||||
'';
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -22,6 +22,7 @@ let
|
|||
in
|
||||
{
|
||||
options.swarselsystems = {
|
||||
modules.waybar = lib.mkEnableOption "waybar settings";
|
||||
cpuCount = lib.mkOption {
|
||||
type = lib.types.int;
|
||||
default = 8;
|
||||
|
|
@ -50,7 +51,7 @@ in
|
|||
internal = true;
|
||||
};
|
||||
};
|
||||
config = {
|
||||
config = lib.mkIf config.swarselsystems.modules.waybar {
|
||||
swarselsystems = {
|
||||
waybarModules = lib.mkIf config.swarselsystems.isLaptop (modulesLeft ++ [
|
||||
"battery"
|
||||
|
|
|
|||
|
|
@ -1,14 +1,17 @@
|
|||
{ lib, nix-secrets, ... }:
|
||||
{ lib, config, nix-secrets, ... }:
|
||||
let
|
||||
secretsDirectory = builtins.toString nix-secrets;
|
||||
yubikey1 = lib.swarselsystems.getSecret "${secretsDirectory}/yubikey/yubikey1";
|
||||
yubikey2 = lib.swarselsystems.getSecret "${secretsDirectory}/yubikey/yubikey2";
|
||||
in
|
||||
{
|
||||
options.swarselsystems.modules.yubikey = lib.mkEnableOption "yubikey settings";
|
||||
config = lib.mkIf config.swarselsystems.modules.yubikey {
|
||||
pam.yubico.authorizedYubiKeys = {
|
||||
ids = [
|
||||
"${yubikey1}"
|
||||
"${yubikey2}"
|
||||
];
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
{ self, config, pkgs, ... }:
|
||||
{ self, lib, config, pkgs, ... }:
|
||||
{
|
||||
|
||||
options.swarselsystems.modules.zellij = lib.mkEnableOption "zellij settings";
|
||||
config = lib.mkIf config.swarselsystems.modules.zellij {
|
||||
programs.zellij = {
|
||||
enable = true;
|
||||
enableZshIntegration = true;
|
||||
|
|
@ -14,5 +15,6 @@
|
|||
"zellij/config.kdl".text = import "${self}/programs/zellij/config.kdl.nix" { inherit config; };
|
||||
"zellij/layouts/default.kdl".text = import "${self}/programs/zellij/layouts/default.kdl.nix" { inherit config pkgs; };
|
||||
};
|
||||
};
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,12 +4,13 @@ let
|
|||
in
|
||||
{
|
||||
options.swarselsystems = {
|
||||
modules.zsh = lib.mkEnableOption "zsh settings";
|
||||
shellAliases = lib.mkOption {
|
||||
type = lib.types.attrsOf lib.types.str;
|
||||
default = { };
|
||||
};
|
||||
};
|
||||
config = {
|
||||
config = lib.mkIf config.swarselsystems.modules.zsh {
|
||||
programs.zsh = {
|
||||
enable = true;
|
||||
shellAliases = lib.recursiveUpdate
|
||||
|
|
|
|||
|
|
@ -143,7 +143,7 @@ in
|
|||
|
||||
udev.extraRules = ''
|
||||
# share screen when dongle detected
|
||||
SUBSYSTEM=="usb", ACTION=="add", ATTRS{idVendor}=="04e8", ATTRS{idProduct}=="6860", TAG+="systemd", ENV{SYSTEMD_WANTS}="swarsel-screenshare.service"
|
||||
SUBSYSTEM=="usb", ACTION=="add", ATTRS{idVendor}=="343c", ATTRS{idProduct}=="0000", TAG+="systemd", ENV{SYSTEMD_WANTS}="swarsel-screenshare.service"
|
||||
|
||||
# lock screen when yubikey removed
|
||||
ACTION=="remove", ENV{PRODUCT}=="3/1050/407/110", RUN+="${pkgs.systemd}/bin/systemctl suspend"
|
||||
|
|
|
|||
|
|
@ -1,5 +1,7 @@
|
|||
{ lib, ... }:
|
||||
let
|
||||
moduleNames = lib.swarselsystems.readNix "profiles/home";
|
||||
profileNames = lib.swarselsystems.readNix "profiles/home";
|
||||
in
|
||||
lib.swarselsystems.mkProfiles moduleNames "home"
|
||||
{
|
||||
imports = lib.swarselsystems.mkImports profileNames "profiles/home";
|
||||
}
|
||||
|
|
|
|||
36
profiles/home/personal/default.nix
Normal file
36
profiles/home/personal/default.nix
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
{ lib, config, ... }:
|
||||
{
|
||||
options.swarselsystems.profiles.personal = lib.mkEnableOption "is this a personal host";
|
||||
config = lib.mkIf config.swarselsystems.profiles.personal {
|
||||
swarselsystems.modules = {
|
||||
packages = lib.mkDefault true;
|
||||
ownpackages = lib.mkDefault true;
|
||||
general = lib.mkDefault true;
|
||||
nixgl = lib.mkDefault true;
|
||||
sops = lib.mkDefault true;
|
||||
yubikey = lib.mkDefault true;
|
||||
ssh = lib.mkDefault true;
|
||||
stylix = lib.mkDefault true;
|
||||
desktop = lib.mkDefault true;
|
||||
symlink = lib.mkDefault true;
|
||||
env = lib.mkDefault true;
|
||||
programs = lib.mkDefault true;
|
||||
nix-index = lib.mkDefault true;
|
||||
direnv = lib.mkDefault true;
|
||||
eza = lib.mkDefault true;
|
||||
git = lib.mkDefault true;
|
||||
fuzzel = lib.mkDefault true;
|
||||
starship = lib.mkDefault true;
|
||||
kitty = lib.mkDefault true;
|
||||
zsh = lib.mkDefault true;
|
||||
zellij = lib.mkDefault true;
|
||||
tmux = lib.mkDefault true;
|
||||
mail = lib.mkDefault true;
|
||||
emacs = lib.mkDefault true;
|
||||
waybar = lib.mkDefault true;
|
||||
firefox = lib.mkDefault true;
|
||||
gnome-keyring = lib.mkDefault true;
|
||||
};
|
||||
};
|
||||
|
||||
}
|
||||
|
|
@ -1,5 +1,7 @@
|
|||
{ lib, ... }:
|
||||
let
|
||||
moduleNames = lib.swarselsystems.readNix "profiles/nixos";
|
||||
profileNames = lib.swarselsystems.readNix "profiles/nixos";
|
||||
in
|
||||
lib.swarselsystems.mkProfiles moduleNames "nixos"
|
||||
{
|
||||
imports = lib.swarselsystems.mkImports profileNames "profiles/nixos";
|
||||
}
|
||||
|
|
|
|||
37
profiles/nixos/localserver/default.nix
Normal file
37
profiles/nixos/localserver/default.nix
Normal file
|
|
@ -0,0 +1,37 @@
|
|||
{ lib, config, ... }:
|
||||
{
|
||||
options.swarselsystems.profiles.server.local = lib.mkEnableOption "is this a local server";
|
||||
config = lib.mkIf config.swarselsystems.profiles.server.local {
|
||||
swarselsystems = {
|
||||
# common modules
|
||||
modules = {
|
||||
nix-ld = lib.mkDefault true;
|
||||
home-manager = lib.mkDefault true;
|
||||
home-managerExtra = lib.mkDefault true;
|
||||
xserver = lib.mkDefault true;
|
||||
gc = lib.mkDefault true;
|
||||
storeOptimize = lib.mkDefault true;
|
||||
time = lib.mkDefault true;
|
||||
users = lib.mkDefault true;
|
||||
};
|
||||
# server modules
|
||||
# server = {
|
||||
# kavita = lib.mkDefault true;
|
||||
# jellyfin = lib.mkDefault true;
|
||||
# navidrome = lib.mkDefault true;
|
||||
# spotifyd = lib.mkDefault true;
|
||||
# mpd = lib.mkDefault true;
|
||||
# matrix = lib.mkDefault true;
|
||||
# nextcloud = lib.mkDefault true;
|
||||
# immich = lib.mkDefault true;
|
||||
# paperless = lib.mkDefault true;
|
||||
# transmission = lib.mkDefault true;
|
||||
# syncthing = lib.mkDefault true;
|
||||
# monitoring = lib.mkDefault true;
|
||||
# emacs = lib.mkDefault true;
|
||||
# freshrss = lib.mkDefault true;
|
||||
# };
|
||||
};
|
||||
};
|
||||
|
||||
}
|
||||
|
|
@ -1,8 +1,8 @@
|
|||
{ lib, config, ... }:
|
||||
{
|
||||
options.swarselsystems.profiles.personalz = lib.mkEnableOption "is this a personal host";
|
||||
config = lib.mkIf config.swarselsystems.profiles.personalz {
|
||||
config.swarselsystems.modules = {
|
||||
options.swarselsystems.profiles.personal = lib.mkEnableOption "is this a personal host";
|
||||
config = lib.mkIf config.swarselsystems.profiles.personal {
|
||||
swarselsystems.modules = {
|
||||
packages = lib.mkDefault true;
|
||||
general = lib.mkDefault true;
|
||||
home-manager = lib.mkDefault true;
|
||||
|
|
|
|||
25
profiles/nixos/syncserver/default.nix
Normal file
25
profiles/nixos/syncserver/default.nix
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
{ lib, config, ... }:
|
||||
{
|
||||
options.swarselsystems.profiles.server.sync = lib.mkEnableOption "is this a oci sync server";
|
||||
config = lib.mkIf config.swarselsystems.profiles.server.sync {
|
||||
swarselsystems = {
|
||||
# common modules
|
||||
modules = {
|
||||
nix-ld = lib.mkDefault true;
|
||||
home-manager = lib.mkDefault true;
|
||||
home-managerExtra = lib.mkDefault true;
|
||||
xserver = lib.mkDefault true;
|
||||
gc = lib.mkDefault true;
|
||||
storeOptimize = lib.mkDefault true;
|
||||
time = lib.mkDefault true;
|
||||
users = lib.mkDefault true;
|
||||
};
|
||||
# server modules
|
||||
# server = {
|
||||
# forgejo = lib.mkDefault true;
|
||||
# ankisync = lib.mkDefault true;
|
||||
# };
|
||||
};
|
||||
};
|
||||
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue