style: format Swarselsystems.org to nixpkgs-fmt

This commit is contained in:
Swarsel 2024-08-10 17:36:22 +02:00
parent d96c4de8dd
commit 38c1ddac38
Signed by: swarsel
GPG key ID: 26A54C31F2A4FD84
10 changed files with 1257 additions and 1299 deletions

View file

@ -1893,7 +1893,6 @@ My old laptop, replaced by a new one, since most basic functions have stopped to
#+begin_src nix :tangle profiles/home-manager/default.nix #+begin_src nix :tangle profiles/home-manager/default.nix
{ inputs, outputs, config, ... }: { inputs, outputs, config, ... }:
{ {
@ -1945,8 +1944,7 @@ My old laptop, replaced by a new one, since most basic functions have stopped to
xkb_variant = "altgr-intl"; xkb_variant = "altgr-intl";
}; };
}; };
keybindings = { keybindings = { };
};
}; };
} }
@ -1964,7 +1962,6 @@ This is basically just adjusted to the core count, path to the =hwmon= (this was
#+begin_src nix :tangle profiles/fourside/default.nix #+begin_src nix :tangle profiles/fourside/default.nix
{ inputs, outputs, config, pkgs, ... }: { inputs, outputs, config, pkgs, ... }:
{ {
@ -2088,7 +2085,6 @@ My work machine.
#+begin_src nix :tangle profiles/nbl-imba-2/default.nix #+begin_src nix :tangle profiles/nbl-imba-2/default.nix
{ inputs, outputs, config, pkgs, lib, ... }: { inputs, outputs, config, pkgs, lib, ... }:
{ {
@ -2267,9 +2263,9 @@ In the long run, I am thinking about a transition to kubernetes or using just a
:END: :END:
#+begin_src nix :tangle profiles/server1/TEMPLATE/nixos.nix #+begin_src nix :tangle profiles/server1/TEMPLATE/nixos.nix
{ pkgs, modulesPath, ... }: { pkgs, modulesPath, ... }:
{ {
imports = [ imports = [
(modulesPath + "/virtualisation/proxmox-lxc.nix") (modulesPath + "/virtualisation/proxmox-lxc.nix")
]; ];
@ -2307,7 +2303,7 @@ In the long run, I am thinking about a transition to kubernetes or using just a
# users.users.root.password = "TEMPLATE"; # users.users.root.password = "TEMPLATE";
system.stateVersion = "23.05"; # TEMPLATE - but probably no need to change system.stateVersion = "23.05"; # TEMPLATE - but probably no need to change
} }
#+end_src #+end_src
@ -3034,7 +3030,7 @@ Make sure to also do this for doublepuppet.yaml
matrixDomain = "matrix2.swarsel.win"; matrixDomain = "matrix2.swarsel.win";
in in
{ {
<<vminitbare>> << vminitbare>>
imports = [ imports = [
(modulesPath + "/virtualisation/proxmox-lxc.nix") (modulesPath + "/virtualisation/proxmox-lxc.nix")
@ -4132,8 +4128,7 @@ As such, I also define three additional overlays:
*** Packages *** Packages
#+begin_src nix :tangle pkgs/default.nix #+begin_src nix :tangle pkgs/default.nix
{ pkgs, ... }:
{pkgs, ...}:
let let
inherit (pkgs) callPackage; inherit (pkgs) callPackage;
in in
@ -4203,7 +4198,7 @@ As such, I also define three additional overlays:
#+end_src #+end_src
#+begin_src nix :tangle pkgs/pass-fuzzel/default.nix #+begin_src nix :tangle pkgs/pass-fuzzel/default.nix
{writeShellApplication, libnotify, pass, fuzzel, wtype}: { writeShellApplication, libnotify, pass, fuzzel, wtype }:
writeShellApplication { writeShellApplication {
name = "pass-fuzzel"; name = "pass-fuzzel";
@ -4217,8 +4212,7 @@ As such, I also define three additional overlays:
#+begin_src nix :tangle pkgs/cura5/default.nix #+begin_src nix :tangle pkgs/cura5/default.nix
{ appimageTools, fetchurl, writeScriptBin, pkgs }:
{appimageTools, fetchurl, writeScriptBin, pkgs}:
let let
@ -4253,8 +4247,7 @@ As such, I also define three additional overlays:
#+begin_src nix :tangle pkgs/cdw/default.nix #+begin_src nix :tangle pkgs/cdw/default.nix
{ writeShellApplication, fzf }:
{writeShellApplication, fzf}:
writeShellApplication { writeShellApplication {
name = "cdw"; name = "cdw";
@ -4271,8 +4264,7 @@ As such, I also define three additional overlays:
#+begin_src nix :tangle pkgs/cdb/default.nix #+begin_src nix :tangle pkgs/cdb/default.nix
{ writeShellApplication, fzf }:
{writeShellApplication, fzf}:
writeShellApplication { writeShellApplication {
name = "cdb"; name = "cdb";
@ -4288,8 +4280,7 @@ As such, I also define three additional overlays:
#+begin_src nix :tangle pkgs/bak/default.nix #+begin_src nix :tangle pkgs/bak/default.nix
{ writeShellApplication }:
{writeShellApplication}:
writeShellApplication { writeShellApplication {
name = "bak"; name = "bak";
@ -4305,8 +4296,7 @@ As such, I also define three additional overlays:
#+begin_src nix :tangle pkgs/timer/default.nix #+begin_src nix :tangle pkgs/timer/default.nix
{ writeShellApplication, speechd }:
{writeShellApplication, speechd}:
writeShellApplication { writeShellApplication {
name = "timer"; name = "timer";
@ -4346,7 +4336,7 @@ As such, I also define three additional overlays:
#+end_src #+end_src
#+begin_src nix :tangle pkgs/e/default.nix #+begin_src nix :tangle pkgs/e/default.nix
{ writeShellApplication, emacs-pgtk, sway, jq}: { writeShellApplication, emacs-pgtk, sway, jq }:
writeShellApplication { writeShellApplication {
name = "e"; name = "e";
@ -4456,7 +4446,7 @@ As such, I also define three additional overlays:
#+end_src #+end_src
#+begin_src nix :tangle pkgs/swarselcheck/default.nix #+begin_src nix :tangle pkgs/swarselcheck/default.nix
{ writeShellApplication, kitty, element-desktop-wayland, vesktop, spotify-player, sway, jq}: { writeShellApplication, kitty, element-desktop-wayland, vesktop, spotify-player, sway, jq }:
writeShellApplication { writeShellApplication {
name = "swarselcheck"; name = "swarselcheck";
@ -4497,7 +4487,7 @@ As such, I also define three additional overlays:
#+end_src #+end_src
#+begin_src nix :tangle pkgs/waybarupdate/default.nix #+begin_src nix :tangle pkgs/waybarupdate/default.nix
{ writeShellApplication, git}: { writeShellApplication, git }:
writeShellApplication { writeShellApplication {
name = "waybarupdate"; name = "waybarupdate";
@ -4518,7 +4508,7 @@ As such, I also define three additional overlays:
#+end_src #+end_src
#+begin_src nix :tangle pkgs/opacitytoggle/default.nix #+begin_src nix :tangle pkgs/opacitytoggle/default.nix
{ writeShellApplication, sway}: { writeShellApplication, sway }:
writeShellApplication { writeShellApplication {
name = "opacitytoggle"; name = "opacitytoggle";
@ -4553,7 +4543,7 @@ done
#+end_src #+end_src
#+begin_src nix :tangle pkgs/fs-diff/default.nix #+begin_src nix :tangle pkgs/fs-diff/default.nix
{ writeShellApplication, sway}: { writeShellApplication, sway }:
writeShellApplication { writeShellApplication {
name = "fs-diff"; name = "fs-diff";
@ -4577,7 +4567,7 @@ done
#+end_src #+end_src
#+begin_src nix :tangle pkgs/update-checker/default.nix #+begin_src nix :tangle pkgs/update-checker/default.nix
{ writeShellApplication, nvd}: { writeShellApplication, nvd }:
writeShellApplication { writeShellApplication {
name = "update-checker"; name = "update-checker";
@ -4590,7 +4580,6 @@ done
*** Overlays *** Overlays
#+begin_src nix :tangle overlays/default.nix #+begin_src nix :tangle overlays/default.nix
{ inputs, ... }: { { inputs, ... }: {
additions = final: _prev: import ../pkgs { pkgs = final; }; additions = final: _prev: import ../pkgs { pkgs = final; };
modifications = final: _prev: { modifications = final: _prev: {
@ -4834,7 +4823,7 @@ Modules that need to be loaded on the NixOS level. Note that these will not be a
in in
{ {
options.swarselsystems.monitors = mkOption { options.swarselsystems.monitors = mkOption {
type = types.attrsOf (types.attrsOf types.str ); type = types.attrsOf (types.attrsOf types.str);
default = { }; default = { };
}; };
} }
@ -4849,11 +4838,11 @@ Modules that need to be loaded on the NixOS level. Note that these will not be a
in in
{ {
options.swarselsystems.inputs = mkOption { options.swarselsystems.inputs = mkOption {
type = types.attrsOf (types.attrsOf types.str ); type = types.attrsOf (types.attrsOf types.str);
default = { }; default = { };
}; };
options.swarselsystems.kyria = mkOption { options.swarselsystems.kyria = mkOption {
type = types.attrsOf (types.attrsOf types.str ); type = types.attrsOf (types.attrsOf types.str);
default = { default = {
"36125:53060:splitkb.com_splitkb.com_Kyria_rev3" = { "36125:53060:splitkb.com_splitkb.com_Kyria_rev3" = {
xkb_layout = "us"; xkb_layout = "us";
@ -4862,11 +4851,11 @@ Modules that need to be loaded on the NixOS level. Note that these will not be a
}; };
}; };
options.swarselsystems.touchpad = mkOption { options.swarselsystems.touchpad = mkOption {
type = types.attrsOf (types.attrsOf types.str ); type = types.attrsOf (types.attrsOf types.str);
default = { }; default = { };
}; };
options.swarselsystems.standardinputs = mkOption { options.swarselsystems.standardinputs = mkOption {
type = types.attrsOf (types.attrsOf types.str ); type = types.attrsOf (types.attrsOf types.str);
default = lib.recursiveUpdate (lib.recursiveUpdate config.swarselsystems.touchpad config.swarselsystems.kyria) config.swarselsystems.inputs; default = lib.recursiveUpdate (lib.recursiveUpdate config.swarselsystems.touchpad config.swarselsystems.kyria) config.swarselsystems.inputs;
internal = true; internal = true;
}; };
@ -4886,7 +4875,8 @@ Modules that need to be loaded on the NixOS level. Note that these will not be a
{ {
options.swarselsystems.isNixos = lib.mkEnableOption "nixos host"; options.swarselsystems.isNixos = lib.mkEnableOption "nixos host";
config.swarselsystems.startup = lib.mkIf (!config.swarselsystems.isNixos) [ config.swarselsystems.startup = lib.mkIf (!config.swarselsystems.isNixos) [
{ command = "sleep 60 && nixGL nextcloud --background"; {
command = "sleep 60 && nixGL nextcloud --background";
} }
{ command = "sleep 60 && nixGL vesktop --start-minimized -enable-features=UseOzonePlatform -ozone-platform=wayland"; } { command = "sleep 60 && nixGL vesktop --start-minimized -enable-features=UseOzonePlatform -ozone-platform=wayland"; }
{ command = "sleep 60 && nixGL syncthingtray --wait"; } { command = "sleep 60 && nixGL syncthingtray --wait"; }
@ -4977,7 +4967,6 @@ These are system-level settings specific to NixOS machines. All settings that ar
First, we enable the use of =home-manager= as a NixoS module First, we enable the use of =home-manager= as a NixoS module
#+begin_src nix :tangle profiles/common/nixos/default.nix #+begin_src nix :tangle profiles/common/nixos/default.nix
{ lib, inputs, ... }: { lib, inputs, ... }:
{ {
imports = [ imports = [
@ -5015,9 +5004,11 @@ First, we enable the use of =home-manager= as a NixoS module
./xdg-portal.nix ./xdg-portal.nix
]; ];
nix = let nix =
let
flakeInputs = lib.filterAttrs (_: lib.isType "flake") inputs; flakeInputs = lib.filterAttrs (_: lib.isType "flake") inputs;
in { in
{
settings = { settings = {
experimental-features = [ experimental-features = [
"nix-command" "nix-command"
@ -5029,7 +5020,7 @@ First, we enable the use of =home-manager= as a NixoS module
warn-dirty = false; warn-dirty = false;
}; };
channel.enable = false; channel.enable = false;
registry = lib.mapAttrs (_: flake: {inherit flake;}) flakeInputs; registry = lib.mapAttrs (_: flake: { inherit flake; }) flakeInputs;
nixPath = lib.mapAttrsToList (n: _: "${n}=flake:${n}") flakeInputs; nixPath = lib.mapAttrsToList (n: _: "${n}=flake:${n}") flakeInputs;
}; };
@ -5051,7 +5042,7 @@ First, we enable the use of =home-manager= as a NixoS module
Next, we setup the keymap in case we are not in a graphical session. At this point, I always resort to us/altgr-intl, as it is extremly comfortable to use Next, we setup the keymap in case we are not in a graphical session. At this point, I always resort to us/altgr-intl, as it is extremly comfortable to use
#+begin_src nix :tangle profiles/common/nixos/xserver.nix #+begin_src nix :tangle profiles/common/nixos/xserver.nix
_ : _:
{ {
services.xserver = { services.xserver = {
xkb = { xkb = {
@ -5119,7 +5110,7 @@ Next, we will setup some environment variables that need to be set on the system
Needed for control over system-wide privileges etc. Needed for control over system-wide privileges etc.
#+begin_src nix :tangle profiles/common/nixos/polkit.nix #+begin_src nix :tangle profiles/common/nixos/polkit.nix
_ : _:
{ {
security.pam.services = { security.pam.services = {
@ -5141,7 +5132,7 @@ Needed for control over system-wide privileges etc.
The nix store fills up over time, until =/boot/efi= is filled. This snippet cleans it automatically on a weekly basis. The nix store fills up over time, until =/boot/efi= is filled. This snippet cleans it automatically on a weekly basis.
#+begin_src nix :tangle profiles/common/nixos/gc.nix #+begin_src nix :tangle profiles/common/nixos/gc.nix
_ : _:
{ {
nix.gc = { nix.gc = {
automatic = true; automatic = true;
@ -5160,7 +5151,7 @@ The nix store fills up over time, until =/boot/efi= is filled. This snippet clea
This enables hardlinking identical files in the nix store, to save on disk space. I have read this incurs a significant I/O overhead, I need to keep an eye on this. This enables hardlinking identical files in the nix store, to save on disk space. I have read this incurs a significant I/O overhead, I need to keep an eye on this.
#+begin_src nix :tangle profiles/common/nixos/store.nix #+begin_src nix :tangle profiles/common/nixos/store.nix
_ : _:
{ {
nix.optimise = { nix.optimise = {
automatic = true; automatic = true;
@ -5178,7 +5169,7 @@ This enables hardlinking identical files in the nix store, to save on disk space
There is a persistent bug over Linux kernels that makes the user wait 1m30s on system shutdown due to the reason =a stop job is running for session 1 of user ...=. I do not want to wait that long and am confident no important data is lost by doing this. There is a persistent bug over Linux kernels that makes the user wait 1m30s on system shutdown due to the reason =a stop job is running for session 1 of user ...=. I do not want to wait that long and am confident no important data is lost by doing this.
#+begin_src nix :tangle profiles/common/nixos/systemd.nix #+begin_src nix :tangle profiles/common/nixos/systemd.nix
_ : _:
{ {
# systemd # systemd
systemd.extraConfig = '' systemd.extraConfig = ''
@ -5196,7 +5187,7 @@ There is a persistent bug over Linux kernels that makes the user wait 1m30s on s
Enable OpenGL, Sound, Bluetooth and various drivers. Enable OpenGL, Sound, Bluetooth and various drivers.
#+begin_src nix :tangle profiles/common/nixos/hardware.nix #+begin_src nix :tangle profiles/common/nixos/hardware.nix
{ pkgs, config, lib, ...}: { pkgs, config, lib, ... }:
{ {
hardware = { hardware = {
@ -5239,7 +5230,7 @@ Enable OpenGL, Sound, Bluetooth and various drivers.
**** Pipewire **** Pipewire
#+begin_src nix :tangle profiles/common/nixos/pipewire.nix #+begin_src nix :tangle profiles/common/nixos/pipewire.nix
_ : { _: {
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 = {
@ -5262,7 +5253,7 @@ Enable OpenGL, Sound, Bluetooth and various drivers.
Here I only enable =networkmanager=. Most of the 'real' network config is done in [[#h:88bf4b90-e94b-46fb-aaf1-a381a512860d][System specific configuration]]. Here I only enable =networkmanager=. Most of the 'real' network config is done in [[#h:88bf4b90-e94b-46fb-aaf1-a381a512860d][System specific configuration]].
#+begin_src nix :tangle profiles/common/nixos/network.nix #+begin_src nix :tangle profiles/common/nixos/network.nix
{ lib, config, ...}: { lib, config, ... }:
{ {
networking = { networking = {
nftables.enable = lib.mkDefault true; nftables.enable = lib.mkDefault true;
@ -5489,7 +5480,7 @@ Here I only enable =networkmanager=. Most of the 'real' network config is done i
Setup timezone and locale. I want to use the US layout, but have the rest adapted to my country and timezone. Also, there is an issue with running Windows/Linux dualboot on the same machine where the hardware clock desyncs between the two OS'es. We fix that bug here as well. Setup timezone and locale. I want to use the US layout, but have the rest adapted to my country and timezone. Also, there is an issue with running Windows/Linux dualboot on the same machine where the hardware clock desyncs between the two OS'es. We fix that bug here as well.
#+begin_src nix :tangle profiles/common/nixos/time.nix #+begin_src nix :tangle profiles/common/nixos/time.nix
_ : _:
{ {
time = { time = {
timeZone = "Europe/Vienna"; timeZone = "Europe/Vienna";
@ -5582,7 +5573,7 @@ By default, [[https://github.com/danth/stylix][stylix]] wants to style GRUB as w
image = config.swarselsystems.wallpaper; image = config.swarselsystems.wallpaper;
}; };
home-manager.users.swarsel = { home-manager.users.swarsel = {
stylix= { stylix = {
targets = { targets = {
emacs.enable = false; emacs.enable = false;
waybar.enable = false; waybar.enable = false;
@ -5707,7 +5698,7 @@ Mostly used to install some compilers and lsp's that I want to have available wh
Some programs profit from being installed through dedicated NixOS settings on system-level; these go here. Notably the zsh setup goes here and cannot be deleted under any circumstances. Some programs profit from being installed through dedicated NixOS settings on system-level; these go here. Notably the zsh setup goes here and cannot be deleted under any circumstances.
#+begin_src nix :tangle profiles/common/nixos/programs.nix #+begin_src nix :tangle profiles/common/nixos/programs.nix
_ : _:
{ {
programs = { programs = {
dconf.enable = true; dconf.enable = true;
@ -5733,7 +5724,7 @@ Do not touch this.
#+begin_src nix :tangle profiles/common/nixos/syncthing.nix #+begin_src nix :tangle profiles/common/nixos/syncthing.nix
_ : _:
{ {
services.syncthing = { services.syncthing = {
enable = true; enable = true;
@ -5756,22 +5747,22 @@ Do not touch this.
folders = { folders = {
"Default Folder" = { "Default Folder" = {
path = "/home/swarsel/Sync"; path = "/home/swarsel/Sync";
devices = [ "sync (@oracle)" ]; devices = [ "sync (@oracle) magicant" ];
id = "default"; id = "default";
}; };
"Obsidian" = { "Obsidian" = {
path = "/home/swarsel/Nextcloud/Obsidian"; path = "/home/swarsel/Nextcloud/Obsidian";
devices = [ "sync (@oracle)" ]; devices = [ "sync (@oracle) magicant" ];
id = "yjvni-9eaa7"; id = "yjvni-9eaa7";
}; };
"Org" = { "Org" = {
path = "/home/swarsel/Nextcloud/Org"; path = "/home/swarsel/Nextcloud/Org";
devices = [ "sync (@oracle)" ]; devices = [ "sync (@oracle) magicant" ];
id = "a7xnl-zjj3d"; id = "a7xnl-zjj3d";
}; };
"Vpn" = { "Vpn" = {
path = "/home/swarsel/Vpn"; path = "/home/swarsel/Vpn";
devices = [ "sync (@oracle)" ]; devices = [ "sync (@oracle) magicant" ];
id = "hgp9s-fyq3p"; id = "hgp9s-fyq3p";
}; };
}; };
@ -5795,7 +5786,7 @@ Setting up some hardware services as well as keyboard related settings. Here we
Enables the blueman service including the nice system tray icon. Enables the blueman service including the nice system tray icon.
#+begin_src nix :tangle profiles/common/nixos/blueman.nix #+begin_src nix :tangle profiles/common/nixos/blueman.nix
_ : _:
{ {
services.blueman.enable = true; services.blueman.enable = true;
} }
@ -5806,7 +5797,7 @@ Enables the blueman service including the nice system tray icon.
Enables the blueman service including the nice system tray icon. Enables the blueman service including the nice system tray icon.
#+begin_src nix :tangle profiles/common/nixos/safeeyes.nix #+begin_src nix :tangle profiles/common/nixos/safeeyes.nix
_ : _:
{ {
services.safeeyes.enable = true; services.safeeyes.enable = true;
} }
@ -5823,7 +5814,7 @@ In this section we enable compatibility with several network devices I have at h
This allows me to use my big scanner/printer's scanning function over the network. This allows me to use my big scanner/printer's scanning function over the network.
#+begin_src nix :tangle profiles/common/nixos/networkdevices.nix #+begin_src nix :tangle profiles/common/nixos/networkdevices.nix
{pkgs, ...}: { pkgs, ... }:
{ {
# enable scanners over network # enable scanners over network
hardware.sane = { hardware.sane = {
@ -5841,6 +5832,7 @@ This allows me to use my big scanner/printer's scanning function over the networ
This allows me to use my big scanner/printer's printing function over the network. Most of the settings are driver related. This allows me to use my big scanner/printer's printing function over the network. Most of the settings are driver related.
#+begin_src nix :tangle profiles/common/nixos/networkdevices.nix #+begin_src nix :tangle profiles/common/nixos/networkdevices.nix
# enable discovery and usage of network devices (esp. printers) # enable discovery and usage of network devices (esp. printers)
services.printing = { services.printing = {
enable = true; enable = true;
@ -5856,6 +5848,7 @@ This allows me to use my big scanner/printer's printing function over the networ
BrowseProtocols all BrowseProtocols all
''; '';
}; };
#+end_src #+end_src
****** Avahi (device discovery) ****** Avahi (device discovery)
@ -5880,7 +5873,7 @@ Avahi is the service used for the network discovery.
This is being set to allow myself to use all functions of nautilus in NixOS This is being set to allow myself to use all functions of nautilus in NixOS
#+begin_src nix :tangle profiles/common/nixos/gvfs.nix #+begin_src nix :tangle profiles/common/nixos/gvfs.nix
_ : _:
{ {
services.gvfs.enable = true; services.gvfs.enable = true;
} }
@ -5894,7 +5887,6 @@ This is being set to allow myself to use all functions of nautilus in NixOS
This is a super-convenient package that lets my remap my =CAPS= key to =ESC= if pressed shortly, and =CTRL= if being held. This is a super-convenient package that lets my remap my =CAPS= key to =ESC= if pressed shortly, and =CTRL= if being held.
#+begin_src nix :tangle profiles/common/nixos/interceptiontools.nix #+begin_src nix :tangle profiles/common/nixos/interceptiontools.nix
{ pkgs, ... }: { pkgs, ... }:
{ {
# Make CAPS work as a dual function ESC/CTRL key # Make CAPS work as a dual function ESC/CTRL key
@ -5929,7 +5921,7 @@ This is a super-convenient package that lets my remap my =CAPS= key to =ESC= if
***** power-profiles-daemon ***** power-profiles-daemon
#+begin_src nix :tangle profiles/common/nixos/power-profiles-daemon.nix #+begin_src nix :tangle profiles/common/nixos/power-profiles-daemon.nix
_ : _:
{ {
services.power-profiles-daemon.enable = true; services.power-profiles-daemon.enable = true;
} }
@ -6130,12 +6122,12 @@ This section houses the greetd related settings. I do not really want to use a d
boot.initrd.systemd.services.rollback = lib.mkIf config.swarselsystems.impermanence { boot.initrd.systemd.services.rollback = lib.mkIf config.swarselsystems.impermanence {
description = "Rollback BTRFS root subvolume to a pristine state"; description = "Rollback BTRFS root subvolume to a pristine state";
wantedBy = ["initrd.target"]; wantedBy = [ "initrd.target" ];
# make sure it's done after encryption # make sure it's done after encryption
# i.e. LUKS/TPM process # i.e. LUKS/TPM process
after = ["systemd-cryptsetup@enc.service"]; after = [ "systemd-cryptsetup@enc.service" ];
# mount the root fs before clearing # mount the root fs before clearing
before = ["sysroot.mount"]; before = [ "sysroot.mount" ];
unitConfig.DefaultDependencies = "no"; unitConfig.DefaultDependencies = "no";
serviceConfig.Type = "oneshot"; serviceConfig.Type = "oneshot";
script = '' script = ''
@ -6225,8 +6217,7 @@ This section houses the greetd related settings. I do not really want to use a d
Used for storing sessions in e.g. Nextcloud Used for storing sessions in e.g. Nextcloud
#+begin_src nix :tangle profiles/common/nixos/gnome-keyring.nix #+begin_src nix :tangle profiles/common/nixos/gnome-keyring.nix
_:
_ :
{ {
services.gnome.gnome-keyring = { services.gnome.gnome-keyring = {
enable = true; enable = true;
@ -6332,7 +6323,7 @@ Used for storing sessions in e.g. Nextcloud
**** VirtualBox **** VirtualBox
#+begin_src nix :tangle profiles/optional/nixos/virtualbox.nix #+begin_src nix :tangle profiles/optional/nixos/virtualbox.nix
_ : _:
{ {
virtualisation.virtualbox = { virtualisation.virtualbox = {
host = { host = {
@ -6344,13 +6335,13 @@ Used for storing sessions in e.g. Nextcloud
enable = false; enable = false;
}; };
}; };
} }
#+end_src #+end_src
**** Auto-login **** Auto-login
#+begin_src nix :tangle profiles/optional/nixos/autologin.nix #+begin_src nix :tangle profiles/optional/nixos/autologin.nix
_ : _:
{ {
services = { services = {
getty.autologinUser = "swarsel"; getty.autologinUser = "swarsel";
@ -6424,6 +6415,7 @@ This section sets up all the imports that are used in the home-manager section.
{ {
imports = [ imports = [
./packages.nix ./packages.nix
./custom-packages.nix
./sops.nix ./sops.nix
./ssh.nix ./ssh.nix
./stylix.nix ./stylix.nix
@ -6645,7 +6637,8 @@ Programming languages and default lsp's are defined here: [[#h:0e7e8bea-ec58-499
font-awesome_5 font-awesome_5
noto-fonts noto-fonts
noto-fonts-cjk-sans noto-fonts-cjk-sans
];
}
#+end_src #+end_src
***** Self-defined ***** Self-defined
@ -6657,8 +6650,11 @@ Programming languages and default lsp's are defined here: [[#h:0e7e8bea-ec58-499
#+begin_src nix :tangle profiles/common/home/packages.nix #+begin_src nix :tangle profiles/common/home/custom-packages.nix
{ pkgs, ... }:
{
home.packages = with pkgs; [
pass-fuzzel pass-fuzzel
cura5 cura5
cdw cdw
@ -6756,7 +6752,7 @@ 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. 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 profiles/common/home/ssh.nix #+begin_src nix :tangle profiles/common/home/ssh.nix
_ : _:
{ {
programs.ssh = { programs.ssh = {
enable = true; enable = true;
@ -6852,7 +6848,7 @@ It is very convenient to have SSH aliases in place for machines that I use. This
}; };
}; };
}; };
} }
#+end_src #+end_src
**** Theme (stylix) **** Theme (stylix)
@ -6890,8 +6886,7 @@ 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. 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 profiles/common/home/desktop.nix #+begin_src nix :tangle profiles/common/home/desktop.nix
_:
_ :
{ {
xdg.desktopEntries = { xdg.desktopEntries = {
@ -6950,8 +6945,7 @@ This section should be used in order to symlink already existing configuration f
As for the `home.sessionVariables`, it should be noted that environment variables that are needed at system start should NOT be loaded here, but instead in `programs.zsh.config.extraSessionCommands` (in the home-manager programs section). This is also where all the wayland related variables are stored. As for the `home.sessionVariables`, it should be noted that environment variables that are needed at system start should NOT be loaded here, but instead in `programs.zsh.config.extraSessionCommands` (in the home-manager programs section). This is also where all the wayland related variables are stored.
#+begin_src nix :tangle profiles/common/home/symlink.nix #+begin_src nix :tangle profiles/common/home/symlink.nix
_:
_ :
{ {
home.file = { home.file = {
"init.el" = { "init.el" = {
@ -6978,12 +6972,11 @@ As for the `home.sessionVariables`, it should be noted that environment variable
Also, we link some files to the users XDG configuration home: Also, we link some files to the users XDG configuration home:
#+begin_src nix :tangle profiles/common/home/symlink.nix #+begin_src nix :tangle profiles/common/home/symlink.nix
xdg.configFile = { xdg.configFile = {
"tridactyl/tridactylrc".source = ../../../programs/firefox/tridactyl/tridactylrc; "tridactyl/tridactylrc".source = ../../../programs/firefox/tridactyl/tridactylrc;
"tridactyl/themes/base16-codeschool.css".source = ../../../programs/firefox/tridactyl/themes/base16-codeschool.css; "tridactyl/themes/base16-codeschool.css".source = ../../../programs/firefox/tridactyl/themes/base16-codeschool.css;
}; };
} }
#+end_src #+end_src
**** Sourcing environment variables **** Sourcing environment variables
@ -6992,7 +6985,7 @@ Also, we link some files to the users XDG configuration home:
:END: :END:
#+begin_src nix :tangle profiles/common/home/env.nix #+begin_src nix :tangle profiles/common/home/env.nix
_ : _:
{ {
home.sessionVariables = { home.sessionVariables = {
EDITOR = "e -w"; EDITOR = "e -w";
@ -7015,7 +7008,7 @@ This houses the configurations for all programs managed by home-manager.
This section is for programs that require no further configuration. zsh Integration is enabled by default for these. This section is for programs that require no further configuration. zsh Integration is enabled by default for these.
#+begin_src nix :tangle profiles/common/home/programs.nix #+begin_src nix :tangle profiles/common/home/programs.nix
_ : _:
{ {
programs = { programs = {
bottom.enable = true; bottom.enable = true;
@ -7041,7 +7034,7 @@ 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. 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 profiles/common/home/nix-index.nix #+begin_src nix :tangle profiles/common/home/nix-index.nix
{pkgs, ...}: { pkgs, ... }:
{ {
programs.nix-index = programs.nix-index =
let let
@ -7081,7 +7074,7 @@ Enables password store with the =pass-otp= extension which allows me to store an
}; };
package = pkgs.pass.withExtensions (exts: [ exts.pass-otp ]); package = pkgs.pass.withExtensions (exts: [ exts.pass-otp ]);
}; };
} }
#+end_src #+end_src
**** direnv **** direnv
@ -7092,7 +7085,7 @@ 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. Enables direnv, which I use for nearly all of my nix dev flakes.
#+begin_src nix :tangle profiles/common/home/direnv.nix #+begin_src nix :tangle profiles/common/home/direnv.nix
_ : _:
{ {
programs.direnv = { programs.direnv = {
enable = true; enable = true;
@ -7109,7 +7102,7 @@ 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. Eza provides me with a better =ls= command and some other useful aliases.
#+begin_src nix :tangle profiles/common/home/eza.nix #+begin_src nix :tangle profiles/common/home/eza.nix
_ : _:
{ {
programs.eza = { programs.eza = {
enable = true; enable = true;
@ -7131,7 +7124,7 @@ 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]]. 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 profiles/common/home/git.nix #+begin_src nix :tangle profiles/common/home/git.nix
_ : _:
{ {
programs.git = { programs.git = {
enable = true; enable = true;
@ -7180,7 +7173,7 @@ 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. Here I only need to set basic layout options - the rest is being managed by stylix.
#+begin_src nix :tangle profiles/common/home/fuzzel.nix #+begin_src nix :tangle profiles/common/home/fuzzel.nix
_ : _:
{ {
programs.fuzzel = { programs.fuzzel = {
enable = true; enable = true;
@ -7204,7 +7197,7 @@ 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. 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 profiles/common/home/starship.nix #+begin_src nix :tangle profiles/common/home/starship.nix
_ : _:
{ {
programs.starship = { programs.starship = {
enable = true; enable = true;
@ -7309,7 +7302,7 @@ Starship makes my =zsh= look cooler! I have symbols for most programming languag
scala.symbol = " "; scala.symbol = " ";
}; };
}; };
} }
#+end_src #+end_src
**** Kitty **** Kitty
@ -7322,7 +7315,7 @@ Kitty is the terminal emulator of choice for me, it is nice to configure using n
The theme is handled by stylix. The theme is handled by stylix.
#+begin_src nix :tangle profiles/common/home/kitty.nix #+begin_src nix :tangle profiles/common/home/kitty.nix
_ : _:
{ {
programs.kitty = { programs.kitty = {
enable = true; enable = true;
@ -7410,8 +7403,7 @@ Here we set some aliases (some of them should be shellApplications instead) as w
Normally I use 4 mail accounts - here I set them all up. Three of them are Google accounts (sadly), which are a chore to setup. The last is just a sender account that I setup SMTP for here. Normally I use 4 mail accounts - here I set them all up. Three of them are Google accounts (sadly), which are a chore to setup. The last is just a sender account that I setup SMTP for here.
#+begin_src nix :tangle profiles/common/home/mail.nix #+begin_src nix :tangle profiles/common/home/mail.nix
{ config, ... }:
{ config, ...}:
{ {
programs.mbsync = { programs.mbsync = {
enable = true; enable = true;
@ -7624,7 +7616,6 @@ The rest of this configuration is found here:
- [[#h:f3cf9bdc-6826-4d8e-ba5a-253ef098a9b8][Waybar items - LAPTOPS]] - [[#h:f3cf9bdc-6826-4d8e-ba5a-253ef098a9b8][Waybar items - LAPTOPS]]
#+begin_src nix :tangle profiles/common/home/waybar.nix #+begin_src nix :tangle profiles/common/home/waybar.nix
{ config, lib, pkgs, ... }: { config, lib, pkgs, ... }:
{ {
programs.waybar = { programs.waybar = {
@ -7699,8 +7690,8 @@ The rest of this configuration is found here:
}; };
temperature = { temperature = {
hwmon-path = lib.mkIf (!config.swarselsystems.temperatureHwmon.isAbsolutePath) config.swarselsystems.temperatureHwmon.path ; hwmon-path = lib.mkIf (!config.swarselsystems.temperatureHwmon.isAbsolutePath) config.swarselsystems.temperatureHwmon.path;
hwmon-path-abs = lib.mkIf config.swarselsystems.temperatureHwmon.isAbsolutePath config.swarselsystems.temperatureHwmon.path ; hwmon-path-abs = lib.mkIf config.swarselsystems.temperatureHwmon.isAbsolutePath config.swarselsystems.temperatureHwmon.path;
input-filename = lib.mkIf config.swarselsystems.temperatureHwmon.isAbsolutePath config.swarselsystems.temperatureHwmon.input-filename; input-filename = lib.mkIf config.swarselsystems.temperatureHwmon.isAbsolutePath config.swarselsystems.temperatureHwmon.input-filename;
critical-threshold = 80; critical-threshold = 80;
format-critical = " {temperatureC}°C"; format-critical = " {temperatureC}°C";
@ -7976,8 +7967,7 @@ Services that can be defined through home-manager should be defined here.
Used for storing sessions in e.g. Nextcloud Used for storing sessions in e.g. Nextcloud
#+begin_src nix :tangle profiles/common/home/gnome-keyring.nix #+begin_src nix :tangle profiles/common/home/gnome-keyring.nix
{ lib, config, ... }:
{ lib, config, ...} :
{ {
services.gnome-keyring = lib.mkIf (!config.swarselsystems.isNixos) { services.gnome-keyring = lib.mkIf (!config.swarselsystems.isNixos) {
enable = true; enable = true;
@ -7993,7 +7983,7 @@ Used for storing sessions in e.g. Nextcloud
This enables phone/computer communication, including sending clipboard, files etc. Sadly on Wayland many of the features are broken (like remote control). This enables phone/computer communication, including sending clipboard, files etc. Sadly on Wayland many of the features are broken (like remote control).
#+begin_src nix :tangle profiles/common/home/kdeconnect.nix #+begin_src nix :tangle profiles/common/home/kdeconnect.nix
_ : _:
{ {
services.kdeconnect = { services.kdeconnect = {
enable = true; enable = true;
@ -8012,7 +8002,7 @@ Desktop notifications!
The `extraConfig` section here CANNOT be reindented. This has something to do with how nix handles multiline strings, when indented Mako will fail to start. This might be a mako bug as well. The `extraConfig` section here CANNOT be reindented. This has something to do with how nix handles multiline strings, when indented Mako will fail to start. This might be a mako bug as well.
#+begin_src nix :tangle profiles/common/home/mako.nix #+begin_src nix :tangle profiles/common/home/mako.nix
_ : _:
{ {
services.mako = { services.mako = {
enable = true; enable = true;
@ -8088,7 +8078,8 @@ Currently, I am too lazy to explain every option here, but most of it is very se
let let
inherit (config.wayland.windowManager.sway.config) modifier; inherit (config.wayland.windowManager.sway.config) modifier;
in in
lib.recursiveUpdate { lib.recursiveUpdate
{
"${modifier}+q" = "kill"; "${modifier}+q" = "kill";
"${modifier}+f" = "exec firefox"; "${modifier}+f" = "exec firefox";
"${modifier}+Shift+f" = "exec swaymsg fullscreen"; "${modifier}+Shift+f" = "exec swaymsg fullscreen";
@ -8158,7 +8149,8 @@ Currently, I am too lazy to explain every option here, but most of it is very se
"XF86MonBrightnessUp" = "exec brightnessctl set +5%"; "XF86MonBrightnessUp" = "exec brightnessctl set +5%";
"XF86MonBrightnessDown" = "exec brightnessctl set 5%-"; "XF86MonBrightnessDown" = "exec brightnessctl set 5%-";
"XF86Display" = "exec wl-mirror eDP-1"; "XF86Display" = "exec wl-mirror eDP-1";
} config.swarselsystems.keybindings; }
config.swarselsystems.keybindings;
modes = { modes = {
resize = { resize = {
Down = "resize grow height 10 px or 10 ppt"; Down = "resize grow height 10 px or 10 ppt";
@ -8377,7 +8369,6 @@ Currently, I am too lazy to explain every option here, but most of it is very se
**** Gaming **** Gaming
#+begin_src nix :tangle profiles/optional/home/gaming.nix #+begin_src nix :tangle profiles/optional/home/gaming.nix
{ pkgs, ... }: { pkgs, ... }:
{ {
@ -8409,10 +8400,9 @@ Currently, I am too lazy to explain every option here, but most of it is very se
**** Work **** Work
#+begin_src nix :tangle profiles/optional/home/work.nix :noweb yes #+begin_src nix :tangle profiles/optional/home/work.nix :noweb yes
{ pkgs, ... }:
{ pkgs, ... }: {
{
home.packages = with pkgs; [ home.packages = with pkgs; [
teams-for-linux teams-for-linux
google-chrome google-chrome
@ -8456,7 +8446,7 @@ Currently, I am too lazy to explain every option here, but most of it is very se
}; };
}; };
} }
#+end_src #+end_src

View file

@ -0,0 +1,52 @@
{ pkgs, ... }:
{
home.packages = with pkgs; [
pass-fuzzel
cura5
cdw
cdb
bak
timer
e
swarselcheck
waybarupdate
opacitytoggle
fs-diff
update-checker
(pkgs.writeScriptBin "project" ''
#! ${pkgs.bash}/bin/bash
if [ "$1" == "rust" ]; then
cp ~/.dotfiles/templates/rust_flake.nix ./flake.nix
cp ~/.dotfiles/templates/toolchain.toml .
elif [ "$1" == "cpp" ]; then
cp ~/.dotfiles/templates/cpp_flake.nix ./flake.nix
elif [ "$1" == "python" ]; then
cp ~/.dotfiles/templates/py_flake.nix ./flake.nix
elif [ "$1" == "cuda" ]; then
cp ~/.dotfiles/templates/cu_flake.nix ./flake.nix
elif [ "$1" == "other" ]; then
cp ~/.dotfiles/templates/other_flake.nix ./flake.nix
elif [ "$1" == "latex" ]; then
if [ "$2" == "" ]; then
echo "No filename specified, usage: 'project latex <NAME>'"
exit 0
fi
cp ~/.dotfiles/templates/tex_standard.tex ./"$2".tex
exit 0
else
echo "No valid argument given. Valid arguments are rust cpp python, cuda"
exit 0
fi
echo "use flake" >> .envrc
direnv allow
'')
];
}

View file

@ -2,6 +2,7 @@
{ {
imports = [ imports = [
./packages.nix ./packages.nix
./custom-packages.nix
./sops.nix ./sops.nix
./ssh.nix ./ssh.nix
./stylix.nix ./stylix.nix

View file

@ -148,52 +148,5 @@
font-awesome_5 font-awesome_5
noto-fonts noto-fonts
noto-fonts-cjk-sans noto-fonts-cjk-sans
pass-fuzzel
cura5
cdw
cdb
bak
timer
e
swarselcheck
waybarupdate
opacitytoggle
fs-diff
update-checker
(pkgs.writeScriptBin "project" ''
#! ${pkgs.bash}/bin/bash
if [ "$1" == "rust" ]; then
cp ~/.dotfiles/templates/rust_flake.nix ./flake.nix
cp ~/.dotfiles/templates/toolchain.toml .
elif [ "$1" == "cpp" ]; then
cp ~/.dotfiles/templates/cpp_flake.nix ./flake.nix
elif [ "$1" == "python" ]; then
cp ~/.dotfiles/templates/py_flake.nix ./flake.nix
elif [ "$1" == "cuda" ]; then
cp ~/.dotfiles/templates/cu_flake.nix ./flake.nix
elif [ "$1" == "other" ]; then
cp ~/.dotfiles/templates/other_flake.nix ./flake.nix
elif [ "$1" == "latex" ]; then
if [ "$2" == "" ]; then
echo "No filename specified, usage: 'project latex <NAME>'"
exit 0
fi
cp ~/.dotfiles/templates/tex_standard.tex ./"$2".tex
exit 0
else
echo "No valid argument given. Valid arguments are rust cpp python, cuda"
exit 0
fi
echo "use flake" >> .envrc
direnv allow
'')
]; ];
} }

View file

@ -21,22 +21,22 @@ _:
folders = { folders = {
"Default Folder" = { "Default Folder" = {
path = "/home/swarsel/Sync"; path = "/home/swarsel/Sync";
devices = [ "sync (@oracle)" ]; devices = [ "sync (@oracle) magicant" ];
id = "default"; id = "default";
}; };
"Obsidian" = { "Obsidian" = {
path = "/home/swarsel/Nextcloud/Obsidian"; path = "/home/swarsel/Nextcloud/Obsidian";
devices = [ "sync (@oracle)" ]; devices = [ "sync (@oracle) magicant" ];
id = "yjvni-9eaa7"; id = "yjvni-9eaa7";
}; };
"Org" = { "Org" = {
path = "/home/swarsel/Nextcloud/Org"; path = "/home/swarsel/Nextcloud/Org";
devices = [ "sync (@oracle)" ]; devices = [ "sync (@oracle) magicant" ];
id = "a7xnl-zjj3d"; id = "a7xnl-zjj3d";
}; };
"Vpn" = { "Vpn" = {
path = "/home/swarsel/Vpn"; path = "/home/swarsel/Vpn";
devices = [ "sync (@oracle)" ]; devices = [ "sync (@oracle) magicant" ];
id = "hgp9s-fyq3p"; id = "hgp9s-fyq3p";
}; };
}; };

View file

@ -18,9 +18,9 @@
}; };
programs.zsh.initExtra = " programs.zsh.initExtra = "
export GPG_TTY=\"$(tty)\" export GPG_TTY=\"$(tty)\"
export SSH_AUTH_SOCK=$(gpgconf --list-dirs agent-ssh-socket) export SSH_AUTH_SOCK=$(gpgconf --list-dirs agent-ssh-socket)
gpgconf --launch gpg-agent gpgconf --launch gpg-agent
"; ";
swarselsystems = { swarselsystems = {

View file

@ -3,45 +3,7 @@ let
matrixDomain = "matrix2.swarsel.win"; matrixDomain = "matrix2.swarsel.win";
in in
{ {
<< vminitbare>>
services = {
xserver.xkb = {
layout = "us";
variant = "altgr-intl";
};
openssh = {
enable = true;
settings.PermitRootLogin = "yes";
listenAddresses = [{
port = 22;
addr = "0.0.0.0";
}];
};
};
nix.settings.experimental-features = [ "nix-command" "flakes" ];
proxmoxLXC = {
manageNetwork = true; # manage network myself
manageHostName = false; # manage hostname myself
};
networking = {
useDHCP = true;
enableIPv6 = false;
};
users.users.root.openssh.authorizedKeys.keyFiles = [
../../../secrets/keys/authorized_keys
];
system.stateVersion = "23.05"; # TEMPLATE - but probably no need to change
environment.shellAliases = {
nswitch = "cd /.dotfiles; git pull; nixos-rebuild --flake .#$(hostname) switch; cd -;";
};
imports = [ imports = [
(modulesPath + "/virtualisation/proxmox-lxc.nix") (modulesPath + "/virtualisation/proxmox-lxc.nix")