Compare commits

..

No commits in common. "06ec1df09a1f313ce543380feeab3d8651e63a8f" and "641a0cd84df01481c7949739215786aaff460109" have entirely different histories.

184 changed files with 2308 additions and 2574 deletions

5
.github/README.md vendored
View file

@ -122,13 +122,13 @@ Alternatively, to install this from any NixOS live ISO, run `nix run --experimen
### Services ### Services
| Topic | Program | | Topic | Program |
|-----------------------|---------------------------------------------------------------------------------------------------------------------| |-----------------------|---------------------------------|
|📖 **Books** | [Kavita](https://github.com/Swarsel/.dotfiles/tree/main/modules/nixos/server/kavita.nix) | |📖 **Books** | [Kavita](https://github.com/Swarsel/.dotfiles/tree/main/modules/nixos/server/kavita.nix) |
|📼 **Videos** | [Jellyfin](https://github.com/Swarsel/.dotfiles/tree/main/modules/nixos/server/jellyfin.nix) | |📼 **Videos** | [Jellyfin](https://github.com/Swarsel/.dotfiles/tree/main/modules/nixos/server/jellyfin.nix) |
|🎵 **Music** | [Navidrome](https://github.com/Swarsel/.dotfiles/tree/main/modules/nixos/server/navidrome.nix) + [Spotifyd](https://github.com/Swarsel/.dotfiles/tree/main/modules/nixos/server/spotifyd.nix) + [MPD](https://github.com/Swarsel/.dotfiles/tree/main/modules/nixos/server/mpd.nix) | |🎵 **Music** | [Navidrome](https://github.com/Swarsel/.dotfiles/tree/main/modules/nixos/server/navidrome.nix) + [Spotifyd](https://github.com/Swarsel/.dotfiles/tree/main/modules/nixos/server/spotifyd.nix) + [MPD](https://github.com/Swarsel/.dotfiles/tree/main/modules/nixos/server/mpd.nix) |
|🗨️ **Messaging** | [Matrix](https://github.com/Swarsel/.dotfiles/tree/main/modules/nixos/server/matrix.nix) | |🗨️ **Messaging** | [Matrix](https://github.com/Swarsel/.dotfiles/tree/main/modules/nixos/server/matrix.nix) |
|📁 **Filesharing** | [Nectcloud](https://github.com/Swarsel/.dotfiles/tree/main/modules/nixos/server/nextcloud.nix) | |📁 **Filesharing** | [Nectcloud](https://github.com/Swarsel/.dotfiles/tree/main/modules/nixos/server/nextcloud.nix) |
|🎞️ **Photos** | [Immich](https://github.com/Swarsel/.dotfiles/tree/main/modules/nixos/server/immich.nix) | |📷 **Photos** | [Immich](https://github.com/Swarsel/.dotfiles/tree/main/modules/nixos/server/immich.nix) |
|📄 **Documents** | [Paperless](https://github.com/Swarsel/.dotfiles/tree/main/modules/nixos/server/paperless.nix) | |📄 **Documents** | [Paperless](https://github.com/Swarsel/.dotfiles/tree/main/modules/nixos/server/paperless.nix) |
|🔄 **File Sync** | [Syncthing](https://github.com/Swarsel/.dotfiles/tree/main/modules/nixos/server/syncthing.nix) | |🔄 **File Sync** | [Syncthing](https://github.com/Swarsel/.dotfiles/tree/main/modules/nixos/server/syncthing.nix) |
|💾 **Backups** | [Restic](https://github.com/Swarsel/.dotfiles/tree/main/modules/nixos/server/restic.nix) | |💾 **Backups** | [Restic](https://github.com/Swarsel/.dotfiles/tree/main/modules/nixos/server/restic.nix) |
@ -143,7 +143,6 @@ Alternatively, to install this from any NixOS live ISO, run `nix run --experimen
|📅 **CalDav/CardDav** | [Radicale](https://github.com/Swarsel/.dotfiles/tree/main/modules/nixos/server/radicale.nix) | |📅 **CalDav/CardDav** | [Radicale](https://github.com/Swarsel/.dotfiles/tree/main/modules/nixos/server/radicale.nix) |
|↔️ **P2P Filesharing** | [Croc](https://github.com/Swarsel/.dotfiles/tree/main/modules/nixos/server/croc.nix) | |↔️ **P2P Filesharing** | [Croc](https://github.com/Swarsel/.dotfiles/tree/main/modules/nixos/server/croc.nix) |
|✂️ **Paste Tool** | [Microbin](https://github.com/Swarsel/.dotfiles/tree/main/modules/nixos/server/microbin.nix) | |✂️ **Paste Tool** | [Microbin](https://github.com/Swarsel/.dotfiles/tree/main/modules/nixos/server/microbin.nix) |
|📸 **Image Sharing** | [Slink](https://github.com/Swarsel/.dotfiles/tree/main/modules/nixos/server/slink.nix) |
|🔗 **Link Shortener** | [Shlink](https://github.com/Swarsel/.dotfiles/tree/main/modules/nixos/server/shlink.nix) | |🔗 **Link Shortener** | [Shlink](https://github.com/Swarsel/.dotfiles/tree/main/modules/nixos/server/shlink.nix) |
### Hosts ### Hosts

File diff suppressed because it is too large Load diff

View file

@ -1,13 +1,12 @@
;; -*- lexical-binding: t; -*- (defvar swarsel-file-name-handler-alist file-name-handler-alist)
(defvar swarsel-file-name-handler-alist file-name-handler-alist) (defvar swarsel-vc-handled-backends vc-handled-backends)
(defvar swarsel-vc-handled-backends vc-handled-backends)
(setq gc-cons-threshold most-positive-fixnum (setq gc-cons-threshold most-positive-fixnum
gc-cons-percentage 0.6 gc-cons-percentage 0.6
file-name-handler-alist nil file-name-handler-alist nil
vc-handled-backends nil) vc-handled-backends nil)
(add-hook 'emacs-startup-hook (add-hook 'emacs-startup-hook
(lambda () (lambda ()
(progn (progn
(setq gc-cons-threshold (* 32 1024 1024) (setq gc-cons-threshold (* 32 1024 1024)

View file

@ -1,6 +1,4 @@
;; -*- lexical-binding: t; -*- (defun swarsel/toggle-evil-state ()
(defun swarsel/toggle-evil-state ()
(interactive) (interactive)
(if (or (evil-emacs-state-p) (evil-insert-state-p)) (if (or (evil-emacs-state-p) (evil-insert-state-p))
(evil-normal-state) (evil-normal-state)
@ -36,7 +34,7 @@
(insert (format "%s <%s>" (or from-user user-full-name) from-addr))))))) (insert (format "%s <%s>" (or from-user user-full-name) from-addr)))))))
(defun swarsel/mu4e-restore-default () (defun swarsel/mu4e-restore-default ()
(setq user-mail-address (getenv "SWARSEL_MAIL4") (setq user-mail-address (getenv "SWARSEL_SWARSEL_MAIL")
user-full-name (getenv "SWARSEL_FULLNAME"))) user-full-name (getenv "SWARSEL_FULLNAME")))
(defun swarsel/with-buffer-name-prompt-and-make-subdirs () (defun swarsel/with-buffer-name-prompt-and-make-subdirs ()
@ -1583,11 +1581,11 @@ create a new one."
:init :init
;; set org-caldav-sync-initalization ;; set org-caldav-sync-initalization
(setq swarsel-caldav-synced 0) (setq swarsel-caldav-synced 0)
;; (setq org-caldav-url "https://schedule.swarsel.win/swarsel/calendar") (setq org-caldav-url "https://stash.swarsel.win/remote.php/dav/calendars/Swarsel")
;; (setq org-caldav-calendars (setq org-caldav-calendars
;; '((:calendar-id "personal" '((:calendar-id "personal"
;; :inbox "~/Calendars/leon_cal.org"))) :inbox "~/Calendars/leon_cal.org")))
;; (setq org-caldav-files '("~/Calendars/leon_cal.org")) (setq org-caldav-files '("~/Calendars/leon_cal.org"))
;; (setq org-caldav-backup-file "~/org-caldav/org-caldav-backup.org") ;; (setq org-caldav-backup-file "~/org-caldav/org-caldav-backup.org")
;; (setq org-caldav-save-directory "~/org-caldav/") ;; (setq org-caldav-save-directory "~/org-caldav/")
@ -1614,14 +1612,6 @@ create a new one."
:config :config
(bind-key "g" 'cfw:refresh-calendar-buffer cfw:calendar-mode-map) (bind-key "g" 'cfw:refresh-calendar-buffer cfw:calendar-mode-map)
(bind-key "q" 'evil-quit cfw:details-mode-map) (bind-key "q" 'evil-quit cfw:details-mode-map)
;; dont change the order of days in this one, as it will break weekend markings
(setq calendar-day-name-array
["Sunday" "Monday" "Tuesday" "Wednesday" "Thursday" "Friday" "Saturday"])
;; First day of the week
(setq calendar-week-start-day 1) ; 0:Sunday, 1:Monday
;; (custom-set-faces ;; (custom-set-faces
;; '(cfw:face-title ((t (:foreground "#f0dfaf" :weight bold :height 65)))) ;; '(cfw:face-title ((t (:foreground "#f0dfaf" :weight bold :height 65))))
;; ) ;; )
@ -1629,17 +1619,14 @@ create a new one."
(defun swarsel/open-calendar () (defun swarsel/open-calendar ()
(interactive) (interactive)
;; (unless (eq swarsel-caldav-synced 1) (org-caldav-sync) (setq swarsel-caldav-synced 1)) (unless (eq swarsel-caldav-synced 1) (org-caldav-sync) (setq swarsel-caldav-synced 1))
;; (select-frame (make-frame '((name . "calendar")))) ; makes a new frame and selects it ;; (select-frame (make-frame '((name . "calendar")))) ; makes a new frame and selects it
;; (set-face-attribute 'default (selected-frame) :height 65) ; reduces the font size of the new frame ;; (set-face-attribute 'default (selected-frame) :height 65) ; reduces the font size of the new frame
(cfw:open-calendar-buffer (cfw:open-calendar-buffer
:contents-sources :contents-sources
(list (list
(cfw:org-create-source "Blue") ; orgmode source (cfw:org-create-source "Purple") ; orgmode source
(cfw:ical-create-source (getenv "SWARSEL_CAL1NAME") (getenv "SWARSEL_CAL1") "Cyan") (cfw:ical-create-source "TISS" "https://tiss.tuwien.ac.at/events/rest/calendar/personal?locale=de&token=4463bf7a-87a3-490a-b54c-99b4a65192f3" "Cyan"))))
(cfw:ical-create-source (getenv "SWARSEL_CAL2NAME") (getenv "SWARSEL_CAL2") "Green")
(cfw:ical-create-source (getenv "SWARSEL_CAL3NAME") (getenv "SWARSEL_CAL3") "Magenta")
)))
(use-package dashboard (use-package dashboard
:ensure t :ensure t
@ -1709,41 +1696,3 @@ create a new one."
(setq message-log-max 30) (setq message-log-max 30)
(setq comint-buffer-maximum-size 50) (setq comint-buffer-maximum-size 50)
(add-hook 'comint-output-filter-functions 'comint-truncate-buffer) (add-hook 'comint-output-filter-functions 'comint-truncate-buffer)
(defun prot-window-delete-popup-frame (&rest _)
"Kill selected selected frame if it has parameter `prot-window-popup-frame'.
Use this function via a hook."
(when (frame-parameter nil 'prot-window-popup-frame)
(delete-frame)))
(defmacro prot-window-define-with-popup-frame (command)
"Define interactive function which calls COMMAND in a new frame.
Make the new frame have the `prot-window-popup-frame' parameter."
`(defun ,(intern (format "prot-window-popup-%s" command)) ()
,(format "Run `%s' in a popup frame with `prot-window-popup-frame' parameter.
Also see `prot-window-delete-popup-frame'." command)
(interactive)
(let ((frame (make-frame '((prot-window-popup-frame . t)))))
(select-frame frame)
(modify-frame-parameters nil '((title . "Emacs Popup Frame")))
(switch-to-buffer " prot-window-hidden-buffer-for-popup-frame")
(condition-case nil
(call-interactively ',command)
((quit error user-error)
(delete-frame frame))))))
(declare-function org-capture "org-capture" (&optional goto keys))
(defvar org-capture-after-finalize-hook)
;;;###autoload (autoload 'prot-window-popup-org-capture "prot-window")
(prot-window-define-with-popup-frame org-capture)
(add-hook 'org-capture-after-finalize-hook #'prot-window-delete-popup-frame)
(declare-function mu4e "mu4e" (&optional goto keys))
;;;###autoload (autoload 'prot-window-popup-mu4e "prot-window")
(prot-window-define-with-popup-frame mu4e)
(advice-add 'mu4e-quit :after #'prot-window-delete-popup-frame)
(declare-function swarsel/open-calendar "swarsel/open-calendar" (&optional goto keys))
;;;###autoload (autoload 'prot-window-popup-swarsel/open-calendar "prot-window")
(prot-window-define-with-popup-frame swarsel/open-calendar)
(advice-add 'bury-buffer :after #'prot-window-delete-popup-frame)

6
flake.lock generated
View file

@ -1618,11 +1618,11 @@
}, },
"nixpkgs-dev": { "nixpkgs-dev": {
"locked": { "locked": {
"lastModified": 1752736260, "lastModified": 1752440522,
"narHash": "sha256-90Gt98hmw/20aOAd7KaSW6otXu7MOBctRmI9RlXD/s0=", "narHash": "sha256-CInQkEG3f8XwIBQxYFhuFCT+T++JPstThfifAMD0yRk=",
"owner": "Swarsel", "owner": "Swarsel",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "169c3483f7c06fbb58c9346e4d9d112c8aa7827e", "rev": "1f569e3bd49502cb4ec312214662d93619cf2c54",
"type": "github" "type": "github"
}, },
"original": { "original": {

View file

@ -6,8 +6,6 @@
inputs.sops-nix.homeManagerModules.sops inputs.sops-nix.homeManagerModules.sops
inputs.nix-index-database.hmModules.nix-index inputs.nix-index-database.hmModules.nix-index
"${self}/modules/home" "${self}/modules/home"
"${self}/modules/nixos/common/pii.nix"
"${self}/modules/nixos/common/meta.nix"
]; ];
nixpkgs = { nixpkgs = {

View file

@ -1,7 +1,17 @@
{ self, config, inputs, lib, minimal, ... }: { self, config, inputs, lib, minimal, ... }:
let let
primaryUser = config.swarselsystems.mainUser; primaryUser = config.swarselsystems.mainUser;
sharedOptions = { }; sharedOptions = {
isLaptop = true;
isNixos = true;
isBtrfs = true;
isLinux = true;
sharescreen = "eDP-1";
profiles = {
reduced = lib.mkIf (!minimal) true;
minimal = lib.mkIf minimal true;
};
};
in in
{ {
@ -13,20 +23,9 @@ in
]; ];
swarselprofiles = {
reduced = lib.mkIf (!minimal) true;
btrfs = true;
};
swarselsystems = lib.recursiveUpdate swarselsystems = lib.recursiveUpdate
{ {
isLaptop = true;
isNixos = true;
isBtrfs = true;
isLinux = true;
lowResolution = "1280x800";
highResolution = "1920x1080";
sharescreen = "eDP-1";
info = "Lenovo ThinkPad"; info = "Lenovo ThinkPad";
firewall = lib.mkForce true; firewall = lib.mkForce true;
wallpaper = self + /files/wallpaper/lenovowp.png; wallpaper = self + /files/wallpaper/lenovowp.png;
@ -39,12 +38,18 @@ in
rootDisk = "/dev/nvme0n1"; rootDisk = "/dev/nvme0n1";
swapSize = "4G"; swapSize = "4G";
hostName = config.node.name; hostName = config.node.name;
profiles = {
btrfs = true;
};
} }
sharedOptions; sharedOptions;
home-manager.users."${primaryUser}" = { home-manager.users."${primaryUser}" = {
# home.stateVersion = lib.mkForce "23.05"; # home.stateVersion = lib.mkForce "23.05";
swarselsystems = { swarselsystems = lib.recursiveUpdate
{
lowResolution = "1280x800";
highResolution = "1920x1080";
monitors = { monitors = {
main = { main = {
name = "LG Display 0x04EF Unknown"; name = "LG Display 0x04EF Unknown";
@ -55,6 +60,7 @@ in
output = "eDP-1"; output = "eDP-1";
}; };
}; };
}; }
sharedOptions;
}; };
} }

View file

@ -1,6 +1,16 @@
{ self, config, pkgs, lib, minimal, ... }: { self, config, pkgs, lib, minimal, ... }:
let let
mainUser = "demo"; mainUser = "demo";
sharedOptions = {
inherit mainUser;
isBtrfs = false;
isLinux = true;
isPublic = true;
profiles = {
chaostheatre = lib.mkIf (!minimal) true;
minimal = lib.mkIf minimal true;
};
};
in in
{ {
@ -29,12 +39,8 @@ in
firewall.enable = true; firewall.enable = true;
}; };
swarselprofiles = { swarselsystems = lib.recursiveUpdate
chaostheatre = lib.mkIf (!minimal) true; {
minimal = lib.mkIf minimal true;
btrfs = true;
};
swarselsystems = {
info = "~SwarselSystems~ demo host"; info = "~SwarselSystems~ demo host";
wallpaper = self + /files/wallpaper/lenovowp.png; wallpaper = self + /files/wallpaper/lenovowp.png;
isImpermanence = true; isImpermanence = true;
@ -43,11 +49,16 @@ in
isSwap = true; isSwap = true;
swapSize = "4G"; swapSize = "4G";
rootDisk = "/dev/vda"; rootDisk = "/dev/vda";
isBtrfs = false; profiles.btrfs = true;
inherit mainUser; }
isLinux = true; sharedOptions;
isPublic = true;
isNixos = true;
};
home-manager.users.${mainUser} = {
home.stateVersion = lib.mkForce "23.05";
swarselsystems = lib.recursiveUpdate
{
isNixos = true;
}
sharedOptions;
};
} }

View file

@ -1,4 +1,15 @@
{ lib, minimal, ... }: { lib, config, minimal, ... }:
let
primaryUser = config.swarselsystems.mainUser;
sharedOptions = {
isBtrfs = true;
isLinux = true;
isNixos = true;
};
profiles = {
minimal = lib.mkIf minimal true;
};
in
{ {
imports = [ imports = [
./hardware-configuration.nix ./hardware-configuration.nix
@ -21,11 +32,8 @@
enableAllFirmware = lib.mkForce false; enableAllFirmware = lib.mkForce false;
}; };
swarselprofiles = { swarselsystems = lib.recursiveUpdate
minimal = lib.mkIf minimal true; {
server.syncserver = true;
};
swarselsystems = {
info = "VM.Standard.E2.1.Micro"; info = "VM.Standard.E2.1.Micro";
isImpermanence = true; isImpermanence = true;
isSecureBoot = false; isSecureBoot = false;
@ -33,9 +41,16 @@
isSwap = true; isSwap = true;
rootDisk = "/dev/sda"; rootDisk = "/dev/sda";
swapSize = "4G"; swapSize = "4G";
isBtrfs = true; profiles = {
isLinux = true; server.syncserver = true;
isNixos = true; };
}
sharedOptions;
home-manager.users."${primaryUser}" = {
swarselsystems = lib.recursiveUpdate
{ }
sharedOptions;
}; };
} }

View file

@ -1,7 +1,16 @@
{ lib, config, ... }: { lib, config, globals, ... }:
let let
primaryUser = config.swarselsystems.mainUser;
inherit (config.repo.secrets.common) workHostName;
inherit (config.repo.secrets.local.syncthing) dev1 dev2 dev3 loc1; inherit (config.repo.secrets.local.syncthing) dev1 dev2 dev3 loc1;
inherit (config.swarselsystems) sopsFile; inherit (config.swarselsystems) sopsFile;
serviceDomain = config.repo.secrets.common.services.domains.syncthing3;
sharedOptions = {
isBtrfs = true;
isNixos = true;
isLinux = true;
};
in in
{ {
imports = [ imports = [
@ -24,6 +33,15 @@ in
environment = { environment = {
etc."issue".text = "\4"; etc."issue".text = "\4";
persistence."/persist".directories = lib.mkIf config.swarselsystems.isImpermanence [
{
directory = "/var/lib/syncthing";
user = "syncthing";
group = "syncthing";
mode = "0700";
}
];
}; };
topology.self.interfaces.wg = { topology.self.interfaces.wg = {
@ -70,10 +88,44 @@ in
system.stateVersion = "23.11"; system.stateVersion = "23.11";
services.syncthing = { globals.services."syncthing-${config.networking.hostName}".domain = serviceDomain;
dataDir = lib.mkForce "/sync";
services = {
nginx = {
virtualHosts = {
${serviceDomain} = {
enableACME = true;
forceSSL = true;
acmeRoot = null;
locations = {
"/" = {
proxyPass = "http://localhost:8384";
extraConfig = ''
client_max_body_size 0;
'';
};
};
};
};
};
syncthing = {
enable = true;
guiAddress = "0.0.0.0:8384";
openDefaultPorts = true;
relay.enable = false;
settings = { settings = {
devices = config.swarselsystems.syncthing.devices // { urAccepted = -1;
devices = {
"magicant" = {
id = "VMWGEE2-4HDS2QO-KNQOVGN-LXLX6LA-666E4EK-ZBRYRRO-XFEX6FB-6E3XLQO";
};
"winters" = {
id = "O7RWDMD-AEAHPP7-7TAVLKZ-BSWNBTU-2VA44MS-EYGUNBB-SLHKB3C-ZSLMOAA";
};
"${workHostName}" = {
id = "YAPV4BV-I26WPTN-SIP32MV-SQP5TBZ-3CHMTCI-Z3D6EP2-MNDQGLP-53FT3AB";
};
"${dev1}" = { "${dev1}" = {
id = "OCCDGDF-IPZ6HHQ-5SSLQ3L-MSSL5ZW-IX5JTAM-PW4PYEK-BRNMJ7E-Q7YDMA7"; id = "OCCDGDF-IPZ6HHQ-5SSLQ3L-MSSL5ZW-IX5JTAM-PW4PYEK-BRNMJ7E-Q7YDMA7";
}; };
@ -85,6 +137,43 @@ in
}; };
}; };
folders = { folders = {
"Default Folder" = lib.mkForce {
path = "/sync/Sync";
type = "receiveonly";
versioning = null;
devices = [ "winters" "magicant" "${workHostName}" ];
id = "default";
};
"Obsidian" = {
path = "/sync/Obsidian";
type = "receiveonly";
versioning = {
type = "simple";
params.keep = "5";
};
devices = [ "winters" "magicant" "${workHostName}" ];
id = "yjvni-9eaa7";
};
"Org" = {
path = "/sync/Org";
type = "receiveonly";
versioning = {
type = "simple";
params.keep = "5";
};
devices = [ "winters" "magicant" "${workHostName}" ];
id = "a7xnl-zjj3d";
};
"Vpn" = {
path = "/sync/Vpn";
type = "receiveonly";
versioning = {
type = "simple";
params.keep = "5";
};
devices = [ "winters" "magicant" "${workHostName}" ];
id = "hgp9s-fyq3p";
};
"Documents" = { "Documents" = {
path = "/sync/Documents"; path = "/sync/Documents";
type = "receiveonly"; type = "receiveonly";
@ -92,7 +181,7 @@ in
type = "simple"; type = "simple";
params.keep = "2"; params.keep = "2";
}; };
devices = [ "pyramid" ]; devices = [ "winters" ];
id = "hgr3d-pfu3w"; id = "hgr3d-pfu3w";
}; };
"runandbun" = { "runandbun" = {
@ -118,24 +207,27 @@ in
}; };
}; };
}; };
swarselprofiles = {
server.moonside = true;
}; };
swarselsystems = { swarselsystems = lib.recursiveUpdate
{
info = "VM.Standard.A1.Flex, 4 OCPUs, 24GB RAM"; info = "VM.Standard.A1.Flex, 4 OCPUs, 24GB RAM";
isImpermanence = true; isImpermanence = true;
isSecureBoot = false; isSecureBoot = false;
isCrypted = false; isCrypted = false;
isSwap = false; isSwap = false;
rootDisk = "/dev/sda"; rootDisk = "/dev/sda";
isBtrfs = true; profiles = {
isNixos = true; server.moonside = true;
isLinux = true;
syncthing = {
serviceDomain = config.repo.secrets.common.services.domains.syncthing3;
serviceIP = "localhost";
}; };
}
sharedOptions;
home-manager.users."${primaryUser}" = {
home.stateVersion = lib.mkForce "23.11";
swarselsystems = lib.recursiveUpdate
{ }
sharedOptions;
}; };
} }

View file

@ -1,6 +1,19 @@
{ self, config, inputs, lib, minimal, ... }: { self, config, inputs, lib, minimal, ... }:
let let
primaryUser = config.swarselsystems.mainUser; primaryUser = config.swarselsystems.mainUser;
sharedOptions = {
isLaptop = true;
isNixos = true;
isBtrfs = true;
isLinux = true;
sharescreen = "eDP-2";
profiles = {
personal = lib.mkIf (!minimal) true;
minimal = lib.mkIf minimal true;
work = lib.mkIf (!minimal) true;
framework = lib.mkIf (!minimal) true;
};
};
in in
{ {
@ -13,23 +26,8 @@ in
]; ];
swarselprofiles = { swarselsystems = lib.recursiveUpdate
personal = lib.mkIf (!minimal) true; {
work = lib.mkIf (!minimal) true;
framework = lib.mkIf (!minimal) true;
amdcpu = true;
amdgpu = true;
hibernation = true;
btrfs = true;
};
swarselsystems = {
lowResolution = "1280x800";
highResolution = "2560x1600";
isLaptop = true;
isNixos = true;
isBtrfs = true;
isLinux = true;
sharescreen = "eDP-2";
info = "Framework Laptop 16, 7940HS, RX7700S, 64GB RAM"; info = "Framework Laptop 16, 7940HS, RX7700S, 64GB RAM";
firewall = lib.mkForce true; firewall = lib.mkForce true;
wallpaper = self + /files/wallpaper/lenovowp.png; wallpaper = self + /files/wallpaper/lenovowp.png;
@ -41,10 +39,19 @@ in
inherit (config.repo.secrets.local) hostName; inherit (config.repo.secrets.local) hostName;
inherit (config.repo.secrets.local) fqdn; inherit (config.repo.secrets.local) fqdn;
hibernation.offset = 533760; hibernation.offset = 533760;
profiles = {
amdcpu = true;
amdgpu = true;
hibernation = true;
btrfs = true;
}; };
}
sharedOptions;
home-manager.users."${primaryUser}" = { home-manager.users."${primaryUser}" = {
swarselsystems = { # home.stateVersion = lib.mkForce "23.05";
swarselsystems = lib.recursiveUpdate
{
isSecondaryGpu = true; isSecondaryGpu = true;
SecondaryGpuCard = "pci-0000_03_00_0"; SecondaryGpuCard = "pci-0000_03_00_0";
cpuCount = 16; cpuCount = 16;
@ -53,6 +60,8 @@ in
path = "/sys/devices/virtual/thermal/thermal_zone0/"; path = "/sys/devices/virtual/thermal/thermal_zone0/";
input-filename = "temp4_input"; input-filename = "temp4_input";
}; };
lowResolution = "1280x800";
highResolution = "2560x1600";
monitors = { monitors = {
main = { main = {
name = "BOE 0x0BC9 Unknown"; name = "BOE 0x0BC9 Unknown";
@ -63,6 +72,7 @@ in
output = "eDP-2"; output = "eDP-2";
}; };
}; };
}; }
sharedOptions;
}; };
} }

View file

@ -1,4 +1,15 @@
{ self, lib, minimal, ... }: { self, config, lib, minimal, ... }:
let
primaryUser = config.swarselsystems.mainUser;
sharedOptions = {
isBtrfs = true;
isLinux = true;
profiles = {
toto = lib.mkIf (!minimal) true;
minimal = lib.mkIf minimal true;
};
};
in
{ {
imports = [ imports = [
@ -6,17 +17,15 @@
./hardware-configuration.nix ./hardware-configuration.nix
]; ];
networking = { networking = {
hostName = "toto"; hostName = "toto";
firewall.enable = false; firewall.enable = false;
}; };
swarselprofiles = { swarselsystems = lib.recursiveUpdate
toto = lib.mkIf (!minimal) true; {
btrfs = true;
};
swarselsystems = {
info = "~SwarselSystems~ remote install helper"; info = "~SwarselSystems~ remote install helper";
wallpaper = self + /files/wallpaper/lenovowp.png; wallpaper = self + /files/wallpaper/lenovowp.png;
isImpermanence = true; isImpermanence = true;
@ -26,11 +35,18 @@
swapSize = "2G"; swapSize = "2G";
# rootDisk = "/dev/nvme0n1"; # rootDisk = "/dev/nvme0n1";
rootDisk = "/dev/vda"; rootDisk = "/dev/vda";
profiles.btrfs = true;
# rootDisk = "/dev/vda"; # rootDisk = "/dev/vda";
isBtrfs = true; }
isLinux = true; sharedOptions;
home-manager.users.${primaryUser} = {
home.stateVersion = lib.mkForce "23.05";
swarselsystems = lib.recursiveUpdate
{
isLaptop = false; isLaptop = false;
isNixos = true; isNixos = true;
}
sharedOptions;
}; };
} }

View file

@ -1,4 +1,15 @@
{ config, ... }: { lib, config, ... }:
let
primaryUser = config.swarselsystems.mainUser;
sharedOptions = {
isBtrfs = false;
isLinux = true;
isNixos = true;
profiles = {
server.local = true;
};
};
in
{ {
imports = [ imports = [
@ -19,18 +30,19 @@
}; };
swarselprofiles = { swarselsystems = lib.recursiveUpdate
server.local = true; {
};
swarselsystems = {
info = "ASRock J4105-ITX, 32GB RAM"; info = "ASRock J4105-ITX, 32GB RAM";
isImpermanence = false; isImpermanence = false;
isSecureBoot = true; isSecureBoot = true;
isCrypted = true; isCrypted = true;
isBtrfs = false; }
isLinux = true; sharedOptions;
isNixos = true;
};
home-manager.users."${primaryUser}" = {
home.stateVersion = lib.mkForce "23.05";
swarselsystems = lib.recursiveUpdate
{ }
sharedOptions;
};
} }

View file

@ -1,5 +1,5 @@
{ {
"data": "ENC[AES256_GCM,data:Ow17QtITRfXk4BJGWb4jw1gX8HRIAdpBDpyGtif3Vb42cCqSWpLaIR1KecbU3OPkGesC/vh2tgmfE/xlm6nUR8kvRDZdhFr7UckeKFiD4hlfHBhGckaCXOiRZ3ACHrHfM/a2CbKDl14xLDMFDervdMRfB/4vjvnn9xvhjepZ1e7+Iopd9agL8r658AMFF3j2tRYZp7l5GLArs+7mUsFfXujkui1Xgh5+TRvYPh3zQ18RWyP4QMYP6HPHgHRH7S6uciUb6Qq1yEytOy3pCJTb+gZaa9xI1azzP7r83b7KeXdukupR+9fNWN52swDHXRugThMrh4kOrBdyaafJ1v2w4FTTPwj6JQvkxT+vMV4+WIclhD/FWtEHtUqsHDFnMzTIQfyTMt42HZKNdQDwp2fwuV1BP0qOUqRnheaTPiyZiZL8I27xDfwp5zfSqxA7KEzLL2uRbIPefdqNFlcte/xL9IkbTux+AmHaIjQeLkiPyMf2wc2NTIabWPk/ILC917vnancdAQuujB38SaWPrKeCEqDKsArvgjnmn47ctBND73G4PszieneCnuq4sNT9QrC81mk/AQv5TFG0i0fvPoXfpO4ul7MgaP+iPodb2CThHKDAwL+Gnq/6+tg+vJbTKxrsixHvYViA9p/ke1YaRFg2R8V7NwRDl68NI2yCaqj3qlS6Sa8Mx7IUQR6aCN4nkpcJs2GLVCEhWKFBsNXXhPa01C/81JGJ6+/zfHuGbY6gGtS7k3cZ9+dfizN29nBlp+A1U+Noxjl9arYOX4gjEnQhvo9Tp/gBCmrvXjoE6ja8XXUv78/Bfnvup52gdNunYRYv3Aj91F0u6fH6UqoWPXVTy6eznV727Pj9H1BPzMEfmf3EPc6Qcg7AR7vKORfH3U0PFXxFMY0kGEJdug5jmLuwUoRR9zOyHOqdS4Tk9BcMT02gRyQf6LZ3drDoqC35L5hop/gfbleUXXODn3cE1mEuAuZ08OSavZ24IHo1aMr50gjn32WSBKkjfC0dobBWzWwykxhu0vZZI3xYJx/59qqsodDGAJAhry5N6vrwM/PK/O73L2QBqkaT50eImIQ4+vpahcvFPRIkHLvQkzxlyH0dafuGyyF2gfig5Rq3vw02pT8z06LjmJ/ehvteyy1BE9CdiUvYHjaBXiWg2n5FvAe5e8EQxUx9+SwfwEpnucuocp7g+d3W3cXJOU6m9JxwvK7LX95MbpKOtdPq11yi35LLb1TikFLdFZyu+SeaNFD3AzQMOSem6Lwc7N7WHC5z3Ah7FvqqnL2J51hDfMLW78A7DCI9GNRVoyVjx++gRr+ftEf8UUAYmkJdT/D898wtLWmBXikY/2e36q3QJV0Hy3fGBjxLmN/Tdz62jgCaXrNdJqJTFZ5h+hjd03GT6utmPwp0D2lBSM0LXsZsql+jI54P8cFdu3S4mNIjHZqV1kmsk0MCCVJKnGODeLQLxJhp287N3+0HJEm4KicGWMchef/YeiLLtD7mz7ov/9OI,iv:KvoTnlj+f+eMsFEZP8F1v0r/xZ4aVBUWmO+zsQCvhS4=,tag:U1ziE2832QfNkP0yjIzBeA==,type:str]", "data": "ENC[AES256_GCM,data:XEzKhJ1+iwQZ24wnf7FdThWMwOKEwaYr3ecGjjLpTqx4+kq3W9FWFDSKkHAwo6077tsVTu7NCGZfat/gAylg1xgqAZAHA8/PMQejowAgIPCG7eCQvQfTMepcuWjgc9BAyFYcBjPFmLnvX69LE80Fw0Io1QeKIa6CVJKp4P6eC8OIKeG1fTc3/sWxr+3ZKTzGPKiGCnSMo7qM0/2HlV0bhp8yWFni+2nZ8UlPJluEnmx0bBR0uZ6bdqzLX/fFrmgTd6m30+Zq8pjKVhiHpEQd9m5aU2inCWv4OeNE3EQsLYcnhcVdrcySZ6R4AZ1nlZZedDhf+Ee4AwcIPVsA8HHqlUEY1CayHF5wLpkxralOpt+RFZYJkvupmozP/uYRymoAA6YgJGesr2Oki0wT041nioB9AvpU9xFvfCqbqXXsBvwtvhxpwhEJJOogZENKnjvvoDoLGZlFVPzkfqDANuv5SAJQiWuFLWEdcmQncRlsjwSPOGOnI+r+puHszPOaDsZigF/yuL4rd5a0RkS6dCOfYtCvQBBAMfEAWX13AiKF0Dtz5/ijEEK7iojoMF/B6rnoENs2l0cSljq7TGV0DVRDjFUTiMNbfRxUJUkMuqJFnNzMwz4METmAwgqHn217uvUk2V8UJ5v9k4sapRmogPTfCwhvxGDV1e9AJvL6WXJ2m0ldhKOcQXFiO/+ZtNB1FHJ22ZFcxcSSOSRmEQsB5Yw3zPEjQ7sU93sKRLEPrTEqSSNG75iZ+vZm9iEI2trFhtEOlU98Ury/USC9sjPN/sxGGR5hcRZajY2HUxVTucMheIWJ7mxhxLHg7rz/qWLSqC6TqKwnyv+NdBnrVaLWaRnZGRCgtvN+oJKRjyxCsiDHVoY52cP5SmdXGn3yrVxDuYGrkLf/JOj76Hs/TCSsYptMvKqH4R4vT8SlDnplpcIfd5KTr4sM1n4q4sai1wRc1wlN0EkwK7+otTYcStxtvgUUtW/4jkk+73TdvvR9IkV0PqghKuB6FdAM6qRX1M8AebcXNyZYW9k7sHRVWGk+eMrMe/qX2IAY1WUgdt7hs2Ci9XoJqWKCG17rcKZ/ORu0utrJt+l0H9fZihO8+aYHabsHueiyJTKJvZx9+12r5a6deXShtdpsdQVnMlczWKGKUIdQ7TB12HILGPAvvZkJh0aDq043UU/4dUwyUezi70QnH/Z/GRip68kXH6njBmZRlmmNAFSCHkGxMKxpgssHyXXNEvET/TIVEJeR1vYjqFoGIBrFQV1Bqu2yk3A2pZLBEEbsCQrOuE2CPpfrn5kCUnw2sJOWpnVqyQ+SA4xZ7W1vw7i8aL2ThZlKE3zsriECpOfEaDWv8ME2HsiL42VUmgv+6zm/2hiVK+OayQucBUbY8IC6Yjl2kXB7EPvUsc60V2xOJl40KIAJxa0GNgaRMWkYoFtnVrYbY4yT37UjIAu2fJD725qgkXOJwbFPlX7na86PVVB0MQ==,iv:JSG8DynJg8t7HEDoW7IwYt189P22h4BPMFYsJmo3mcU=,tag:cHoNQBL2DCpntJyhqay54Q==,type:str]",
"sops": { "sops": {
"age": [ "age": [
{ {
@ -7,8 +7,8 @@
"enc": "-----BEGIN AGE ENCRYPTED FILE-----\nYWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSAyK0w2RjJ5R1l2ay94QXRj\nekJwSlowcFVLc1cvWVFjNEVFUnFocEJHYlNnCnBnUEYvNWdNWE9BTjB5ODRuTlAw\nMUh4QmlTeVVYNHM0S1FwWG5qUG42VDgKLS0tIHh5VlU2dVZmUlRIMDRlVEJmNU55\ncFlXR1BzMkVnMkFWN3BBZWhHalltMlEKibdARxBcFqaXUhYp3KkrrvO9YgaBDacl\n8BEv4ph0f2baDN0dsymJjmdHStwKTjOwDspRtCTs5u75hR35a2xyFQ==\n-----END AGE ENCRYPTED FILE-----\n" "enc": "-----BEGIN AGE ENCRYPTED FILE-----\nYWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSAyK0w2RjJ5R1l2ay94QXRj\nekJwSlowcFVLc1cvWVFjNEVFUnFocEJHYlNnCnBnUEYvNWdNWE9BTjB5ODRuTlAw\nMUh4QmlTeVVYNHM0S1FwWG5qUG42VDgKLS0tIHh5VlU2dVZmUlRIMDRlVEJmNU55\ncFlXR1BzMkVnMkFWN3BBZWhHalltMlEKibdARxBcFqaXUhYp3KkrrvO9YgaBDacl\n8BEv4ph0f2baDN0dsymJjmdHStwKTjOwDspRtCTs5u75hR35a2xyFQ==\n-----END AGE ENCRYPTED FILE-----\n"
} }
], ],
"lastmodified": "2025-07-17T20:14:29Z", "lastmodified": "2025-07-02T10:26:33Z",
"mac": "ENC[AES256_GCM,data:4YP1fp9Mcbx0pvS5l9Xzc5cbhFnBo5GkqyRvcEspNYQ3IW5LIWtPwItwLZH/ymfEkpwIVYOugnB12HJJo9jpudgfUMXtp43ImDUNVHs59qkNhJFmTSoEZMBHQjPtE/jE17OIAZzeA41EAItesrmExV1W8ePy7rTgHQl5BDooWME=,iv:vyZ0BGjMUDeoVMkDw6wLZK3KKIECK5caz/nQB3nXlGs=,tag:GAqKNcSf3Ny/WsB3tYM/og==,type:str]", "mac": "ENC[AES256_GCM,data:/rmQKH7up3IcAdyYpdpx6H6gdyiNsnPS6TaozSU0EXxoaods50xC5sf2/quqLaeSRJE/NjKvh+3BWchbFJMQZM4PvSML3XAO8w9t/GqmOwwLJrvnMyulqS5y7BVDJZysmDe9TFNz05UJfZdbvLrH8kyhTHF7ciA8HgJq5JzFiBc=,iv:ORyza5fzjptuq5WD3NA9/OTFbACtzHp5e6kNKT/EaTE=,tag:wsp3Z/ySHVmDC9uRCn30Uw==,type:str]",
"pgp": [ "pgp": [
{ {
"created_at": "2025-06-11T11:42:23Z", "created_at": "2025-06-11T11:42:23Z",

View file

@ -24,4 +24,4 @@ dd DRIVE ISO:
sudo dd if=$(eza --sort changed {{ISO}} | tail -n1) of={{DRIVE}} bs=4M status=progress oflag=sync sudo dd if=$(eza --sort changed {{ISO}} | tail -n1) of={{DRIVE}} bs=4M status=progress oflag=sync
sync USER HOST: sync USER HOST:
rsync -rltv --filter=':- .gitignore' -e "ssh -l {{USER}}" . {{USER}}@{{HOST}}:.dotfiles/ rsync -av --filter=':- .gitignore' -e "ssh -l {{USER}}" . {{USER}}@{{HOST}}:.dotfiles/

View file

@ -3,8 +3,8 @@ let
atuinDomain = globals.services.atuin.domain; atuinDomain = globals.services.atuin.domain;
in in
{ {
options.swarselmodules.atuin = lib.mkEnableOption "atuin settings"; options.swarselsystems.modules.atuin = lib.mkEnableOption "atuin settings";
config = lib.mkIf config.swarselmodules.atuin { config = lib.mkIf config.swarselsystems.modules.atuin {
programs.atuin = { programs.atuin = {
enable = true; enable = true;
enableZshIntegration = true; enableZshIntegration = true;

View file

@ -1,8 +1,8 @@
{ lib, config, pkgs, ... }: { lib, config, pkgs, ... }:
{ {
options.swarselmodules.ownpackages = lib.mkEnableOption "own packages settings"; options.swarselsystems.modules.ownpackages = lib.mkEnableOption "own packages settings";
config = lib.mkIf config.swarselmodules.ownpackages { config = lib.mkIf config.swarselsystems.modules.ownpackages {
home.packages = with pkgs; lib.mkIf (!config.swarselsystems.isPublic) [ home.packages = with pkgs; lib.mkIf (!config.swarselsystems.isPublic) [
pass-fuzzel pass-fuzzel
cdw cdw

View file

@ -1,9 +1,7 @@
{ lib, ... }: { lib, ... }:
let let
importNames = lib.swarselsystems.readNix "modules/home/common"; importNames = lib.swarselsystems.readNix "modules/home/common";
sharedNames = lib.swarselsystems.readNix "modules/shared";
in in
{ {
imports = lib.swarselsystems.mkImports importNames "modules/home/common" ++ imports = lib.swarselsystems.mkImports importNames "modules/home/common";
lib.swarselsystems.mkImports sharedNames "modules/shared";
} }

View file

@ -1,7 +1,7 @@
{ lib, config, ... }: { lib, config, ... }:
{ {
options.swarselmodules.desktop = lib.mkEnableOption "desktop settings"; options.swarselsystems.modules.desktop = lib.mkEnableOption "desktop settings";
config = lib.mkIf config.swarselmodules.desktop { config = lib.mkIf config.swarselsystems.modules.desktop {
xdg.desktopEntries = { xdg.desktopEntries = {
cura = { cura = {

View file

@ -1,7 +1,7 @@
{ lib, config, ... }: { lib, config, ... }:
{ {
options.swarselmodules.direnv = lib.mkEnableOption "direnv settings"; options.swarselsystems.modules.direnv = lib.mkEnableOption "direnv settings";
config = lib.mkIf config.swarselmodules.direnv { config = lib.mkIf config.swarselsystems.modules.direnv {
programs.direnv = { programs.direnv = {
enable = true; enable = true;
silent = true; silent = true;

View file

@ -1,26 +1,12 @@
{ self, lib, config, pkgs, globals, ... }: { self, lib, config, pkgs, ... }:
let let
inherit (config.swarselsystems) homeDir isPublic isNixos; inherit (config.swarselsystems) homeDir isPublic;
inherit (config.repo.secrets.common.emacs) radicaleUser;
in in
{ {
options.swarselmodules.emacs = lib.mkEnableOption "emacs settings"; options.swarselsystems.modules.emacs = lib.mkEnableOption "emacs settings";
config = lib.mkIf config.swarselmodules.emacs { config = lib.mkIf config.swarselsystems.modules.emacs {
# needed for elfeed # needed for elfeed
sops = lib.mkIf (!isPublic && !isNixos) { sops.secrets.fever-pw = lib.mkIf (!isPublic) { path = "${homeDir}/.emacs.d/.fever"; };
secrets = {
fever-pw = { path = "${homeDir}/.emacs.d/.fever"; };
emacs-radicale-pw = { };
};
templates = {
authinfo = {
path = "${homeDir}/.emacs.d/.authinfo";
content = ''
machine ${globals.services.radicale.domain} login ${radicaleUser} password ${config.sops.placeholder.emacs-radicale-pw}
'';
};
};
};
# enable emacs overlay for bleeding edge features # enable emacs overlay for bleeding edge features
# also read init.el file and install use-package packages # also read init.el file and install use-package packages

View file

@ -1,33 +1,24 @@
{ lib, config, globals, nixosConfig ? config, ... }: { lib, config, globals, nixosConfig, ... }:
let let
inherit (nixosConfig.repo.secrets.common.mail) address1 address2 address3 address4 allMailAddresses; inherit (nixosConfig.repo.secrets.common.mail) address1 address2 address3 address4 allMailAddresses;
inherit (nixosConfig.repo.secrets.common.calendar) source1 source1-name source2 source2-name source3 source3-name;
inherit (nixosConfig.repo.secrets.common) fullName; inherit (nixosConfig.repo.secrets.common) fullName;
inherit (config.swarselsystems) isPublic;
crocDomain = globals.services.croc.domain; crocDomain = globals.services.croc.domain;
in in
{ {
options.swarselmodules.env = lib.mkEnableOption "env settings"; options.swarselsystems.modules.env = lib.mkEnableOption "env settings";
config = lib.mkIf config.swarselmodules.env { config = lib.mkIf config.swarselsystems.modules.env {
home.sessionVariables = { home.sessionVariables = {
EDITOR = "e -w"; EDITOR = "e -w";
DISPLAY = ":0"; DISPLAY = ":0";
CROC_RELAY = crocDomain;
SWARSEL_LO_RES = config.swarselsystems.lowResolution; SWARSEL_LO_RES = config.swarselsystems.lowResolution;
SWARSEL_HI_RES = config.swarselsystems.highResolution; SWARSEL_HI_RES = config.swarselsystems.highResolution;
CROC_RELAY = lib.mkIf (!isPublic) crocDomain;
}; };
systemd.user.sessionVariables = lib.mkIf (!isPublic) { systemd.user.sessionVariables = lib.mkIf (config.swarselsystems.isNixos && !config.swarselsystems.isPublic) {
GITHUB_NOTIFICATION_TOKEN_PATH = nixosConfig.sops.secrets.github-notifications-token.path;
SWARSEL_MAIL1 = address1; SWARSEL_MAIL1 = address1;
SWARSEL_MAIL2 = address2; SWARSEL_MAIL2 = address2;
SWARSEL_MAIL3 = address3; SWARSEL_MAIL3 = address3;
SWARSEL_MAIL4 = address4; SWARSEL_MAIL4 = address4;
SWARSEL_CAL1 = source1;
SWARSEL_CAL1NAME = source1-name;
SWARSEL_CAL2 = source2;
SWARSEL_CAL2NAME = source2-name;
SWARSEL_CAL3 = source3;
SWARSEL_CAL3NAME = source3-name;
SWARSEL_FULLNAME = fullName; SWARSEL_FULLNAME = fullName;
SWARSEL_MAIL_ALL = allMailAddresses; SWARSEL_MAIL_ALL = allMailAddresses;
}; };

View file

@ -1,7 +1,7 @@
{ lib, config, ... }: { lib, config, ... }:
{ {
options.swarselmodules.eza = lib.mkEnableOption "eza settings"; options.swarselsystems.modules.eza = lib.mkEnableOption "eza settings";
config = lib.mkIf config.swarselmodules.eza { config = lib.mkIf config.swarselsystems.modules.eza {
programs.eza = { programs.eza = {
enable = true; enable = true;
icons = "auto"; icons = "auto";

View file

@ -1,7 +1,7 @@
{ config, pkgs, lib, vars, ... }: { config, pkgs, lib, ... }:
{ {
options.swarselmodules.firefox = lib.mkEnableOption "firefox settings"; options.swarselsystems.modules.firefox = lib.mkEnableOption "firefox settings";
config = lib.mkIf config.swarselmodules.firefox { config = lib.mkIf config.swarselsystems.modules.firefox {
programs.firefox = { programs.firefox = {
enable = true; enable = true;
package = pkgs.firefox; # uses overrides package = pkgs.firefox; # uses overrides
@ -143,7 +143,7 @@
"browser.startup.homepage" = "https://lobste.rs"; "browser.startup.homepage" = "https://lobste.rs";
}; };
} }
vars.firefox; config.swarselsystems.firefox;
}; };
}; };
}; };

View file

@ -1,7 +1,7 @@
{ lib, config, ... }: { lib, config, ... }:
{ {
options.swarselmodules.fuzzel = lib.mkEnableOption "fuzzel settings"; options.swarselsystems.modules.fuzzel = lib.mkEnableOption "fuzzel settings";
config = lib.mkIf config.swarselmodules.fuzzel { config = lib.mkIf config.swarselsystems.modules.fuzzel {
programs.fuzzel = { programs.fuzzel = {
enable = true; enable = true;
settings = { settings = {

View file

@ -1,10 +1,10 @@
{ lib, config, nixosConfig ? config, ... }: { lib, config, nixosConfig, ... }:
let let
inherit (nixosConfig.repo.secrets.common.location) latitude longitude; inherit (nixosConfig.repo.secrets.common.location) latitude longitude;
in in
{ {
options.swarselmodules.gammastep = lib.mkEnableOption "gammastep settings"; options.swarselsystems.modules.gammastep = lib.mkEnableOption "gammastep settings";
config = lib.mkIf config.swarselmodules.gammastep { config = lib.mkIf config.swarselsystems.modules.gammastep {
services.gammastep = lib.mkIf (config.swarselsystems.isNixos && !config.swarselsystems.isPublic) { services.gammastep = lib.mkIf (config.swarselsystems.isNixos && !config.swarselsystems.isPublic) {
enable = true; enable = true;
provider = "manual"; provider = "manual";

View file

@ -1,4 +1,4 @@
{ lib, config, globals, minimal, nixosConfig ? config, ... }: { lib, config, globals, minimal, nixosConfig, ... }:
let let
inherit (nixosConfig.repo.secrets.common.mail) address1; inherit (nixosConfig.repo.secrets.common.mail) address1;
inherit (nixosConfig.repo.secrets.common) fullName; inherit (nixosConfig.repo.secrets.common) fullName;
@ -6,8 +6,8 @@ let
gitUser = globals.user.name; gitUser = globals.user.name;
in in
{ {
options.swarselmodules.git = lib.mkEnableOption "git settings"; options.swarselsystems.modules.git = lib.mkEnableOption "git settings";
config = lib.mkIf config.swarselmodules.git { config = lib.mkIf config.swarselsystems.modules.git {
programs.git = { programs.git = {
enable = true; enable = true;
} // lib.optionalAttrs (!minimal) { } // lib.optionalAttrs (!minimal) {

View file

@ -1,7 +1,7 @@
{ lib, config, ... }: { lib, config, ... }:
{ {
options.swarselmodules.gnome-keyring = lib.mkEnableOption "gnome keyring settings"; options.swarselsystems.modules.gnome-keyring = lib.mkEnableOption "gnome keyring settings";
config = lib.mkIf config.swarselmodules.gnome-keyring { config = lib.mkIf config.swarselsystems.modules.gnome-keyring {
services.gnome-keyring = lib.mkIf (!config.swarselsystems.isNixos) { services.gnome-keyring = lib.mkIf (!config.swarselsystems.isNixos) {
enable = true; enable = true;
}; };

View file

@ -3,8 +3,8 @@ let
inherit (config.swarselsystems) mainUser homeDir; inherit (config.swarselsystems) mainUser homeDir;
in in
{ {
options.swarselmodules.gpgagent = lib.mkEnableOption "gpg agent settings"; options.swarselsystems.modules.gpgagent = lib.mkEnableOption "gpg agent settings";
config = lib.mkIf config.swarselmodules.gpgagent { config = lib.mkIf config.swarselsystems.modules.gpgagent {
services.gpg-agent = { services.gpg-agent = {
enable = true; enable = true;
enableZshIntegration = true; enableZshIntegration = true;

View file

@ -1,7 +1,7 @@
{ lib, config, ... }: { lib, config, ... }:
{ {
options.swarselmodules.kanshi = lib.mkEnableOption "kanshi settings"; options.swarselsystems.modules.kanshi = lib.mkEnableOption "kanshi settings";
config = lib.mkIf config.swarselmodules.kanshi { config = lib.mkIf config.swarselsystems.modules.kanshi {
swarselsystems = { swarselsystems = {
monitors = { monitors = {
homedesktop = { homedesktop = {

View file

@ -1,7 +1,7 @@
{ lib, config, ... }: { lib, config, ... }:
{ {
options.swarselmodules.kdeconnect = lib.mkEnableOption "kdeconnect settings"; options.swarselsystems.modules.kdeconnect = lib.mkEnableOption "kdeconnect settings";
config = lib.mkIf config.swarselmodules.kdeconnect { config = lib.mkIf config.swarselsystems.modules.kdeconnect {
services.kdeconnect = { services.kdeconnect = {
enable = true; enable = true;
indicator = true; indicator = true;

View file

@ -1,7 +1,7 @@
{ lib, config, ... }: { lib, config, ... }:
{ {
options.swarselmodules.kitty = lib.mkEnableOption "kitty settings"; options.swarselsystems.modules.kitty = lib.mkEnableOption "kitty settings";
config = lib.mkIf config.swarselmodules.kitty { config = lib.mkIf config.swarselsystems.modules.kitty {
programs.kitty = { programs.kitty = {
enable = true; enable = true;
keybindings = { }; keybindings = { };

View file

@ -1,14 +1,14 @@
{ lib, config, nixosConfig ? config, ... }: { lib, config, nixosConfig, ... }:
let let
inherit (nixosConfig.repo.secrets.common.mail) address1 address2 address2-name address3 address3-name address4 address4-user address4-host; inherit (nixosConfig.repo.secrets.common.mail) address1 address2 address2-name address3 address3-name address4 address4-user address4-host;
inherit (nixosConfig.repo.secrets.common) fullName; inherit (nixosConfig.repo.secrets.common) fullName;
inherit (config.swarselsystems) xdgDir; inherit (config.swarselsystems) xdgDir;
in in
{ {
options.swarselmodules.mail = lib.mkEnableOption "mail settings"; options.swarselsystems.modules.mail = lib.mkEnableOption "mail settings";
config = lib.mkIf config.swarselmodules.mail { config = lib.mkIf config.swarselsystems.modules.mail {
sops.secrets = lib.mkIf (!config.swarselsystems.isPublic && !config.swarselsystems.isNixos) { sops.secrets = lib.mkIf (!config.swarselsystems.isPublic) {
address1-token = { path = "${xdgDir}/secrets/address1-token"; }; address1-token = { path = "${xdgDir}/secrets/address1-token"; };
address2-token = { path = "${xdgDir}/secrets/address2-token"; }; address2-token = { path = "${xdgDir}/secrets/address2-token"; };
address3-token = { path = "${xdgDir}/secrets/address3-token"; }; address3-token = { path = "${xdgDir}/secrets/address3-token"; };
@ -42,7 +42,7 @@ in
address = address1; address = address1;
userName = address1; userName = address1;
realName = fullName; realName = fullName;
passwordCommand = "cat ${nixosConfig.sops.secrets.address1-token.path}"; passwordCommand = "cat ${config.sops.secrets.address1-token.path}";
gpg = { gpg = {
key = "0x76FD3810215AE097"; key = "0x76FD3810215AE097";
signByDefault = true; signByDefault = true;
@ -74,7 +74,7 @@ in
address = address4; address = address4;
userName = address4-user; userName = address4-user;
realName = fullName; realName = fullName;
passwordCommand = "cat ${nixosConfig.sops.secrets.address4-token.path}"; passwordCommand = "cat ${config.sops.secrets.address4-token.path}";
smtp = { smtp = {
host = address4-host; host = address4-host;
port = 587; port = 587;
@ -97,7 +97,7 @@ in
address = address2; address = address2;
userName = address2; userName = address2;
realName = address2-name; realName = address2-name;
passwordCommand = "cat ${nixosConfig.sops.secrets.address2-token.path}"; passwordCommand = "cat ${config.sops.secrets.address2-token.path}";
imap.host = "imap.gmail.com"; imap.host = "imap.gmail.com";
smtp.host = "smtp.gmail.com"; smtp.host = "smtp.gmail.com";
msmtp.enable = true; msmtp.enable = true;
@ -124,7 +124,7 @@ in
address = address3; address = address3;
userName = address3; userName = address3;
realName = address3-name; realName = address3-name;
passwordCommand = "cat ${nixosConfig.sops.secrets.address3-token.path}"; passwordCommand = "cat ${config.sops.secrets.address3-token.path}";
imap.host = "imap.gmail.com"; imap.host = "imap.gmail.com";
smtp.host = "smtp.gmail.com"; smtp.host = "smtp.gmail.com";
msmtp.enable = true; msmtp.enable = true;

View file

@ -1,7 +1,7 @@
{ lib, config, ... }: { lib, config, ... }:
{ {
options.swarselmodules.mako = lib.mkEnableOption "mako settings"; options.swarselsystems.modules.mako = lib.mkEnableOption "mako settings";
config = lib.mkIf config.swarselmodules.mako { config = lib.mkIf config.swarselsystems.modules.mako {
services.mako = { services.mako = {
enable = true; enable = true;
settings = { settings = {

View file

@ -1,7 +1,7 @@
{ self, lib, config, pkgs, ... }: { self, lib, config, pkgs, ... }:
{ {
options.swarselmodules.nix-index = lib.mkEnableOption "nix-index settings"; options.swarselsystems.modules.nix-index = lib.mkEnableOption "nix-index settings";
config = lib.mkIf config.swarselmodules.nix-index { config = lib.mkIf config.swarselsystems.modules.nix-index {
programs.nix-index = programs.nix-index =
let let
commandNotFound = pkgs.runCommandLocal "command-not-found.sh" { } '' commandNotFound = pkgs.runCommandLocal "command-not-found.sh" { } ''

View file

@ -1,14 +1,14 @@
{ lib, config, nixgl, ... }: { lib, config, nixgl, ... }:
{ {
options.swarselmodules.nixgl = lib.mkEnableOption "nixgl settings";
options.swarselsystems = { options.swarselsystems = {
modules.nixgl = lib.mkEnableOption "nixgl settings";
isSecondaryGpu = lib.mkEnableOption "device has a secondary GPU"; isSecondaryGpu = lib.mkEnableOption "device has a secondary GPU";
SecondaryGpuCard = lib.mkOption { SecondaryGpuCard = lib.mkOption {
type = lib.types.str; type = lib.types.str;
default = ""; default = "";
}; };
}; };
config = lib.mkIf config.swarselmodules.nixgl { config = lib.mkIf config.swarselsystems.modules.nixgl {
nixGL = lib.mkIf (!config.swarselsystems.isNixos) { nixGL = lib.mkIf (!config.swarselsystems.isNixos) {
inherit (nixgl) packages; inherit (nixgl) packages;
defaultWrapper = lib.mkDefault "mesa"; defaultWrapper = lib.mkDefault "mesa";

View file

@ -1,8 +1,8 @@
{ lib, config, pkgs, ... }: { lib, config, pkgs, ... }:
{ {
options.swarselmodules.packages = lib.mkEnableOption "packages settings"; options.swarselsystems.modules.packages = lib.mkEnableOption "packages settings";
config = lib.mkIf config.swarselmodules.packages { config = lib.mkIf config.swarselsystems.modules.packages {
home.packages = with pkgs; [ home.packages = with pkgs; [
# audio stuff # audio stuff

View file

@ -1,7 +1,7 @@
{ lib, config, pkgs, ... }: { lib, config, pkgs, ... }:
{ {
options.swarselmodules.passwordstore = lib.mkEnableOption "passwordstore settings"; options.swarselsystems.modules.passwordstore = lib.mkEnableOption "passwordstore settings";
config = lib.mkIf config.swarselmodules.passwordstore { config = lib.mkIf config.swarselsystems.modules.passwordstore {
programs.password-store = { programs.password-store = {
enable = true; enable = true;
settings = { settings = {

View file

@ -1,7 +1,7 @@
{ lib, config, pkgs, ... }: { lib, config, pkgs, ... }:
{ {
options.swarselmodules.programs = lib.mkEnableOption "programs settings"; options.swarselsystems.modules.programs = lib.mkEnableOption "programs settings";
config = lib.mkIf config.swarselmodules.programs { config = lib.mkIf config.swarselsystems.modules.programs {
programs = { programs = {
bottom.enable = true; bottom.enable = true;
imv.enable = true; imv.enable = true;

View file

@ -3,8 +3,8 @@ let
inherit (config.swarselsystems) mainUser; inherit (config.swarselsystems) mainUser;
in in
{ {
options.swarselmodules.general = lib.mkEnableOption "general nix settings"; options.swarselsystems.modules.general = lib.mkEnableOption "general nix settings";
config = lib.mkIf config.swarselmodules.general { config = lib.mkIf config.swarselsystems.modules.general {
nix = lib.mkIf (!config.swarselsystems.isNixos) { nix = lib.mkIf (!config.swarselsystems.isNixos) {
package = lib.mkForce pkgs.nixVersions.nix_2_28; package = lib.mkForce pkgs.nixVersions.nix_2_28;
extraOptions = '' extraOptions = ''

View file

@ -1,12 +0,0 @@
{ lib, config, nixosConfig ? null, ... }:
let
# mirrorAttrs = lib.mapAttrs (_: v: lib.mkDefault v) nixosConfig.swarselsystems;
inherit (lib) mkDefault mapAttrs filterAttrs;
mkDefaultCommonAttrs = base: defaults:
lib.mapAttrs (_: v: lib.mkDefault v)
(lib.filterAttrs (k: _: base ? ${k}) defaults);
in
{
# config.swarselsystems = mirrorAttrs;
config.swarselsystems = lib.mkIf (nixosConfig != null) (mkDefaultCommonAttrs config.swarselsystems nixosConfig.swarselsystems);
}

View file

@ -1,8 +1,52 @@
{ self, lib, pkgs, ... }: { self, config, lib, pkgs, globals, minimal, ... }:
{ {
_module.args = { options.swarselsystems = {
vars = { isLaptop = lib.mkEnableOption "laptop host";
stylix = { isNixos = lib.mkEnableOption "nixos host";
isPublic = lib.mkEnableOption "is a public machine (no secrets)";
isDarwin = lib.mkEnableOption "darwin host";
isLinux = lib.mkEnableOption "whether this is a linux machine";
isBtrfs = lib.mkEnableOption "use btrfs filesystem";
mainUser = lib.mkOption {
type = lib.types.str;
default = if (!minimal) then globals.user.name else "swarsel";
};
sopsFile = lib.mkOption {
type = lib.types.str;
default = "${config.swarselsystems.flakePath}/secrets/${config.node.name}/secrets.yaml";
};
homeDir = lib.mkOption {
type = lib.types.str;
default = "/home/swarsel";
};
xdgDir = lib.mkOption {
type = lib.types.str;
default = "/run/user/1000";
};
flakePath = lib.mkOption {
type = lib.types.str;
default = "/home/swarsel/.dotfiles";
};
wallpaper = lib.mkOption {
type = lib.types.path;
default = "${self}/files/wallpaper/lenovowp.png";
};
sharescreen = lib.mkOption {
type = lib.types.str;
default = "";
};
lowResolution = lib.mkOption {
type = lib.types.str;
default = "";
};
highResolution = lib.mkOption {
type = lib.types.str;
default = "";
};
stylix = lib.mkOption {
type = lib.types.attrs;
default = {
polarity = "dark"; polarity = "dark";
opacity.popups = 0.5; opacity.popups = 0.5;
cursor = { cursor = {
@ -43,15 +87,20 @@
}; };
}; };
}; };
};
stylixHomeTargets = { stylixHomeTargets = lib.mkOption {
type = lib.types.attrs;
default = {
emacs.enable = false; emacs.enable = false;
waybar.enable = false; waybar.enable = false;
sway.useWallpaper = false; sway.useWallpaper = false;
firefox.profileNames = [ "default" ]; firefox.profileNames = [ "default" ];
}; };
};
firefox = { firefox = lib.mkOption {
type = lib.types.attrs;
default = {
userChrome = builtins.readFile "${self}/files/firefox/chrome/userChrome.css"; userChrome = builtins.readFile "${self}/files/firefox/chrome/userChrome.css";
extensions = { extensions = {
packages = with pkgs.nur.repos.rycee.firefox-addons; [ packages = with pkgs.nur.repos.rycee.firefox-addons; [
@ -215,5 +264,6 @@
}; };
}; };
}; };
}; };
} }

View file

@ -3,8 +3,8 @@ let
inherit (config.swarselsystems) homeDir; inherit (config.swarselsystems) homeDir;
in in
{ {
options.swarselmodules.sops = lib.mkEnableOption "sops settings"; options.swarselsystems.modules.sops = lib.mkEnableOption "sops settings";
config = lib.mkIf config.swarselmodules.sops { config = lib.mkIf config.swarselsystems.modules.sops {
sops = { sops = {
age.sshKeyPaths = [ "${homeDir}/.ssh/sops" "${homeDir}/.ssh/ssh_host_ed25519_key" ]; age.sshKeyPaths = [ "${homeDir}/.ssh/sops" "${homeDir}/.ssh/ssh_host_ed25519_key" ];
defaultSopsFile = "${homeDir}/.dotfiles/secrets/general/secrets.yaml"; defaultSopsFile = "${homeDir}/.dotfiles/secrets/general/secrets.yaml";

View file

@ -1,7 +1,7 @@
{ lib, config, ... }: { lib, config, ... }:
{ {
options.swarselmodules.ssh = lib.mkEnableOption "ssh settings"; options.swarselsystems.modules.ssh = lib.mkEnableOption "ssh settings";
config = lib.mkIf config.swarselmodules.ssh { config = lib.mkIf config.swarselsystems.modules.ssh {
programs.ssh = { programs.ssh = {
enable = true; enable = true;
forwardAgent = true; forwardAgent = true;

View file

@ -1,7 +1,7 @@
{ lib, config, ... }: { lib, config, ... }:
{ {
options.swarselmodules.starship = lib.mkEnableOption "starship settings"; options.swarselsystems.modules.starship = lib.mkEnableOption "starship settings";
config = lib.mkIf config.swarselmodules.starship { config = lib.mkIf config.swarselsystems.modules.starship {
programs.starship = { programs.starship = {
enable = true; enable = true;
enableZshIntegration = true; enableZshIntegration = true;

View file

@ -1,12 +1,12 @@
{ lib, config, vars, ... }: { lib, config, ... }:
{ {
options.swarselmodules.stylix = lib.mkEnableOption "stylix settings"; options.swarselsystems.modules.stylix = lib.mkEnableOption "stylix settings";
config = lib.mkIf config.swarselmodules.stylix { config = lib.mkIf config.swarselsystems.modules.stylix {
stylix = lib.mkIf (!config.swarselsystems.isNixos) (lib.recursiveUpdate stylix = lib.mkIf (!config.swarselsystems.isNixos) (lib.recursiveUpdate
{ {
image = config.swarselsystems.wallpaper; image = config.swarselsystems.wallpaper;
targets = vars.stylixHomeTargets; targets = config.swarselsystems.stylixHomeTargets;
} }
vars.stylix); config.swarselsystems.stylix);
}; };
} }

View file

@ -6,8 +6,8 @@ let
}; };
in in
{ {
options.swarselmodules.sway = lib.mkEnableOption "sway settings";
options.swarselsystems = { options.swarselsystems = {
modules.sway = lib.mkEnableOption "sway settings";
inputs = lib.mkOption { inputs = lib.mkOption {
type = lib.types.attrsOf (lib.types.attrsOf lib.types.str); type = lib.types.attrsOf (lib.types.attrsOf lib.types.str);
default = { }; default = { };
@ -72,7 +72,7 @@ in
internal = true; internal = true;
}; };
}; };
config = lib.mkIf config.swarselmodules.sway { config = lib.mkIf config.swarselsystems.modules.sway {
swarselsystems = { swarselsystems = {
touchpad = lib.mkIf config.swarselsystems.isLaptop { touchpad = lib.mkIf config.swarselsystems.isLaptop {
"type:touchpad" = { "type:touchpad" = {
@ -117,6 +117,8 @@ in
"${modifier}+Space" = "exec fuzzel"; "${modifier}+Space" = "exec fuzzel";
"${modifier}+Shift+Space" = "floating toggle"; "${modifier}+Shift+Space" = "floating toggle";
"${modifier}+e" = "exec emacsclient -nquc -a emacs -e \"(dashboard-open)\""; "${modifier}+e" = "exec emacsclient -nquc -a emacs -e \"(dashboard-open)\"";
"${modifier}+Shift+m" = "exec emacsclient -nquc -a emacs -e \"(mu4e)\"";
"${modifier}+Shift+c" = "exec emacsclient -nquc -a emacs -e \"(swarsel/open-calendar)\"";
"${modifier}+m" = "exec swaymsg workspace back_and_forth"; "${modifier}+m" = "exec swaymsg workspace back_and_forth";
"${modifier}+a" = "exec swarselcheck -s"; "${modifier}+a" = "exec swarselcheck -s";
"${modifier}+x" = "exec swarselcheck -k"; "${modifier}+x" = "exec swarselcheck -k";
@ -125,10 +127,7 @@ in
"${modifier}+Shift+t" = "exec opacitytoggle"; "${modifier}+Shift+t" = "exec opacitytoggle";
"${modifier}+Shift+F12" = "move scratchpad"; "${modifier}+Shift+F12" = "move scratchpad";
"${modifier}+F12" = "scratchpad show"; "${modifier}+F12" = "scratchpad show";
"${modifier}+Shift+c" = "exec qalculate-gtk"; "${modifier}+c" = "exec qalculate-gtk";
"${modifier}+c" = "emacsclient -e '(prot-window-popup-org-capture)'";
"${modifier}+Shift+m" = "emacsclient -e '(prot-window-popup-mu4e)'";
"${modifier}+Shift+a" = "emacsclient -e '(prot-window-popup-swarsel/open-calendar)'";
"${modifier}+p" = "exec pass-fuzzel"; "${modifier}+p" = "exec pass-fuzzel";
"${modifier}+o" = "exec pass-fuzzel --otp"; "${modifier}+o" = "exec pass-fuzzel --otp";
"${modifier}+Shift+p" = "exec pass-fuzzel --type"; "${modifier}+Shift+p" = "exec pass-fuzzel --type";
@ -261,7 +260,6 @@ in
{ title = "^Add$"; } { title = "^Add$"; }
{ title = "^Picture-in-Picture$"; } { title = "^Picture-in-Picture$"; }
{ title = "Syncthing Tray"; } { title = "Syncthing Tray"; }
{ title = "Emacs Popup Frame"; }
{ title = "^spotifytui$"; } { title = "^spotifytui$"; }
{ title = "^kittyterm$"; } { title = "^kittyterm$"; }
{ app_id = "vesktop"; } { app_id = "vesktop"; }

View file

@ -1,7 +1,7 @@
{ lib, pkgs, config, ... }: { lib, pkgs, config, ... }:
{ {
options.swarselmodules.swayosd = lib.mkEnableOption "swayosd settings"; options.swarselsystems.modules.swayosd = lib.mkEnableOption "swayosd settings";
config = lib.mkIf config.swarselmodules.swayosd { config = lib.mkIf config.swarselsystems.modules.swayosd {
services.swayosd = { services.swayosd = {
enable = true; enable = true;
package = pkgs.dev.swayosd; package = pkgs.dev.swayosd;

View file

@ -1,7 +1,7 @@
{ self, lib, config, ... }: { self, lib, config, ... }:
{ {
options.swarselmodules.symlink = lib.mkEnableOption "symlink settings"; options.swarselsystems.modules.symlink = lib.mkEnableOption "symlink settings";
config = lib.mkIf config.swarselmodules.symlink { config = lib.mkIf config.swarselsystems.modules.symlink {
home.file = { home.file = {
"init.el" = lib.mkDefault { "init.el" = lib.mkDefault {
source = self + /files/emacs/init.el; source = self + /files/emacs/init.el;

View file

@ -13,8 +13,8 @@ let
}; };
in in
{ {
options.swarselmodules.tmux = lib.mkEnableOption "tmux settings"; options.swarselsystems.modules.tmux = lib.mkEnableOption "tmux settings";
config = lib.mkIf config.swarselmodules.tmux { config = lib.mkIf config.swarselsystems.modules.tmux {
home.packages = with pkgs; [ home.packages = with pkgs; [
lsof lsof
sesh sesh

View file

@ -22,8 +22,8 @@ let
]; ];
in in
{ {
options.swarselmodules.waybar = lib.mkEnableOption "waybar settings";
options.swarselsystems = { options.swarselsystems = {
modules.waybar = lib.mkEnableOption "waybar settings";
cpuCount = lib.mkOption { cpuCount = lib.mkOption {
type = lib.types.int; type = lib.types.int;
default = 8; default = 8;
@ -52,7 +52,7 @@ in
internal = true; internal = true;
}; };
}; };
config = lib.mkIf config.swarselmodules.waybar { config = lib.mkIf config.swarselsystems.modules.waybar {
swarselsystems = { swarselsystems = {
waybarModules = lib.mkIf config.swarselsystems.isLaptop (modulesLeft ++ [ waybarModules = lib.mkIf config.swarselsystems.isLaptop (modulesLeft ++ [
@ -60,7 +60,7 @@ in
] ++ modulesRight); ] ++ modulesRight);
}; };
sops.secrets = lib.mkIf (!config.swarselsystems.isPublic && !config.swarselsystems.isNixos) { sops.secrets = lib.mkIf (!config.swarselsystems.isPublic) {
github-notifications-token = { path = "${xdgDir}/secrets/github-notifications-token"; }; github-notifications-token = { path = "${xdgDir}/secrets/github-notifications-token"; };
}; };

View file

@ -1,7 +1,7 @@
{ lib, config, pkgs, ... }: { lib, config, pkgs, ... }:
{ {
options.swarselmodules.yubikeytouch = lib.mkEnableOption "yubikey touch detector service settings"; options.swarselsystems.modules.yubikeytouch = lib.mkEnableOption "yubikey touch detector service settings";
config = lib.mkIf config.swarselmodules.yubikeytouch { config = lib.mkIf config.swarselsystems.modules.yubikeytouch {
systemd.user.services.yubikey-touch-detector = { systemd.user.services.yubikey-touch-detector = {
Unit = { Unit = {
Description = "Detects when your YubiKey is waiting for a touch"; Description = "Detects when your YubiKey is waiting for a touch";

View file

@ -1,11 +1,11 @@
{ lib, config, nixosConfig ? config, ... }: { lib, config, nixosConfig, ... }:
let let
inherit (config.swarselsystems) homeDir; inherit (config.swarselsystems) homeDir;
in in
{ {
options.swarselmodules.yubikey = lib.mkEnableOption "yubikey settings"; options.swarselsystems.modules.yubikey = lib.mkEnableOption "yubikey settings";
config = lib.mkIf config.swarselmodules.yubikey { config = lib.mkIf config.swarselsystems.modules.yubikey {
sops.secrets = lib.mkIf (!config.swarselsystems.isPublic) { sops.secrets = lib.mkIf (!config.swarselsystems.isPublic) {
u2f-keys = { path = "${homeDir}/.config/Yubico/u2f_keys"; }; u2f-keys = { path = "${homeDir}/.config/Yubico/u2f_keys"; };

View file

@ -1,7 +1,7 @@
{ self, lib, config, pkgs, ... }: { self, lib, config, pkgs, ... }:
{ {
options.swarselmodules.zellij = lib.mkEnableOption "zellij settings"; options.swarselsystems.modules.zellij = lib.mkEnableOption "zellij settings";
config = lib.mkIf config.swarselmodules.zellij { config = lib.mkIf config.swarselsystems.modules.zellij {
programs.zellij = { programs.zellij = {
enable = true; enable = true;
enableZshIntegration = true; enableZshIntegration = true;

View file

@ -1,19 +1,19 @@
{ config, lib, minimal, nixosConfig ? config, ... }: { config, lib, minimal, ... }:
let let
inherit (config.swarselsystems) flakePath; inherit (config.swarselsystems) flakePath;
in in
{ {
options.swarselmodules.zsh = lib.mkEnableOption "zsh settings";
options.swarselsystems = { options.swarselsystems = {
modules.zsh = lib.mkEnableOption "zsh settings";
shellAliases = lib.mkOption { shellAliases = lib.mkOption {
type = lib.types.attrsOf lib.types.str; type = lib.types.attrsOf lib.types.str;
default = { }; default = { };
}; };
}; };
config = lib.mkIf config.swarselmodules.zsh config = lib.mkIf config.swarselsystems.modules.zsh
{ {
sops.secrets = lib.mkIf (!config.swarselsystems.isPublic && !config.swarselsystems.isNixos) { sops.secrets = {
croc-password = { }; croc-password = { };
}; };
@ -26,10 +26,9 @@ in
hg = "history | grep"; hg = "history | grep";
hmswitch = "home-manager --flake ${flakePath}#$(whoami)@$(hostname) switch |& nom"; 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"; # nswitch = "sudo nixos-rebuild --flake ${flakePath}#$(hostname) --show-trace --log-format internal-json -v switch |& nom --json";
nswitch = "cd ${flakePath}; swarsel-deploy $(hostname) switch; cd -;"; nswitch = "swarsel-deploy $(hostname) switch";
nboot = "cd ${flakePath}; swarsel-deploy $(hostname) boot; cd -;";
ndry = "cd ${flakePath}; swarsel-deploy $(hostname) dry-activate; cd -;";
# nboot = "sudo nixos-rebuild --flake ${flakePath}#$(hostname) --show-trace --log-format internal-json -v boot |& nom --json"; # nboot = "sudo nixos-rebuild --flake ${flakePath}#$(hostname) --show-trace --log-format internal-json -v boot |& nom --json";
nboot = "swarsel-deploy $(hostname) boot";
magit = "emacsclient -nc -e \"(magit-status)\""; magit = "emacsclient -nc -e \"(magit-status)\"";
config = "git --git-dir=$HOME/.cfg/ --work-tree=$HOME"; config = "git --git-dir=$HOME/.cfg/ --work-tree=$HOME";
g = "git"; g = "git";
@ -121,7 +120,7 @@ in
# ctrl + del # ctrl + del
bindkey '^H' my-backward-delete-word bindkey '^H' my-backward-delete-word
export CROC_PASS="$(cat ${nixosConfig.sops.secrets.croc-password.path})" export CROC_PASS="$(cat ${config.sops.secrets.croc-password.path})"
''; '';
}; };
}; };

View file

@ -1,9 +1,7 @@
{ self, ... }: { self, ... }:
{ {
home.stateVersion = "23.05";
imports = [ imports = [
"${self}/modules/home/common/settings.nix" "${self}/modules/home/common/settings.nix"
"${self}/modules/shared/options.nix" "${self}/modules/home/common/sharedsetup.nix"
"${self}/modules/shared/vars.nix"
]; ];
} }

View file

@ -1,7 +1,7 @@
{ lib, config, ... }: { lib, config, ... }:
{ {
options.swarselmodules.optional.framework = lib.mkEnableOption "optional framework machine settings"; options.swarselsystems.modules.optional.framework = lib.mkEnableOption "optional framework machine settings";
config = lib.mkIf config.swarselmodules.optional.framework { config = lib.mkIf config.swarselsystems.modules.optional.framework {
swarselsystems = { swarselsystems = {
inputs = { inputs = {
"12972:18:Framework_Laptop_16_Keyboard_Module_-_ANSI_Keyboard" = { "12972:18:Framework_Laptop_16_Keyboard_Module_-_ANSI_Keyboard" = {

View file

@ -1,7 +1,7 @@
{ lib, config, pkgs, ... }: { lib, config, pkgs, ... }:
{ {
options.swarselmodules.optional.gaming = lib.mkEnableOption "optional gaming settings"; options.swarselsystems.modules.optional.gaming = lib.mkEnableOption "optional gaming settings";
config = lib.mkIf config.swarselmodules.optional.gaming { config = lib.mkIf config.swarselsystems.modules.optional.gaming {
# specialisation = { # specialisation = {
# gaming.configuration = { # gaming.configuration = {
home.packages = with pkgs; [ home.packages = with pkgs; [

View file

@ -1,10 +1,10 @@
{ self, config, pkgs, lib, vars, nixosConfig ? config, ... }: { self, config, pkgs, lib, nixosConfig, ... }:
let let
inherit (config.swarselsystems) homeDir; inherit (config.swarselsystems) homeDir;
in in
{ {
options.swarselmodules.optional.work = lib.mkEnableOption "optional work settings"; options.swarselsystems.modules.optional.work = lib.mkEnableOption "optional work settings";
config = lib.mkIf config.swarselmodules.optional.work { config = lib.mkIf config.swarselsystems.modules.optional.work {
home.packages = with pkgs; [ home.packages = with pkgs; [
stable.teams-for-linux stable.teams-for-linux
shellcheck shellcheck
@ -126,7 +126,7 @@ in
"browser.startup.homepage" = "${site1}|${site2}"; "browser.startup.homepage" = "${site1}|${site2}";
}; };
} }
vars.firefox; config.swarselsystems.firefox;
"${user2}" = lib.recursiveUpdate "${user2}" = lib.recursiveUpdate
{ {
inherit isDefault; inherit isDefault;
@ -135,13 +135,13 @@ in
"browser.startup.homepage" = "${site3}"; "browser.startup.homepage" = "${site3}";
}; };
} }
vars.firefox; config.swarselsystems.firefox;
"${user3}" = lib.recursiveUpdate "${user3}" = lib.recursiveUpdate
{ {
inherit isDefault; inherit isDefault;
id = 3; id = 3;
} }
vars.firefox; config.swarselsystems.firefox;
work = lib.recursiveUpdate work = lib.recursiveUpdate
{ {
inherit isDefault; inherit isDefault;
@ -150,7 +150,7 @@ in
"browser.startup.homepage" = "${site4}|${site5}|${site6}|${site7}"; "browser.startup.homepage" = "${site4}|${site5}|${site6}|${site7}";
}; };
} }
vars.firefox; config.swarselsystems.firefox;
}; };
}; };

View file

@ -6,5 +6,6 @@ in
{ {
imports = lib.swarselsystems.mkImports importNames "modules/home/server" ++ [ imports = lib.swarselsystems.mkImports importNames "modules/home/server" ++ [
"${modulesPath}/home/common/settings.nix" "${modulesPath}/home/common/settings.nix"
"${modulesPath}/home/common/sharedsetup.nix"
]; ];
} }

View file

@ -1,7 +1,7 @@
{ self, lib, config, ... }: { self, lib, config, ... }:
{ {
options.swarselmodules.server.dotfiles = lib.mkEnableOption "server dotfiles settings"; options.swarselsystems.modules.server.dotfiles = lib.mkEnableOption "server dotfiles settings";
config = lib.mkIf config.swarselmodules.server.dotfiles { config = lib.mkIf config.swarselsystems.modules.server.dotfiles {
home.file = { home.file = {
"init.el" = lib.mkForce { "init.el" = lib.mkForce {
source = self + /files/emacs/server.el; source = self + /files/emacs/server.el;

View file

@ -1,7 +1,7 @@
{ lib, config, ... }: { lib, config, ... }:
{ {
options.swarselmodules.appimage = lib.mkEnableOption "appimage config"; options.swarselsystems.modules.appimage = lib.mkEnableOption "appimage config";
config = lib.mkIf config.swarselmodules.appimage { config = lib.mkIf config.swarselsystems.modules.appimage {
programs.appimage = { programs.appimage = {
enable = true; enable = true;
binfmt = true; binfmt = true;

View file

@ -3,8 +3,8 @@ let
inherit (config.swarselsystems) mainUser; inherit (config.swarselsystems) mainUser;
in in
{ {
options.swarselmodules.autologin = lib.mkEnableOption "optional autologin settings"; options.swarselsystems.modules.autologin = lib.mkEnableOption "optional autologin settings";
config = lib.mkIf config.swarselmodules.autologin { config = lib.mkIf config.swarselsystems.modules.autologin {
services = { services = {
getty.autologinUser = mainUser; getty.autologinUser = mainUser;
greetd.settings.initial_session.user = mainUser; greetd.settings.initial_session.user = mainUser;

View file

@ -1,7 +1,7 @@
{ lib, config, ... }: { lib, config, ... }:
{ {
options.swarselmodules.blueman = lib.mkEnableOption "blueman config"; options.swarselsystems.modules.blueman = lib.mkEnableOption "blueman config";
config = lib.mkIf config.swarselmodules.blueman { config = lib.mkIf config.swarselsystems.modules.blueman {
services.blueman.enable = true; services.blueman.enable = true;
services.hardware.bolt.enable = true; services.hardware.bolt.enable = true;
}; };

View file

@ -1,7 +1,7 @@
{ lib, config, pkgs, ... }: { lib, config, pkgs, ... }:
{ {
options.swarselmodules.distrobox = lib.mkEnableOption "distrobox config"; options.swarselsystems.modules.distrobox = lib.mkEnableOption "distrobox config";
config = lib.mkIf config.swarselmodules.distrobox { config = lib.mkIf config.swarselsystems.modules.distrobox {
environment.systemPackages = with pkgs; [ environment.systemPackages = with pkgs; [
distrobox distrobox
boxbuddy boxbuddy

View file

@ -1,7 +1,7 @@
{ lib, config, pkgs, ... }: { lib, config, pkgs, ... }:
{ {
options.swarselmodules.env = lib.mkEnableOption "environment config"; options.swarselsystems.modules.env = lib.mkEnableOption "environment config";
config = lib.mkIf config.swarselmodules.env { config = lib.mkIf config.swarselsystems.modules.env {
environment = { environment = {
wordlist.enable = true; wordlist.enable = true;

View file

@ -1,7 +1,7 @@
{ lib, config, ... }: { lib, config, ... }:
{ {
options.swarselmodules.gnome-keyring = lib.mkEnableOption "gnome-keyring config"; options.swarselsystems.modules.gnome-keyring = lib.mkEnableOption "gnome-keyring config";
config = lib.mkIf config.swarselmodules.gnome-keyring { config = lib.mkIf config.swarselsystems.modules.gnome-keyring {
services.gnome.gnome-keyring = { services.gnome.gnome-keyring = {
enable = true; enable = true;
}; };

View file

@ -1,7 +1,7 @@
{ lib, config, ... }: { lib, config, ... }:
{ {
options.swarselmodules.gvfs = lib.mkEnableOption "gvfs config for nautilus"; options.swarselsystems.modules.gvfs = lib.mkEnableOption "gvfs config for nautilus";
config = lib.mkIf config.swarselmodules.gvfs { config = lib.mkIf config.swarselsystems.modules.gvfs {
services.gvfs.enable = true; services.gvfs.enable = true;
}; };
} }

View file

@ -1,8 +1,8 @@
{ pkgs, config, lib, ... }: { pkgs, config, lib, ... }:
{ {
options.swarselmodules.hardware = lib.mkEnableOption "hardware config";
options.swarselsystems = { options.swarselsystems = {
modules.hardware = lib.mkEnableOption "hardware config";
hasBluetooth = lib.mkEnableOption "bluetooth availability"; hasBluetooth = lib.mkEnableOption "bluetooth availability";
hasFingerprint = lib.mkEnableOption "fingerprint sensor availability"; hasFingerprint = lib.mkEnableOption "fingerprint sensor availability";
trackpoint = { trackpoint = {
@ -13,7 +13,7 @@
}; };
}; };
}; };
config = lib.mkIf config.swarselmodules.hardware { config = lib.mkIf config.swarselsystems.modules.hardware {
hardware = { hardware = {
# opengl.driSupport32Bit = true is replaced with graphics.enable32Bit and hence redundant # opengl.driSupport32Bit = true is replaced with graphics.enable32Bit and hence redundant
graphics = { graphics = {

View file

@ -1,7 +1,7 @@
{ lib, config, pkgs, ... }: { lib, config, pkgs, ... }:
{ {
options.swarselmodules.keyboards = lib.mkEnableOption "keyboards config"; options.swarselsystems.modules.keyboards = lib.mkEnableOption "keyboards config";
config = lib.mkIf config.swarselmodules.keyboards { config = lib.mkIf config.swarselsystems.modules.keyboards {
services.udev.packages = with pkgs; [ services.udev.packages = with pkgs; [
qmk-udev-rules qmk-udev-rules
vial vial

View file

@ -1,7 +1,7 @@
{ lib, config, pkgs, ... }: { lib, config, pkgs, ... }:
{ {
options.swarselmodules.ledger = lib.mkEnableOption "ledger config"; options.swarselsystems.modules.ledger = lib.mkEnableOption "ledger config";
config = lib.mkIf config.swarselmodules.ledger { config = lib.mkIf config.swarselsystems.modules.ledger {
hardware.ledger.enable = true; hardware.ledger.enable = true;
services.udev.packages = with pkgs; [ services.udev.packages = with pkgs; [

View file

@ -4,8 +4,8 @@ let
inherit (config.repo.secrets.common.yubikeys) cfg1 cfg2; inherit (config.repo.secrets.common.yubikeys) cfg1 cfg2;
in in
{ {
options.swarselmodules.yubikey = lib.mkEnableOption "yubikey config"; options.swarselsystems.modules.yubikey = lib.mkEnableOption "yubikey config";
config = lib.mkIf config.swarselmodules.yubikey { config = lib.mkIf config.swarselsystems.modules.yubikey {
programs.ssh.startAgent = false; programs.ssh.startAgent = false;
services.pcscd.enable = false; services.pcscd.enable = false;

View file

@ -1,7 +1,7 @@
{ lib, config, pkgs, ... }: { lib, config, pkgs, ... }:
{ {
options.swarselmodules.interceptionTools = lib.mkEnableOption "interception tools config"; options.swarselsystems.modules.interceptionTools = lib.mkEnableOption "interception tools config";
config = lib.mkIf config.swarselmodules.interceptionTools { config = lib.mkIf config.swarselsystems.modules.interceptionTools {
# Make CAPS work as a dual function ESC/CTRL key # Make CAPS work as a dual function ESC/CTRL key
services.interception-tools = { services.interception-tools = {
enable = true; enable = true;

View file

@ -1,7 +1,7 @@
{ lib, config, ... }: { lib, config, ... }:
{ {
options.swarselmodules.lid = lib.mkEnableOption "lid config"; options.swarselsystems.modules.lid = lib.mkEnableOption "lid config";
config = lib.mkIf config.swarselmodules.lid { config = lib.mkIf config.swarselsystems.modules.lid {
services.logind = { services.logind = {
lidSwitch = "suspend"; lidSwitch = "suspend";
lidSwitchDocked = "ignore"; lidSwitchDocked = "ignore";

View file

@ -1,7 +1,7 @@
{ lib, config, pkgs, ... }: { lib, config, pkgs, ... }:
{ {
options.swarselmodules.login = lib.mkEnableOption "login config"; options.swarselsystems.modules.login = lib.mkEnableOption "login config";
config = lib.mkIf config.swarselmodules.login { config = lib.mkIf config.swarselsystems.modules.login {
services.greetd = { services.greetd = {
enable = true; enable = true;
settings = { settings = {

View file

@ -1,7 +1,7 @@
{ pkgs, lib, config, ... }: { pkgs, lib, config, ... }:
{ {
options.swarselmodules.lowBattery = lib.mkEnableOption "low battery notification config"; options.swarselsystems.modules.lowBattery = lib.mkEnableOption "low battery notification config";
config = lib.mkIf config.swarselmodules.lowBattery { config = lib.mkIf config.swarselsystems.modules.lowBattery {
systemd.user.services."battery-low" = { systemd.user.services."battery-low" = {
enable = true; enable = true;
description = "Timer for battery check that alerts at 10% or less"; description = "Timer for battery check that alerts at 10% or less";

View file

@ -10,10 +10,10 @@ let
in in
{ {
options.swarselsystems = { options.swarselsystems = {
modules.network = lib.mkEnableOption "network config";
firewall = lib.swarselsystems.mkTrueOption; firewall = lib.swarselsystems.mkTrueOption;
}; };
options.swarselmodules.network = lib.mkEnableOption "network config"; config = lib.mkIf config.swarselsystems.modules.network {
config = lib.mkIf config.swarselmodules.network {
sops = { sops = {
secrets = lib.mkIf (!config.swarselsystems.isPublic) { secrets = lib.mkIf (!config.swarselsystems.isPublic) {
@ -118,7 +118,7 @@ in
wifi-security = { wifi-security = {
auth-alg = "open"; auth-alg = "open";
key-mgmt = "wpa-psk"; key-mgmt = "wpa-psk";
psk = "$WLAN1_PW"; psk = "WLAN1_PW";
}; };
}; };

View file

@ -1,7 +1,7 @@
{ lib, config, pkgs, ... }: { lib, config, pkgs, ... }:
{ {
options.swarselmodules.networkDevices = lib.mkEnableOption "network device config"; options.swarselsystems.modules.networkDevices = lib.mkEnableOption "network device config";
config = lib.mkIf config.swarselmodules.networkDevices { config = lib.mkIf config.swarselsystems.modules.networkDevices {
# enable scanners over network # enable scanners over network
hardware.sane = { hardware.sane = {
enable = true; enable = true;

View file

@ -1,7 +1,7 @@
{ lib, config, pkgs, ... }: { lib, config, pkgs, ... }:
{ {
options.swarselmodules.nix-ld = lib.mkEnableOption "nix-ld config"; options.swarselsystems.modules.nix-ld = lib.mkEnableOption "nix-ld config";
config = lib.mkIf config.swarselmodules.nix-ld { config = lib.mkIf config.swarselsystems.modules.nix-ld {
programs.nix-ld = { programs.nix-ld = {
enable = true; enable = true;
libraries = with pkgs; [ libraries = with pkgs; [

View file

@ -1,7 +1,7 @@
{ lib, config, pkgs, ... }: { lib, config, pkgs, ... }:
{ {
options.swarselmodules.nvd = lib.mkEnableOption "nvd config"; options.swarselsystems.modules.nvd = lib.mkEnableOption "nvd config";
config = lib.mkIf config.swarselmodules.nvd { config = lib.mkIf config.swarselsystems.modules.nvd {
environment.systemPackages = [ environment.systemPackages = [
pkgs.nvd pkgs.nvd

View file

@ -1,7 +1,7 @@
{ lib, config, pkgs, minimal, ... }: { lib, config, pkgs, minimal, ... }:
{ {
options.swarselmodules.packages = lib.mkEnableOption "install packages"; options.swarselsystems.modules.packages = lib.mkEnableOption "install packages";
config = lib.mkIf config.swarselmodules.packages { config = lib.mkIf config.swarselsystems.modules.packages {
environment.systemPackages = with pkgs; lib.optionals (!minimal) [ environment.systemPackages = with pkgs; lib.optionals (!minimal) [
# yubikey packages # yubikey packages

View file

@ -1,7 +1,7 @@
{ lib, config, pkgs, ... }: { lib, config, pkgs, ... }:
{ {
options.swarselmodules.pipewire = lib.mkEnableOption "pipewire config"; options.swarselsystems.modules.pipewire = lib.mkEnableOption "pipewire config";
config = lib.mkIf config.swarselmodules.pipewire { config = lib.mkIf config.swarselsystems.modules.pipewire {
security.rtkit.enable = true; # this is required for pipewire real-time access security.rtkit.enable = true; # this is required for pipewire real-time access
services.pipewire = { services.pipewire = {

View file

@ -1,7 +1,7 @@
{ lib, config, minimal, ... }: { lib, config, minimal, ... }:
{ {
options.swarselmodules.security = lib.mkEnableOption "security config"; options.swarselsystems.modules.security = lib.mkEnableOption "security config";
config = lib.mkIf config.swarselmodules.security { config = lib.mkIf config.swarselsystems.modules.security {
security = { security = {
pam.services = lib.mkIf (!minimal) { pam.services = lib.mkIf (!minimal) {

View file

@ -1,7 +1,7 @@
{ lib, config, ... }: { lib, config, ... }:
{ {
options.swarselmodules.ppd = lib.mkEnableOption "power profiles daemon config"; options.swarselsystems.modules.ppd = lib.mkEnableOption "power profiles daemon config";
config = lib.mkIf config.swarselmodules.ppd { config = lib.mkIf config.swarselsystems.modules.ppd {
services.power-profiles-daemon.enable = true; services.power-profiles-daemon.enable = true;
}; };
} }

View file

@ -1,7 +1,7 @@
{ lib, config, ... }: { lib, config, ... }:
{ {
options.swarselmodules.programs = lib.mkEnableOption "small program modules config"; options.swarselsystems.modules.programs = lib.mkEnableOption "small program modules config";
config = lib.mkIf config.swarselmodules.programs { config = lib.mkIf config.swarselsystems.modules.programs {
programs = { programs = {
dconf.enable = true; dconf.enable = true;
evince.enable = true; evince.enable = true;

View file

@ -1,7 +1,7 @@
{ config, pkgs, lib, ... }: { { config, pkgs, lib, ... }: {
options.swarselmodules.pulseaudio = lib.mkEnableOption "pulseaudio config"; options.swarselsystems.modules.pulseaudio = lib.mkEnableOption "pulseaudio config";
config = lib.mkIf config.swarselmodules.pulseaudio { config = lib.mkIf config.swarselsystems.modules.pulseaudio {
services.pulseaudio = { services.pulseaudio = {
enable = lib.mkIf (!config.services.pipewire.enable) true; enable = lib.mkIf (!config.services.pipewire.enable) true;
package = pkgs.pulseaudioFull; package = pkgs.pulseaudioFull;

View file

@ -1,7 +1,7 @@
{ config, lib, ... }: { config, lib, ... }:
{ {
options.swarselmodules.sops = lib.mkEnableOption "sops config"; options.swarselsystems.modules.sops = lib.mkEnableOption "sops config";
config = lib.mkIf config.swarselmodules.sops { config = lib.mkIf config.swarselsystems.modules.sops {
sops = { sops = {
# age.sshKeyPaths = lib.swarselsystems.mkIfElseList config.swarselsystems.isBtrfs [ "/persist/.ssh/sops" "/persist/.ssh/ssh_host_ed25519_key" ] [ "${config.swarselsystems.homeDir}/.ssh/sops" "/etc/ssh/sops" "/etc/ssh/ssh_host_ed25519_key" ]; # age.sshKeyPaths = lib.swarselsystems.mkIfElseList config.swarselsystems.isBtrfs [ "/persist/.ssh/sops" "/persist/.ssh/ssh_host_ed25519_key" ] [ "${config.swarselsystems.homeDir}/.ssh/sops" "/etc/ssh/sops" "/etc/ssh/ssh_host_ed25519_key" ];

View file

@ -1,20 +1,20 @@
{ self, lib, config, vars, ... }: { self, lib, config, ... }:
{ {
options.swarselmodules.stylix = lib.mkEnableOption "stylix config"; options.swarselsystems.modules.stylix = lib.mkEnableOption "stylix config";
config = { config = {
stylix = { stylix = {
enable = true; enable = true;
base16Scheme = "${self}/files/stylix/swarsel.yaml"; base16Scheme = "${self}/files/stylix/swarsel.yaml";
} // lib.optionalAttrs config.swarselmodules.stylix } // lib.optionalAttrs config.swarselsystems.modules.stylix
(lib.recursiveUpdate (lib.recursiveUpdate
{ {
targets.grub.enable = false; # the styling makes grub more ugly targets.grub.enable = false; # the styling makes grub more ugly
image = config.swarselsystems.wallpaper; image = config.swarselsystems.wallpaper;
} }
vars.stylix); config.swarselsystems.stylix);
home-manager.users."${config.swarselsystems.mainUser}" = { home-manager.users."${config.swarselsystems.mainUser}" = {
stylix = { stylix = {
targets = vars.stylixHomeTargets; targets = config.swarselsystems.stylixHomeTargets;
}; };
}; };
}; };

View file

@ -1,7 +1,7 @@
{ lib, config, pkgs, ... }: { lib, config, pkgs, ... }:
{ {
options.swarselmodules.sway = lib.mkEnableOption "sway config"; options.swarselsystems.modules.sway = lib.mkEnableOption "sway config";
config = lib.mkIf config.swarselmodules.sway { config = lib.mkIf config.swarselsystems.modules.sway {
programs.sway = { programs.sway = {
enable = true; enable = true;
package = pkgs.dev.swayfx; package = pkgs.dev.swayfx;

View file

@ -1,7 +1,7 @@
{ lib, pkgs, config, ... }: { lib, pkgs, config, ... }:
{ {
options.swarselmodules.swayosd = lib.mkEnableOption "swayosd settings"; options.swarselsystems.modules.swayosd = lib.mkEnableOption "swayosd settings";
config = lib.mkIf config.swarselmodules.swayosd { config = lib.mkIf config.swarselsystems.modules.swayosd {
environment.systemPackages = [ pkgs.dev.swayosd ]; environment.systemPackages = [ pkgs.dev.swayosd ];
services.udev.packages = [ pkgs.dev.swayosd ]; services.udev.packages = [ pkgs.dev.swayosd ];
systemd.services.swayosd-libinput-backend = { systemd.services.swayosd-libinput-backend = {

View file

@ -1,11 +1,10 @@
{ lib, config, pkgs, ... }: { lib, config, pkgs, ... }:
let let
inherit (config.swarselsystems) mainUser homeDir; inherit (config.swarselsystems) mainUser homeDir;
devices = config.swarselsystems.syncthing.syncDevices;
in in
{ {
options.swarselmodules.syncthing = lib.mkEnableOption "syncthing config"; options.swarselsystems.modules.syncthing = lib.mkEnableOption "syncthing config";
config = lib.mkIf config.swarselmodules.syncthing { config = lib.mkIf config.swarselsystems.modules.syncthing {
services.syncthing = { services.syncthing = {
enable = true; enable = true;
package = pkgs.stable.syncthing; package = pkgs.stable.syncthing;
@ -19,26 +18,39 @@ in
options = { options = {
urAccepted = -1; urAccepted = -1;
}; };
inherit (config.swarselsystems.syncthing) devices; devices = {
"magicant" = {
id = "VMWGEE2-4HDS2QO-KNQOVGN-LXLX6LA-666E4EK-ZBRYRRO-XFEX6FB-6E3XLQO";
};
"sync@oracle" = {
id = "ETW6TST-NPK7MKZ-M4LXMHA-QUPQHDT-VTSHH5X-CR5EIN2-YU7E55F-MGT7DQB";
};
"winters" = {
id = "O7RWDMD-AEAHPP7-7TAVLKZ-BSWNBTU-2VA44MS-EYGUNBB-SLHKB3C-ZSLMOAA";
};
"moonside@oracle" = {
id = "VPCDZB6-MGVGQZD-Q6DIZW3-IZJRJTO-TCC3QUQ-2BNTL7P-AKE7FBO-N55UNQE";
};
};
folders = { folders = {
"Default Folder" = lib.mkDefault { "Default Folder" = lib.mkDefault {
path = "${homeDir}/Sync"; path = "${homeDir}/Sync";
inherit devices; devices = [ "sync@oracle" "magicant" "winters" "moonside@oracle" ];
id = "default"; id = "default";
}; };
"Obsidian" = { "Obsidian" = {
path = "${homeDir}/Nextcloud/Obsidian"; path = "${homeDir}/Nextcloud/Obsidian";
inherit devices; devices = [ "sync@oracle" "magicant" "winters" "moonside@oracle" ];
id = "yjvni-9eaa7"; id = "yjvni-9eaa7";
}; };
"Org" = { "Org" = {
path = "${homeDir}/Nextcloud/Org"; path = "${homeDir}/Nextcloud/Org";
inherit devices; devices = [ "sync@oracle" "magicant" "winters" "moonside@oracle" ];
id = "a7xnl-zjj3d"; id = "a7xnl-zjj3d";
}; };
"Vpn" = { "Vpn" = {
path = "${homeDir}/Vpn"; path = "${homeDir}/Vpn";
inherit devices; devices = [ "sync@oracle" "magicant" "winters" "moonside@oracle" ];
id = "hgp9s-fyq3p"; id = "hgp9s-fyq3p";
}; };
}; };

View file

@ -1,7 +1,7 @@
{ lib, config, ... }: { lib, config, ... }:
{ {
options.swarselmodules.systemdTimeout = lib.mkEnableOption "systemd timeout config"; options.swarselsystems.modules.systemdTimeout = lib.mkEnableOption "systemd timeout config";
config = lib.mkIf config.swarselmodules.systemdTimeout { config = lib.mkIf config.swarselsystems.modules.systemdTimeout {
# systemd # systemd
systemd.extraConfig = '' systemd.extraConfig = ''
DefaultTimeoutStartSec=60s DefaultTimeoutStartSec=60s

View file

@ -1,7 +1,7 @@
{ lib, config, pkgs, ... }: { lib, config, pkgs, ... }:
{ {
options.swarselmodules.xdg-portal = lib.mkEnableOption "xdg portal config"; options.swarselsystems.modules.xdg-portal = lib.mkEnableOption "xdg portal config";
config = lib.mkIf config.swarselmodules.xdg-portal { config = lib.mkIf config.swarselsystems.modules.xdg-portal {
xdg.portal = { xdg.portal = {
enable = true; enable = true;
config = { config = {

View file

@ -1,7 +1,7 @@
{ lib, config, pkgs, ... }: { lib, config, pkgs, ... }:
{ {
options.swarselmodules.zsh = lib.mkEnableOption "zsh base config"; options.swarselsystems.modules.zsh = lib.mkEnableOption "zsh base config";
config = lib.mkIf config.swarselmodules.zsh { config = lib.mkIf config.swarselsystems.modules.zsh {
programs.zsh = { programs.zsh = {
enable = true; enable = true;
enableCompletion = false; enableCompletion = false;

View file

@ -1,25 +0,0 @@
{ lib, pkgs, config, globals, ... }:
{
options.swarselmodules.boot = lib.mkEnableOption "boot config";
config = lib.mkIf config.swarselmodules.boot {
boot = {
initrd.systemd = {
enable = true;
emergencyAccess = globals.root.hashedPassword;
users.root.shell = "${pkgs.bashInteractive}/bin/bash";
storePaths = [ "${pkgs.bashInteractive}/bin/bash" ];
extraBin = {
ip = "${pkgs.iproute2}/bin/ip";
ping = "${pkgs.iputils}/bin/ping";
cryptsetup = "${pkgs.cryptsetup}/bin/cryptsetup";
};
};
kernelParams = [ "log_buf_len=16M" ];
tmp.useTmpfs = true;
loader.timeout = lib.mkDefault 2;
};
console.earlySetup = true;
};
}

View file

@ -1,9 +1,11 @@
{ lib, ... }: { self, lib, ... }:
let let
importNames = lib.swarselsystems.readNix "modules/nixos/common"; importNames = lib.swarselsystems.readNix "modules/nixos/common";
sharedNames = lib.swarselsystems.readNix "modules/shared";
in in
{ {
imports = lib.swarselsystems.mkImports importNames "modules/nixos/common" ++ imports = lib.swarselsystems.mkImports importNames "modules/nixos/common" ++ [
lib.swarselsystems.mkImports sharedNames "modules/shared"; "${self}/modules/shared/sharedsetup.nix"
];
} }

View file

@ -11,12 +11,6 @@ in
default = { }; default = { };
type = types.submodule { type = types.submodule {
options = { options = {
root = {
hashedPassword = mkOption {
type = types.str;
};
};
user = { user = {
name = mkOption { name = mkOption {
type = types.str; type = types.str;

View file

@ -1,36 +0,0 @@
{ lib, config, globals, ... }:
let
inherit (config.swarselsystems) mainUser homeDir;
inherit (config.repo.secrets.common.emacs) radicaleUser;
modules = config.home-manager.users.${mainUser}.swarselmodules;
in
{
config = lib.mkIf config.swarselsystems.withHomeManager {
sops = {
secrets = (lib.optionalAttrs modules.mail
{
address1-token = { owner = mainUser; };
address2-token = { owner = mainUser; };
address3-token = { owner = mainUser; };
address4-token = { owner = mainUser; };
}) // (lib.optionalAttrs modules.waybar {
github-notifications-token = { owner = mainUser; };
}) // (lib.optionalAttrs modules.emacs {
fever-pw = { path = "${homeDir}/.emacs.d/.fever"; owner = mainUser; };
}) // (lib.optionalAttrs modules.zsh {
croc-password = { owner = mainUser; };
}) // (lib.optionalAttrs modules.emacs {
emacs-radicale-pw = { owner = mainUser; };
});
templates = {
authinfo = {
path = "${homeDir}/.emacs.d/.authinfo";
content = ''
machine ${globals.services.radicale.domain} login ${radicaleUser} password ${config.sops.placeholder.emacs-radicale-pw}
'';
owner = mainUser;
};
};
};
};
}

View file

@ -1,12 +1,12 @@
{ self, inputs, config, lib, outputs, globals, options, nodes, minimal, configName, ... }: { self, inputs, config, lib, outputs, globals, nodes, minimal, configName, ... }:
{ {
options.swarselmodules.home-manager = lib.mkEnableOption "home-manager"; options.swarselsystems.modules.home-manager = lib.mkEnableOption "home-manager";
config = lib.mkIf config.swarselmodules.home-manager { config = lib.mkIf config.swarselsystems.modules.home-manager {
home-manager = lib.mkIf config.swarselsystems.withHomeManager { home-manager = lib.mkIf config.swarselsystems.withHomeManager {
useGlobalPkgs = true; useGlobalPkgs = true;
useUserPackages = true; useUserPackages = true;
verbose = true; verbose = true;
users.${config.swarselsystems.mainUser}.imports = [ users.swarsel.imports = [
inputs.nix-index-database.hmModules.nix-index inputs.nix-index-database.hmModules.nix-index
inputs.sops-nix.homeManagerModules.sops inputs.sops-nix.homeManagerModules.sops
# inputs.stylix.homeModules.stylix # inputs.stylix.homeModules.stylix
@ -14,11 +14,8 @@
imports = [ imports = [
"${self}/profiles/home" "${self}/profiles/home"
"${self}/modules/home" "${self}/modules/home"
{ # "${self}/modules/nixos/common/pii.nix"
swarselprofiles = { # "${self}/modules/nixos/common/meta.nix"
minimal = lib.mkIf minimal true;
};
}
]; ];
# node = { # node = {
# secretsDir = if (!config.swarselsystems.isNixos) then ../../../hosts/home/${configName}/secrets else ../../../hosts/nixos/${configName}/secrets; # secretsDir = if (!config.swarselsystems.isNixos) then ../../../hosts/home/${configName}/secrets else ../../../hosts/nixos/${configName}/secrets;

View file

@ -4,8 +4,8 @@ let
inherit (config.swarselsystems) isImpermanence isCrypted; inherit (config.swarselsystems) isImpermanence isCrypted;
in in
{ {
options.swarselmodules.impermanence = lib.mkEnableOption "impermanence config"; options.swarselsystems.modules.impermanence = lib.mkEnableOption "impermanence config";
config = lib.mkIf config.swarselmodules.impermanence { config = lib.mkIf config.swarselsystems.modules.impermanence {
security.sudo.extraConfig = lib.mkIf isImpermanence '' security.sudo.extraConfig = lib.mkIf isImpermanence ''

Some files were not shown because too many files have changed in this diff Show more