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, ... }:
{ {
@ -4132,7 +4128,6 @@ 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;
@ -4217,7 +4212,6 @@ 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 }:
@ -4253,7 +4247,6 @@ 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 {
@ -4271,7 +4264,6 @@ 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 {
@ -4288,7 +4280,6 @@ 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 {
@ -4305,7 +4296,6 @@ 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 {
@ -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: {
@ -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"
@ -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";
}; };
}; };
@ -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)
@ -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
@ -6225,7 +6217,6 @@ 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 = {
@ -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
@ -6890,7 +6886,6 @@ 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,7 +6945,6 @@ 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 = {
@ -6978,7 +6972,6 @@ 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;
@ -7410,7 +7403,6 @@ 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 = {
@ -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 = {
@ -7976,7 +7967,6 @@ 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) {
@ -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,7 +8400,6 @@ 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, ... }:
{ {

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

@ -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")