chore: code cleanup

This commit is contained in:
Swarsel 2024-07-20 00:10:56 +02:00
parent e66e4978ff
commit 23cfb96adb
Signed by: swarsel
GPG key ID: 26A54C31F2A4FD84
8 changed files with 3701 additions and 3681 deletions

View file

@ -162,8 +162,6 @@ For styling, I am using the [[https://github.com/danth/stylix][stylix]] NixOS mo
}; };
}; };
#+end_src #+end_src
*** Waybar items - LAPTOPS *** Waybar items - LAPTOPS
:PROPERTIES: :PROPERTIES:
@ -176,7 +174,8 @@ The most part of this configuration is done here: [[#h:0bf51f63-01c0-4053-a591-7
#+begin_src nix :tangle no :noweb-ref waybarlaptop #+begin_src nix :tangle no :noweb-ref waybarlaptop
programs.waybar.settings.mainBar.modules-right = ["custom/outer-left-arrow-dark" programs.waybar.settings.mainBar.modules-right = [
"custom/outer-left-arrow-dark"
"mpris" "mpris"
"custom/left-arrow-light" "custom/left-arrow-light"
"network" "network"
@ -209,7 +208,8 @@ The most part of this configuration is done here: [[#h:0bf51f63-01c0-4053-a591-7
format = ""; format = "";
on-click-right = "wlogout -p layer-shell"; on-click-right = "wlogout -p layer-shell";
}; };
programs.waybar.settings.mainBar.modules-right = ["custom/outer-left-arrow-dark" programs.waybar.settings.mainBar.modules-right = [
"custom/outer-left-arrow-dark"
"mpris" "mpris"
"custom/left-arrow-light" "custom/left-arrow-light"
"network" "network"
@ -402,6 +402,7 @@ Mind the comma at the end. You need this because the =...= is being passed as th
lanzaboote, lanzaboote,
nixos-hardware, nixos-hardware,
nix-alien, nix-alien,
nixos-generators,
nswitch-rcm-nix, nswitch-rcm-nix,
nix-index-database, nix-index-database,
@ -410,7 +411,7 @@ Mind the comma at the end. You need this because the =...= is being passed as th
Here, just add the input names, urls and other options that are needed, like =nixpkgs.follows=. By using the latter option, you tell the package to not provide it's own package repository, but instead 'nest' itself into another, which is very useful. Here, just add the input names, urls and other options that are needed, like =nixpkgs.follows=. By using the latter option, you tell the package to not provide it's own package repository, but instead 'nest' itself into another, which is very useful.
A short overview over each input and what it does: A short overview over each input and what it does:
- nixkpkgs - [[https://github.com/NixOS/nixpkgs][nixpkgs]]
This is the base repository that I am following for all packages. I follow the unstable branch. This is the base repository that I am following for all packages. I follow the unstable branch.
- [[https://github.com/nix-community/home-manager][home-manager]] - [[https://github.com/nix-community/home-manager][home-manager]]
This handles user-level configuration and mostly provides dotfiles that are generated and symlinked to =~/.config/=. This handles user-level configuration and mostly provides dotfiles that are generated and symlinked to =~/.config/=.
@ -430,6 +431,8 @@ A short overview over each input and what it does:
Provides specific hardware setting for some hardware configurations. For example, this sets some better defaults for my Lenovo Thinkpad P14s Gen2. Provides specific hardware setting for some hardware configurations. For example, this sets some better defaults for my Lenovo Thinkpad P14s Gen2.
- [[https://github.com/thiagokokada/nix-alien][nix-alien]] - [[https://github.com/thiagokokada/nix-alien][nix-alien]]
This is supposed to allow me to run unpatched libraries directly without a need for ELF patching or resorting to =steam-run=. However, I have not yet gotten this to work. This is supposed to allow me to run unpatched libraries directly without a need for ELF patching or resorting to =steam-run=. However, I have not yet gotten this to work.
- [[https://github.com/nix-community/nixos-generators][nixos-generators]]
Provides me with images that I can use to create LXCs on Proxmox.
- [[https://github.com/Swarsel/nswitch-rcm-nix][nswitch-rcm-nix]] - [[https://github.com/Swarsel/nswitch-rcm-nix][nswitch-rcm-nix]]
Allows auto injection of payloads upon connecting a Nintendo Switch. Allows auto injection of payloads upon connecting a Nintendo Switch.
- [[https://github.com/nix-community/nix-index-database][nix-index-database]] - [[https://github.com/nix-community/nix-index-database][nix-index-database]]
@ -483,11 +486,6 @@ A short overview over each input and what it does:
inputs.nixpkgs.follows = "nixpkgs"; inputs.nixpkgs.follows = "nixpkgs";
}; };
# patches for gaming on nix
nix-gaming = {
url = "github:fufexan/nix-gaming";
};
# hardware quirks on nix # hardware quirks on nix
nixos-hardware = { nixos-hardware = {
url = "github:NixOS/nixos-hardware/master"; url = "github:NixOS/nixos-hardware/master";
@ -522,8 +520,10 @@ Lastly I define some common module lists that I can simply load depending on the
#+begin_src nix :tangle no :noweb-ref flakelet #+begin_src nix :tangle no :noweb-ref flakelet
system = "x86_64-linux"; # not very portable, but I do not use other architectures at the moment system = "x86_64-linux"; # not very portable, but I do not use other architectures at the moment
pkgs = import nixpkgs { inherit system; pkgs = import nixpkgs {
overlays = [ emacs-overlay.overlay inherit system;
overlays = [
emacs-overlay.overlay
nur.overlay nur.overlay
nixgl.overlay nixgl.overlay
(final: _prev: { (final: _prev: {
@ -536,7 +536,8 @@ Lastly I define some common module lists that I can simply load depending on the
}; };
# NixOS modules that can only be used on NixOS systems # NixOS modules that can only be used on NixOS systems
nixModules = [ stylix.nixosModules.stylix nixModules = [
stylix.nixosModules.stylix
sops-nix.nixosModules.sops sops-nix.nixosModules.sops
nswitch-rcm-nix.nixosModules.nswitch-rcm nswitch-rcm-nix.nixosModules.nswitch-rcm
./profiles/common/nixos.nix ./profiles/common/nixos.nix
@ -551,10 +552,12 @@ Lastly I define some common module lists that I can simply load depending on the
]; ];
# Home-Manager modules wanted on non-NixOS systems # Home-Manager modules wanted on non-NixOS systems
homeModules = [ stylix.homeManagerModules.stylix homeModules = [
stylix.homeManagerModules.stylix
]; ];
# Home-Manager modules wanted on both NixOS and non-NixOS systems # Home-Manager modules wanted on both NixOS and non-NixOS systems
mixedModules = [ sops-nix.homeManagerModules.sops mixedModules = [
sops-nix.homeManagerModules.sops
nix-index-database.hmModules.nix-index nix-index-database.hmModules.nix-index
./profiles/common/home.nix ./profiles/common/home.nix
]; ];
@ -572,7 +575,7 @@ This section is the biggest pain point of the configuration. For every system, I
onett = nixpkgs.lib.nixosSystem { onett = nixpkgs.lib.nixosSystem {
specialArgs = { inherit inputs pkgs; }; specialArgs = { inherit inputs pkgs; };
modules = nixModules ++ [ modules = nixModules ++ [
./profiles/onett/nixos.nix ./profles/onett/nixos.nix
home-manager.nixosModules.home-manager home-manager.nixosModules.home-manager
{ {
home-manager.users.swarsel.imports = mixedModules ++ [ home-manager.users.swarsel.imports = mixedModules ++ [
@ -794,7 +797,7 @@ nix build ~/.dotfiles/#proxmox-lxc
The resulting image can then be loaded in Proxmox. The resulting image can then be loaded in Proxmox.
#+begin_src nix :nowe:tangle no b-ref flakenixosgenerators #+begin_src nix :tangle no :noweb-ref flakenixosgenerators
proxmox-lxc = nixos-generators.nixosGenerate { proxmox-lxc = nixos-generators.nixosGenerate {
inherit system; inherit system;
@ -837,7 +840,6 @@ No matter what you do, check the initial /etc/nixos/configuration.nix for notabl
:END: :END:
#+begin_src nix :noweb yes :tangle profiles/TEMPLATE/nixos.nix #+begin_src nix :noweb yes :tangle profiles/TEMPLATE/nixos.nix
{ pkgs, ... }: { pkgs, ... }:
{ {
@ -901,7 +903,6 @@ No matter what you do, check the initial /etc/nixos/configuration.nix for notabl
:CUSTOM_ID: h:a08e51ee-88eb-4241-917d-68b4bdbcf171 :CUSTOM_ID: h:a08e51ee-88eb-4241-917d-68b4bdbcf171
:END: :END:
#+begin_src nix :noweb yes :tangle profiles/TEMPLATE/home.nix #+begin_src nix :noweb yes :tangle profiles/TEMPLATE/home.nix
{ config, pkgs, ... }: { config, pkgs, ... }:
{ {
@ -947,7 +948,8 @@ No matter what you do, check the initial /etc/nixos/configuration.nix for notabl
xkb_layout = "us"; xkb_layout = "us";
xkb_variant = "altgr-intl"; xkb_variant = "altgr-intl";
}; };
"1:1:AT_Translated_Set_2_keyboard" = { # TEMPLATE "1:1:AT_Translated_Set_2_keyboard" = {
# TEMPLATE
xkb_layout = "us"; xkb_layout = "us";
xkb_options = "grp:win_space_toggle"; xkb_options = "grp:win_space_toggle";
# xkb_options = "ctrl:nocaps,grp:win_space_toggle"; # xkb_options = "ctrl:nocaps,grp:win_space_toggle";
@ -970,9 +972,11 @@ No matter what you do, check the initial /etc/nixos/configuration.nix for notabl
}; };
}; };
keybindings = let keybindings =
let
inherit (config.wayland.windowManager.sway.config) modifier; inherit (config.wayland.windowManager.sway.config) modifier;
in { in
{
# TEMPLATE # TEMPLATE
"${modifier}+w" = "exec \"bash ~/.dotfiles/scripts/checkschildi.sh\""; "${modifier}+w" = "exec \"bash ~/.dotfiles/scripts/checkschildi.sh\"";
# "${modifier}+w" = "exec \"bash ~/.dotfiles/scripts/checkelement.sh\""; # "${modifier}+w" = "exec \"bash ~/.dotfiles/scripts/checkelement.sh\"";
@ -1004,10 +1008,11 @@ My old laptop, replaced by a new one, since most basic functions have stopped to
:END: :END:
#+begin_src nix :noweb yes :tangle profiles/sandbox/nixos.nix #+begin_src nix :noweb yes :tangle profiles/sandbox/nixos.nix
{ config, pkgs, sops, ... }:
{ config, pkgs, sops, ... }: let let
matrixDomain = "swatrix.swarsel.win"; matrixDomain = "swatrix.swarsel.win";
in { in
{
imports = [ imports = [
./hardware-configuration.nix ./hardware-configuration.nix
@ -1112,10 +1117,12 @@ My old laptop, replaced by a new one, since most basic functions have stopped to
fileSystems."/mnt/Eternor" = { fileSystems."/mnt/Eternor" = {
device = "//192.168.1.3/Eternor"; device = "//192.168.1.3/Eternor";
fsType = "cifs"; fsType = "cifs";
options = let options =
let
# this line prevents hanging on network split # this line prevents hanging on network split
automount_opts = "x-systemd.automount,noauto,x-systemd.idle-timeout=60,x-systemd.device-timeout=5s,x-systemd.mount-timeout=5s"; automount_opts = "x-systemd.automount,noauto,x-systemd.idle-timeout=60,x-systemd.device-timeout=5s,x-systemd.mount-timeout=5s";
in ["${automount_opts},credentials=/etc/nixos/smb-secrets,uid=1000,gid=100"]; in
[ "${automount_opts},credentials=/etc/nixos/smb-secrets,uid=1000,gid=100" ];
}; };
environment = { environment = {
@ -1141,23 +1148,28 @@ My old laptop, replaced by a new one, since most basic functions have stopped to
]; ];
etc = { etc = {
"openvpn/iptables.sh" = "openvpn/iptables.sh" =
{ source = ../../scripts/server1/iptables.sh; {
source = ../../scripts/server1/iptables.sh;
mode = "0755"; mode = "0755";
}; };
"openvpn/update-resolv-conf" = "openvpn/update-resolv-conf" =
{ source = ../../scripts/server1/update-resolv-conf; {
source = ../../scripts/server1/update-resolv-conf;
mode = "0755"; mode = "0755";
}; };
"openvpn/routing.sh" = "openvpn/routing.sh" =
{ source = ../../scripts/server1/routing.sh; {
source = ../../scripts/server1/routing.sh;
mode = "0755"; mode = "0755";
}; };
"openvpn/ca.rsa.2048.crt" = "openvpn/ca.rsa.2048.crt" =
{ source = ../../secrets/certs/ca.rsa.2048.crt; {
source = ../../secrets/certs/ca.rsa.2048.crt;
mode = "0644"; mode = "0644";
}; };
"openvpn/crl.rsa.2048.pem" = "openvpn/crl.rsa.2048.pem" =
{ source = ../../secrets/certs/crl.rsa.2048.pem; {
source = ../../secrets/certs/crl.rsa.2048.pem;
mode = "0644"; mode = "0644";
}; };
}; };
@ -1564,7 +1576,8 @@ My old laptop, replaced by a new one, since most basic functions have stopped to
config.sops.templates.matrixshared.path config.sops.templates.matrixshared.path
]; ];
settings.listeners = [ settings.listeners = [
{ port = 8008; {
port = 8008;
bind_addresses = [ "0.0.0.0" ]; bind_addresses = [ "0.0.0.0" ];
type = "http"; type = "http";
tls = false; tls = false;
@ -1827,7 +1840,6 @@ New setup for the SP3, this time using NixOS - another machine will take over th
:END: :END:
#+begin_src nix :noweb yes :tangle profiles/threed/nixos.nix #+begin_src nix :noweb yes :tangle profiles/threed/nixos.nix
{ lib, pkgs, ... }: { lib, pkgs, ... }:
{ {
@ -1883,7 +1895,6 @@ New setup for the SP3, this time using NixOS - another machine will take over th
:CUSTOM_ID: h:449c20d8-338a-483c-a6f0-9a164a6071d6 :CUSTOM_ID: h:449c20d8-338a-483c-a6f0-9a164a6071d6
:END: :END:
#+begin_src nix :noweb yes :tangle profiles/threed/home.nix #+begin_src nix :noweb yes :tangle profiles/threed/home.nix
{ config, pkgs, ... }: { config, pkgs, ... }:
{ {
@ -1931,9 +1942,11 @@ New setup for the SP3, this time using NixOS - another machine will take over th
}; };
}; };
keybindings = let keybindings =
let
inherit (config.wayland.windowManager.sway.config) modifier; inherit (config.wayland.windowManager.sway.config) modifier;
in { in
{
"${modifier}+F2" = "exec brightnessctl set +5%"; "${modifier}+F2" = "exec brightnessctl set +5%";
"${modifier}+F1" = "exec brightnessctl set 5%-"; "${modifier}+F1" = "exec brightnessctl set 5%-";
"${modifier}+n" = "exec sway output eDP-1 transform normal, splith"; "${modifier}+n" = "exec sway output eDP-1 transform normal, splith";
@ -1976,7 +1989,6 @@ My new main machine.
Mostly just sets some opened ports for several games, enables virtualbox (which I do not want everywhere because of resource considerations) and enables thinkfan, which allows for better fan control on Lenovo Thinkpad machines. Mostly just sets some opened ports for several games, enables virtualbox (which I do not want everywhere because of resource considerations) and enables thinkfan, which allows for better fan control on Lenovo Thinkpad machines.
#+begin_src nix :noweb yes :tangle profiles/fourside/nixos.nix #+begin_src nix :noweb yes :tangle profiles/fourside/nixos.nix
{ config, pkgs, ... }: { config, pkgs, ... }:
{ {
@ -2108,7 +2120,6 @@ Mostly just sets some opened ports for several games, enables virtualbox (which
This is basically just adjusted to the core count, path to the =hwmon= (this was very bothersome on this machine due to changing address), as well as making use of the top-row function keys. This is basically just adjusted to the core count, path to the =hwmon= (this was very bothersome on this machine due to changing address), as well as making use of the top-row function keys.
#+begin_src nix :noweb yes :tangle profiles/fourside/home.nix #+begin_src nix :noweb yes :tangle profiles/fourside/home.nix
{ config, pkgs, ... }: { config, pkgs, ... }:
{ {
@ -2142,7 +2153,8 @@ This is basically just adjusted to the core count, path to the =hwmon= (this was
xkb_layout = "us"; xkb_layout = "us";
xkb_variant = "altgr-intl"; xkb_variant = "altgr-intl";
}; };
"1:1:AT_Translated_Set_2_keyboard" = { # TEMPLATE "1:1:AT_Translated_Set_2_keyboard" = {
# TEMPLATE
xkb_layout = "us"; xkb_layout = "us";
xkb_options = "grp:win_space_toggle"; xkb_options = "grp:win_space_toggle";
xkb_variant = "altgr-intl"; xkb_variant = "altgr-intl";
@ -2177,9 +2189,11 @@ This is basically just adjusted to the core count, path to the =hwmon= (this was
]; ];
keybindings = let keybindings =
let
inherit (config.wayland.windowManager.sway.config) modifier; inherit (config.wayland.windowManager.sway.config) modifier;
in { in
{
"${modifier}+w" = "exec \"bash ~/.dotfiles/scripts/checkelement.sh\""; "${modifier}+w" = "exec \"bash ~/.dotfiles/scripts/checkelement.sh\"";
"XF86MonBrightnessUp" = "exec brightnessctl set +5%"; "XF86MonBrightnessUp" = "exec brightnessctl set +5%";
"XF86MonBrightnessDown" = "exec brightnessctl set 5%-"; "XF86MonBrightnessDown" = "exec brightnessctl set 5%-";
@ -2219,7 +2233,6 @@ My work machine.
Mostly just sets some opened ports for several games, enables virtualbox (which I do not want everywhere because of resource considerations) and enables thinkfan, which allows for better fan control on Lenovo Thinkpad machines. Mostly just sets some opened ports for several games, enables virtualbox (which I do not want everywhere because of resource considerations) and enables thinkfan, which allows for better fan control on Lenovo Thinkpad machines.
#+begin_src nix :noweb yes :tangle profiles/winters/nixos.nix #+begin_src nix :noweb yes :tangle profiles/winters/nixos.nix
{ pkgs, ... }: { pkgs, ... }:
{ {
@ -2323,7 +2336,6 @@ Mostly just sets some opened ports for several games, enables virtualbox (which
TODO: Adjust =hwmon= path, I/O modules and XF86 keys once laptop arrives. TODO: Adjust =hwmon= path, I/O modules and XF86 keys once laptop arrives.
#+begin_src nix :noweb yes :tangle profiles/winters/home.nix #+begin_src nix :noweb yes :tangle profiles/winters/home.nix
{ config, pkgs, ... }: { config, pkgs, ... }:
{ {
@ -2357,7 +2369,8 @@ TODO: Adjust =hwmon= path, I/O modules and XF86 keys once laptop arrives.
xkb_layout = "us"; xkb_layout = "us";
xkb_variant = "altgr-intl"; xkb_variant = "altgr-intl";
}; };
"1:1:AT_Translated_Set_2_keyboard" = { # TEMPLATE "1:1:AT_Translated_Set_2_keyboard" = {
# TEMPLATE
xkb_layout = "us"; xkb_layout = "us";
xkb_options = "grp:win_space_toggle"; xkb_options = "grp:win_space_toggle";
xkb_variant = "altgr-intl"; xkb_variant = "altgr-intl";
@ -2427,7 +2440,6 @@ 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, ... }:
{ {
@ -2482,7 +2494,6 @@ firewall.enable = false;
:END: :END:
#+begin_src nix :tangle profiles/server1/nginx/nixos.nix #+begin_src nix :tangle profiles/server1/nginx/nixos.nix
{ config, pkgs, modulesPath, ... }: { config, pkgs, modulesPath, ... }:
{ {
imports = [ imports = [
@ -2717,7 +2728,6 @@ In general, I am not amazed by this setup; Kavita is the reader of choice, calib
:END: :END:
#+begin_src nix :tangle profiles/server1/calibre/nixos.nix #+begin_src nix :tangle profiles/server1/calibre/nixos.nix
{ config, pkgs, modulesPath, ... }: { config, pkgs, modulesPath, ... }:
{ {
@ -2801,7 +2811,6 @@ firewall.enable = false;
:END: :END:
#+begin_src nix :tangle profiles/server1/jellyfin/nixos.nix #+begin_src nix :tangle profiles/server1/jellyfin/nixos.nix
{ config, pkgs, modulesPath, ... }: { config, pkgs, modulesPath, ... }:
{ {
@ -2895,7 +2904,6 @@ This stuff just does not work, I seem to be unable to create a working VPN Split
:END: :END:
#+begin_src nix :tangle profiles/server1/transmission/nixos.nix #+begin_src nix :tangle profiles/server1/transmission/nixos.nix
{ config, pkgs, modulesPath, ... }: { config, pkgs, modulesPath, ... }:
{ {
@ -2986,23 +2994,28 @@ This stuff just does not work, I seem to be unable to create a working VPN Split
}; };
environment.etc = { environment.etc = {
"openvpn/iptables.sh" = "openvpn/iptables.sh" =
{ source = ../../../scripts/server1/iptables.sh; {
source = ../../../scripts/server1/iptables.sh;
mode = "0755"; mode = "0755";
}; };
"openvpn/update-resolv-conf" = "openvpn/update-resolv-conf" =
{ source = ../../../scripts/server1/update-resolv-conf; {
source = ../../../scripts/server1/update-resolv-conf;
mode = "0755"; mode = "0755";
}; };
"openvpn/routing.sh" = "openvpn/routing.sh" =
{ source = ../../../scripts/server1/routing.sh; {
source = ../../../scripts/server1/routing.sh;
mode = "0755"; mode = "0755";
}; };
"openvpn/ca.rsa.2048.crt" = "openvpn/ca.rsa.2048.crt" =
{ source = ../../../secrets/certs/ca.rsa.2048.crt; {
source = ../../../secrets/certs/ca.rsa.2048.crt;
mode = "0644"; mode = "0644";
}; };
"openvpn/crl.rsa.2048.pem" = "openvpn/crl.rsa.2048.pem" =
{ source = ../../../secrets/certs/crl.rsa.2048.pem; {
source = ../../../secrets/certs/crl.rsa.2048.pem;
mode = "0644"; mode = "0644";
}; };
}; };
@ -3189,10 +3202,11 @@ Make sure to also do this for doublepuppet.yaml
:END: :END:
#+begin_src nix :noweb yes :tangle profiles/server1/matrix/nixos.nix #+begin_src nix :noweb yes :tangle profiles/server1/matrix/nixos.nix
{ config, pkgs, modulesPath, sops, ... }:
{ config, pkgs, modulesPath, sops, ... }: let let
matrixDomain = "matrix2.swarsel.win"; matrixDomain = "matrix2.swarsel.win";
in { in
{
<<vminitbare>> <<vminitbare>>
imports = [ imports = [
@ -3286,7 +3300,8 @@ Make sure to also do this for doublepuppet.yaml
server_name = matrixDomain; server_name = matrixDomain;
public_baseurl = "https://${matrixDomain}"; public_baseurl = "https://${matrixDomain}";
listeners = [ listeners = [
{ port = 8008; {
port = 8008;
bind_addresses = [ "0.0.0.0" ]; bind_addresses = [ "0.0.0.0" ];
type = "http"; type = "http";
tls = false; tls = false;
@ -3470,7 +3485,6 @@ Make sure to also do this for doublepuppet.yaml
:END: :END:
#+begin_src nix :noweb yes :tangle profiles/server1/sound/nixos.nix #+begin_src nix :noweb yes :tangle profiles/server1/sound/nixos.nix
{ config, pkgs, modulesPath, ... }: { config, pkgs, modulesPath, ... }:
{ {
@ -3590,7 +3604,6 @@ Make sure to also do this for doublepuppet.yaml
:END: :END:
#+begin_src nix :noweb yes :tangle profiles/server1/spotifyd/nixos.nix #+begin_src nix :noweb yes :tangle profiles/server1/spotifyd/nixos.nix
{ pkgs, modulesPath, ... }: { pkgs, modulesPath, ... }:
{ {
@ -3652,7 +3665,6 @@ Make sure to also do this for doublepuppet.yaml
:END: :END:
#+begin_src nix :tangle profiles/remote/oracle/sync/nixos.nix #+begin_src nix :tangle profiles/remote/oracle/sync/nixos.nix
{ config, pkgs, ... }: { config, pkgs, ... }:
{ {
@ -3873,10 +3885,11 @@ namespaces:
Lastly, the machine that runs matrix needs to regularly update, as otherwise you will lose connectivity to the bridges. Lastly, the machine that runs matrix needs to regularly update, as otherwise you will lose connectivity to the bridges.
#+begin_src nix :tangle profiles/remote/oracle/matrix/nixos.nix #+begin_src nix :tangle profiles/remote/oracle/matrix/nixos.nix
{ config, pkgs, sops, ... }:
{ config, pkgs, sops, ... }: let let
matrixDomain = "swatrix.swarsel.win"; matrixDomain = "swatrix.swarsel.win";
in { in
{
imports = [ imports = [
./hardware-configuration.nix ./hardware-configuration.nix
@ -4040,7 +4053,8 @@ Lastly, the machine that runs matrix needs to regularly update, as otherwise you
public_baseurl = "https://${matrixDomain}"; public_baseurl = "https://${matrixDomain}";
}; };
listeners = [ listeners = [
{ port = 8008; {
port = 8008;
bind_addresses = [ "0.0.0.0" ]; bind_addresses = [ "0.0.0.0" ];
type = "http"; type = "http";
tls = false; tls = false;
@ -4224,7 +4238,6 @@ Lastly, the machine that runs matrix needs to regularly update, as otherwise you
:END: :END:
#+begin_src nix :noweb yes :tangle profiles/server1/paperless/nixos.nix #+begin_src nix :noweb yes :tangle profiles/server1/paperless/nixos.nix
{ config, pkgs, modulesPath, ... }: { config, pkgs, modulesPath, ... }:
{ {
@ -4316,6 +4329,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.nix #+begin_src nix :tangle profiles/common/nixos.nix
services.xserver = { services.xserver = {
xkb = { xkb = {
layout = "us"; layout = "us";
@ -4789,6 +4803,7 @@ I use sops-nix to handle secrets that I want to have available on my machines at
''; '';
}; };
}; };
#+end_src #+end_src
*** System Packages *** System Packages
@ -4905,6 +4920,7 @@ Also, we setup zsh. Do not touch this.
users.defaultUserShell = pkgs.zsh; users.defaultUserShell = pkgs.zsh;
environment.shells = with pkgs; [ zsh ]; environment.shells = with pkgs; [ zsh ];
environment.pathsToLink = [ "/share/zsh" ]; environment.pathsToLink = [ "/share/zsh" ];
#+end_src #+end_src
*** Services *** Services
@ -4968,6 +4984,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 is the service used for the network discovery Avahi is the service used for the network discovery
@ -4979,6 +4996,7 @@ Avahi is the service used for the network discovery
nssmdns4 = true; nssmdns4 = true;
openFirewall = true; openFirewall = true;
}; };
#+end_src #+end_src
**** enable GVfs **** enable GVfs
@ -5006,7 +5024,8 @@ This is a super-convenient package that lets my remap my =CAPS= key to =ESC= if
# 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;
udevmonConfig = let udevmonConfig =
let
dualFunctionKeysConfig = builtins.toFile "dual-function-keys.yaml" '' dualFunctionKeysConfig = builtins.toFile "dual-function-keys.yaml" ''
TIMING: TIMING:
TAP_MILLISEC: 200 TAP_MILLISEC: 200
@ -5017,7 +5036,8 @@ This is a super-convenient package that lets my remap my =CAPS= key to =ESC= if
TAP: KEY_ESC TAP: KEY_ESC
HOLD: KEY_LEFTCTRL HOLD: KEY_LEFTCTRL
''; '';
in '' in
''
- JOB: | - JOB: |
${pkgs.interception-tools}/bin/intercept -g $DEVNODE \ ${pkgs.interception-tools}/bin/intercept -g $DEVNODE \
| ${pkgs.interception-tools-plugins.dual-function-keys}/bin/dual-function-keys -c ${dualFunctionKeysConfig} \ | ${pkgs.interception-tools-plugins.dual-function-keys}/bin/dual-function-keys -c ${dualFunctionKeysConfig} \
@ -5114,7 +5134,6 @@ Programming languages and default lsp's are defined here: [[#h:0e7e8bea-ec58-499
:END: :END:
#+begin_src nix :tangle profiles/common/home.nix #+begin_src nix :tangle profiles/common/home.nix
{ config, pkgs, fetchFromGitHub, ... }: { config, pkgs, fetchFromGitHub, ... }:
{ {
@ -5144,6 +5163,7 @@ Programming languages and default lsp's are defined here: [[#h:0e7e8bea-ec58-499
# nix # nix
alejandra alejandra
nixpkgs-fmt
deadnix deadnix
statix statix
@ -5284,9 +5304,10 @@ Programming languages and default lsp's are defined here: [[#h:0e7e8bea-ec58-499
:END: :END:
#+begin_src nix :tangle profiles/common/home.nix #+begin_src nix :tangle profiles/common/home.nix
# cura # cura
(let cura5 = appimageTools.wrapType2 rec { (
let
cura5 = appimageTools.wrapType2 rec {
name = "cura5"; name = "cura5";
version = "5.4.0"; version = "5.4.0";
src = fetchurl { src = fetchurl {
@ -5294,7 +5315,9 @@ Programming languages and default lsp's are defined here: [[#h:0e7e8bea-ec58-499
hash = "sha256-QVv7Wkfo082PH6n6rpsB79st2xK2+Np9ivBg/PYZd74="; hash = "sha256-QVv7Wkfo082PH6n6rpsB79st2xK2+Np9ivBg/PYZd74=";
}; };
extraPkgs = pkgs: with pkgs; [ ]; extraPkgs = pkgs: with pkgs; [ ];
}; in writeScriptBin "cura" '' };
in
writeScriptBin "cura" ''
#! ${pkgs.bash}/bin/bash #! ${pkgs.bash}/bin/bash
# AppImage version of Cura loses current working directory and treats all paths relateive to $HOME. # AppImage version of Cura loses current working directory and treats all paths relateive to $HOME.
# So we convert each of the files passed as argument to an absolute path. # So we convert each of the files passed as argument to an absolute path.
@ -5307,7 +5330,8 @@ Programming languages and default lsp's are defined here: [[#h:0e7e8bea-ec58-499
args+=("$a") args+=("$a")
done done
exec "${cura5}/bin/cura5" "''${args[@]}" exec "${cura5}/bin/cura5" "''${args[@]}"
'') ''
)
#E: hides scratchpad depending on state, calls emacsclient for edit and then restores the scratchpad state #E: hides scratchpad depending on state, calls emacsclient for edit and then restores the scratchpad state
(pkgs.writeShellScriptBin "e" '' (pkgs.writeShellScriptBin "e" ''
@ -5461,6 +5485,7 @@ I use sops-nix to handle secrets that I want to have available on my machines at
caldav = { path = "${config.home.homeDirectory}/.emacs.d/.caldav"; }; caldav = { path = "${config.home.homeDirectory}/.emacs.d/.caldav"; };
}; };
}; };
#+end_src #+end_src
*** SSH Machines *** SSH Machines
@ -5730,6 +5755,7 @@ This section is for programs that require no further configuration. zsh Integrat
pandoc.enable = true; pandoc.enable = true;
fzf.enable = true; fzf.enable = true;
zoxide.enable = true; zoxide.enable = true;
};
#+end_src #+end_src
*** nix-index *** nix-index
@ -5738,7 +5764,8 @@ nix-index provides a way to find out which packages are provided by which deriva
#+begin_src nix :tangle profiles/common/home.nix #+begin_src nix :tangle profiles/common/home.nix
nix-index = let programs.nix-index =
let
command-not-found = pkgs.runCommandLocal "command-not-found.sh" { } '' command-not-found = pkgs.runCommandLocal "command-not-found.sh" { } ''
mkdir -p $out/etc/profile.d mkdir -p $out/etc/profile.d
substitute ${../../scripts/command-not-found.sh} \ substitute ${../../scripts/command-not-found.sh} \
@ -5746,14 +5773,15 @@ nix-index provides a way to find out which packages are provided by which deriva
--replace @nix-locate@ ${pkgs.nix-index}/bin/nix-locate \ --replace @nix-locate@ ${pkgs.nix-index}/bin/nix-locate \
--replace @tput@ ${pkgs.ncurses}/bin/tput --replace @tput@ ${pkgs.ncurses}/bin/tput
''; '';
in { in
{
enable = true; enable = true;
package = pkgs.symlinkJoin { package = pkgs.symlinkJoin {
name = "nix-index"; name = "nix-index";
paths = [ command-not-found ]; paths = [ command-not-found ];
}; };
}; };
};
#+end_src #+end_src
*** password-store *** password-store
@ -6578,7 +6606,8 @@ I used to build the firefox addon =bypass-paywalls-clean= myself here, but the m
}; };
"Home Manager Options" = { "Home Manager Options" = {
urls = [{ template = "https://home-manager-options.extranix.com/"; urls = [{
template = "https://home-manager-options.extranix.com/";
params = [ params = [
{ name = "query"; value = "{searchTerms}"; } { name = "query"; value = "{searchTerms}"; }
]; ];
@ -6749,9 +6778,11 @@ Currently, I am too lazy to explain every option here, but most of it is very se
terminal = "kitty"; terminal = "kitty";
menu = "fuzzel"; menu = "fuzzel";
bars = [{ command = "waybar"; }]; bars = [{ command = "waybar"; }];
keybindings = let keybindings =
let
inherit (config.wayland.windowManager.sway.config) modifier; inherit (config.wayland.windowManager.sway.config) modifier;
in { in
{
"${modifier}+q" = "kill"; "${modifier}+q" = "kill";
"${modifier}+f" = "exec firefox"; "${modifier}+f" = "exec firefox";
"${modifier}+Space" = "exec fuzzel"; "${modifier}+Space" = "exec fuzzel";
@ -6961,7 +6992,8 @@ Currently, I am too lazy to explain every option here, but most of it is very se
# exec systemctl --user import-environment DISPLAY WAYLAND_DISPLAY SWAYSOCK # exec systemctl --user import-environment DISPLAY WAYLAND_DISPLAY SWAYSOCK
# exec hash dbus-update-activation-environment 2>/dev/null && dbus-update-activation-environment --systemd DISPLAY WAYLAND_DISPLAY SWAYSOCK # exec hash dbus-update-activation-environment 2>/dev/null && dbus-update-activation-environment --systemd DISPLAY WAYLAND_DISPLAY SWAYSOCK
# "; # ";
extraConfig =let extraConfig =
let
inherit (config.wayland.windowManager.sway.config) modifier; inherit (config.wayland.windowManager.sway.config) modifier;
swayfxSettings = " swayfxSettings = "
blur enable blur enable
@ -6973,7 +7005,8 @@ Currently, I am too lazy to explain every option here, but most of it is very se
titlebar_separator disable titlebar_separator disable
default_dim_inactive 0.02 default_dim_inactive 0.02
"; ";
in " in
"
exec_always autotiling exec_always autotiling
set $exit \"exit: [s]leep, [p]oweroff, [r]eboot, [l]ogout\" set $exit \"exit: [s]leep, [p]oweroff, [r]eboot, [l]ogout\"
mode $exit { mode $exit {

112
flake.lock generated
View file

@ -237,24 +237,6 @@
"rev": "9227223f6d922fee3c7b190b2cc238a99527bbb7", "rev": "9227223f6d922fee3c7b190b2cc238a99527bbb7",
"type": "github" "type": "github"
}, },
"original": {
"owner": "hercules-ci",
"repo": "flake-parts",
"type": "github"
}
},
"flake-parts_3": {
"inputs": {
"nixpkgs-lib": "nixpkgs-lib_2"
},
"locked": {
"lastModified": 1719994518,
"narHash": "sha256-pQMhCCHyQGRzdfAkdJ4cIWiw+JNuWsTX7f0ZYSyz0VY=",
"owner": "hercules-ci",
"repo": "flake-parts",
"rev": "9227223f6d922fee3c7b190b2cc238a99527bbb7",
"type": "github"
},
"original": { "original": {
"id": "flake-parts", "id": "flake-parts",
"type": "indirect" "type": "indirect"
@ -535,25 +517,6 @@
"type": "github" "type": "github"
} }
}, },
"nix-gaming": {
"inputs": {
"flake-parts": "flake-parts_2",
"nixpkgs": "nixpkgs_3"
},
"locked": {
"lastModified": 1720920199,
"narHash": "sha256-0dNwRhtUVQha5S+NFeoeMXEt/6v0x56DCdyUk+vEFeY=",
"owner": "fufexan",
"repo": "nix-gaming",
"rev": "fce565402d5b1ed4e92c4a9dfcd094d0172d8f0b",
"type": "github"
},
"original": {
"owner": "fufexan",
"repo": "nix-gaming",
"type": "github"
}
},
"nix-index-database": { "nix-index-database": {
"inputs": { "inputs": {
"nixpkgs": "nixpkgs_2" "nixpkgs": "nixpkgs_2"
@ -620,7 +583,7 @@
"nixgl": { "nixgl": {
"inputs": { "inputs": {
"flake-utils": "flake-utils_4", "flake-utils": "flake-utils_4",
"nixpkgs": "nixpkgs_4" "nixpkgs": "nixpkgs_3"
}, },
"locked": { "locked": {
"lastModified": 1713543440, "lastModified": 1713543440,
@ -732,18 +695,6 @@
"url": "https://github.com/NixOS/nixpkgs/archive/5daf0514482af3f97abaefc78a6606365c9108e2.tar.gz" "url": "https://github.com/NixOS/nixpkgs/archive/5daf0514482af3f97abaefc78a6606365c9108e2.tar.gz"
} }
}, },
"nixpkgs-lib_2": {
"locked": {
"lastModified": 1719876945,
"narHash": "sha256-Fm2rDDs86sHy0/1jxTOKB1118Q0O3Uc7EC0iXvXKpbI=",
"type": "tarball",
"url": "https://github.com/NixOS/nixpkgs/archive/5daf0514482af3f97abaefc78a6606365c9108e2.tar.gz"
},
"original": {
"type": "tarball",
"url": "https://github.com/NixOS/nixpkgs/archive/5daf0514482af3f97abaefc78a6606365c9108e2.tar.gz"
}
},
"nixpkgs-stable": { "nixpkgs-stable": {
"locked": { "locked": {
"lastModified": 1720954236, "lastModified": 1720954236,
@ -825,22 +776,6 @@
} }
}, },
"nixpkgs_3": { "nixpkgs_3": {
"locked": {
"lastModified": 1720781449,
"narHash": "sha256-po3TZO9kcZwzvkyMJKb0WCzzDtiHWD34XeRaX1lWXp0=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "8b5a3d5a1d951344d683b442c0739010b80039db",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixpkgs-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs_4": {
"locked": { "locked": {
"lastModified": 1660551188, "lastModified": 1660551188,
"narHash": "sha256-a1LARMMYQ8DPx1BgoI/UN4bXe12hhZkCNqdxNi6uS0g=", "narHash": "sha256-a1LARMMYQ8DPx1BgoI/UN4bXe12hhZkCNqdxNi6uS0g=",
@ -855,6 +790,22 @@
"type": "github" "type": "github"
} }
}, },
"nixpkgs_4": {
"locked": {
"lastModified": 1720957393,
"narHash": "sha256-oedh2RwpjEa+TNxhg5Je9Ch6d3W1NKi7DbRO1ziHemA=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "693bc46d169f5af9c992095736e82c3488bf7dbb",
"type": "github"
},
"original": {
"owner": "nixos",
"ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs_5": { "nixpkgs_5": {
"locked": { "locked": {
"lastModified": 1720957393, "lastModified": 1720957393,
@ -872,22 +823,6 @@
} }
}, },
"nixpkgs_6": { "nixpkgs_6": {
"locked": {
"lastModified": 1720957393,
"narHash": "sha256-oedh2RwpjEa+TNxhg5Je9Ch6d3W1NKi7DbRO1ziHemA=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "693bc46d169f5af9c992095736e82c3488bf7dbb",
"type": "github"
},
"original": {
"owner": "nixos",
"ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs_7": {
"locked": { "locked": {
"lastModified": 1720781449, "lastModified": 1720781449,
"narHash": "sha256-po3TZO9kcZwzvkyMJKb0WCzzDtiHWD34XeRaX1lWXp0=", "narHash": "sha256-po3TZO9kcZwzvkyMJKb0WCzzDtiHWD34XeRaX1lWXp0=",
@ -903,7 +838,7 @@
"type": "github" "type": "github"
} }
}, },
"nixpkgs_8": { "nixpkgs_7": {
"locked": { "locked": {
"lastModified": 1714912032, "lastModified": 1714912032,
"narHash": "sha256-clkcOIkg8G4xuJh+1onLG4HPMpbtzdLv4rHxFzgsH9c=", "narHash": "sha256-clkcOIkg8G4xuJh+1onLG4HPMpbtzdLv4rHxFzgsH9c=",
@ -969,8 +904,8 @@
}, },
"nswitch-rcm-nix": { "nswitch-rcm-nix": {
"inputs": { "inputs": {
"flake-parts": "flake-parts_3", "flake-parts": "flake-parts_2",
"nixpkgs": "nixpkgs_6" "nixpkgs": "nixpkgs_5"
}, },
"locked": { "locked": {
"lastModified": 1721302286, "lastModified": 1721302286,
@ -1034,13 +969,12 @@
"home-manager": "home-manager", "home-manager": "home-manager",
"lanzaboote": "lanzaboote", "lanzaboote": "lanzaboote",
"nix-alien": "nix-alien", "nix-alien": "nix-alien",
"nix-gaming": "nix-gaming",
"nix-index-database": "nix-index-database_2", "nix-index-database": "nix-index-database_2",
"nix-on-droid": "nix-on-droid", "nix-on-droid": "nix-on-droid",
"nixgl": "nixgl", "nixgl": "nixgl",
"nixos-generators": "nixos-generators", "nixos-generators": "nixos-generators",
"nixos-hardware": "nixos-hardware", "nixos-hardware": "nixos-hardware",
"nixpkgs": "nixpkgs_5", "nixpkgs": "nixpkgs_4",
"nixpkgs-stable": "nixpkgs-stable_3", "nixpkgs-stable": "nixpkgs-stable_3",
"nswitch-rcm-nix": "nswitch-rcm-nix", "nswitch-rcm-nix": "nswitch-rcm-nix",
"nur": "nur", "nur": "nur",
@ -1075,7 +1009,7 @@
}, },
"sops-nix": { "sops-nix": {
"inputs": { "inputs": {
"nixpkgs": "nixpkgs_7", "nixpkgs": "nixpkgs_6",
"nixpkgs-stable": "nixpkgs-stable_4" "nixpkgs-stable": "nixpkgs-stable_4"
}, },
"locked": { "locked": {
@ -1104,7 +1038,7 @@
"flake-compat": "flake-compat_3", "flake-compat": "flake-compat_3",
"gnome-shell": "gnome-shell", "gnome-shell": "gnome-shell",
"home-manager": "home-manager_3", "home-manager": "home-manager_3",
"nixpkgs": "nixpkgs_8" "nixpkgs": "nixpkgs_7"
}, },
"locked": { "locked": {
"lastModified": 1720818679, "lastModified": 1720818679,

View file

@ -47,11 +47,6 @@
inputs.nixpkgs.follows = "nixpkgs"; inputs.nixpkgs.follows = "nixpkgs";
}; };
# patches for gaming on nix
nix-gaming = {
url = "github:fufexan/nix-gaming";
};
# hardware quirks on nix # hardware quirks on nix
nixos-hardware = { nixos-hardware = {
url = "github:NixOS/nixos-hardware/master"; url = "github:NixOS/nixos-hardware/master";
@ -87,6 +82,7 @@
lanzaboote, lanzaboote,
nixos-hardware, nixos-hardware,
nix-alien, nix-alien,
nixos-generators,
nswitch-rcm-nix, nswitch-rcm-nix,
nix-index-database, nix-index-database,
... ...
@ -151,7 +147,7 @@
modules = modules =
nixModules nixModules
++ [ ++ [
./profiles/onett/nixos.nix ./profles/onett/nixos.nix
home-manager.nixosModules.home-manager home-manager.nixosModules.home-manager
{ {
home-manager.users.swarsel.imports = home-manager.users.swarsel.imports =
@ -368,6 +364,13 @@
}; };
packages.x86_64-linux = { packages.x86_64-linux = {
proxmox-lxc = nixos-generators.nixosGenerate {
inherit system;
modules = [
./profiles/server1/TEMPLATE/nixos.nix
];
format = "proxmox-lxc";
};
}; };
}; };
} }

File diff suppressed because it is too large Load diff

View file

@ -45,7 +45,8 @@
# format = ""; # format = "";
# on-click-right = "wlogout -p layer-shell"; # on-click-right = "wlogout -p layer-shell";
# }; # };
# programs.waybar.settings.mainBar.modules-right = ["custom/outer-left-arrow-dark" # programs.waybar.settings.mainBar.modules-right = [
# "custom/outer-left-arrow-dark"
# "mpris" # "mpris"
# "custom/left-arrow-light" # "custom/left-arrow-light"
# "network" # "network"

View file

@ -29,6 +29,7 @@
# nix # nix
alejandra alejandra
nixpkgs-fmt
deadnix deadnix
statix statix
@ -170,7 +171,8 @@
noto-fonts-cjk-sans noto-fonts-cjk-sans
# cura # cura
(let (
let
cura5 = appimageTools.wrapType2 rec { cura5 = appimageTools.wrapType2 rec {
name = "cura5"; name = "cura5";
version = "5.4.0"; version = "5.4.0";
@ -194,7 +196,8 @@
args+=("$a") args+=("$a")
done done
exec "${cura5}/bin/cura5" "''${args[@]}" exec "${cura5}/bin/cura5" "''${args[@]}"
'') ''
)
#E: hides scratchpad depending on state, calls emacsclient for edit and then restores the scratchpad state #E: hides scratchpad depending on state, calls emacsclient for edit and then restores the scratchpad state
(pkgs.writeShellScriptBin "e" '' (pkgs.writeShellScriptBin "e" ''
@ -332,7 +335,10 @@
programs.ssh = { programs.ssh = {
enable = true; enable = true;
extraConfig = "SetEnv TERM=xterm-256color"; forwardAgent = true;
extraConfig = ''
SetEnv TERM=xterm-256color
'';
matchBlocks = { matchBlocks = {
"nginx" = { "nginx" = {
hostname = "192.168.1.14"; hostname = "192.168.1.14";
@ -406,57 +412,18 @@
hostname = "193.122.53.173"; hostname = "193.122.53.173";
user = "root"; #this is a oracle vm server but needs root due to nixos-infect user = "root"; #this is a oracle vm server but needs root due to nixos-infect
}; };
"songdiver" = {
hostname = "89.168.100.65";
user = "ubuntu";
};
"pkv" = { "pkv" = {
hostname = "46.232.248.161"; hostname = "46.232.248.161";
user = "root"; user = "root";
}; };
"nebula" = {
hostname = "128.131.171.15";
user = "amp23s56";
compression = true;
identityFile = "~/.ssh/id_ed25519";
proxyCommand = "ssh -p 1022 -i ~/.ssh/id_ed25519 -q -W %h:%p %r@venus.par.tuwien.ac.at";
extraOptions = {
"TCPKeepAlive" = "yes";
};
};
"efficient" = { "efficient" = {
hostname = "g0.complang.tuwien.ac.at"; hostname = "g0.complang.tuwien.ac.at";
forwardAgent = true; forwardAgent = true;
user = "ep01427399"; user = "ep01427399";
# leaving the below lines in for future reference
# remoteForwards = [
# {
# bind.address = "/run/user/21217/gnupg/S.gpg-agent";
# host.address = "/run/user/1000/gnupg/S.gpg-agent.extra";
# }
# {
# bind.address = "/run/user/21217/gnupg/S.gpg-agent.ssh";
# host.address = "/run/user/1000/gnupg/S.gpg-agent.ssh";
# }
# ];
# extraOptions = {
# "RemoteForward" = "/run/user/21217/gnupg/S.gpg-agent /run/user/1000/gnupg/S.gpg-agent.extra";
# "StreamLocalBindUnlink" = "yes";
# "RemoteForward" = "/run/user/21217/gnupg/S.gpg-agent.ssh /run/user/1000/gnupg/S.gpg-agent.ssh";
# };
# setEnv = {
# "TERM" = "xterm";
# };
};
"hydra" = {
hostname = "128.131.171.215";
user = "hpc23w33";
compression = true;
forwardAgent = true;
# identityFile = "~/.ssh/id_tuwien_hpc";
# proxyCommand = "ssh -p 1022 -i ~/.ssh/id_tuwien_hpc -q -W %h:%p %r@venus.par.tuwien.ac.at";
proxyCommand = "ssh -p 1022 -q -W %h:%p %r@venus.par.tuwien.ac.at";
extraOptions = {
"TCPKeepAlive" = "yes";
};
}; };
}; };
}; };
@ -550,8 +517,9 @@
pandoc.enable = true; pandoc.enable = true;
fzf.enable = true; fzf.enable = true;
zoxide.enable = true; zoxide.enable = true;
};
nix-index = let programs.nix-index = let
command-not-found = pkgs.runCommandLocal "command-not-found.sh" {} '' command-not-found = pkgs.runCommandLocal "command-not-found.sh" {} ''
mkdir -p $out/etc/profile.d mkdir -p $out/etc/profile.d
substitute ${../../scripts/command-not-found.sh} \ substitute ${../../scripts/command-not-found.sh} \
@ -566,7 +534,6 @@
paths = [command-not-found]; paths = [command-not-found];
}; };
}; };
};
programs.password-store = { programs.password-store = {
enable = true; enable = true;

View file

@ -263,6 +263,31 @@ create a new one."
(while (re-search-forward (concat "^" (regexp-quote common-prefix) "\\.") end t) (while (re-search-forward (concat "^" (regexp-quote common-prefix) "\\.") end t)
(replace-match "")))))) (replace-match ""))))))
(defun swarsel/org-nixpkgs-fmt-block-lite ()
(interactive)
(org-babel-mark-block)
(call-interactively 'nixpkgs-fmt-region))
(defun swarsel/org-nixpkgs-fmt-block ()
(interactive)
(save-excursion
(let* ((element (org-element-at-point))
(begin (org-element-property :begin element))
(end (org-element-property :end element))
(lang (org-element-property :language element)))
(when lang
(goto-char begin)
(forward-line)
(insert "{")
(goto-char end)
(forward-line -1)
(beginning-of-line)
(forward-char -1)
(insert "}")
(org-babel-mark-block)
(call-interactively 'nixpkgs-fmt-region)))))
;; Make ESC quit prompts ;; Make ESC quit prompts
(global-set-key (kbd "<escape>") 'keyboard-escape-quit) (global-set-key (kbd "<escape>") 'keyboard-escape-quit)
@ -1074,6 +1099,8 @@ create a new one."
(use-package nix-mode (use-package nix-mode
:mode "\\.nix\\'") :mode "\\.nix\\'")
(use-package nixpkgs-fmt)
(setq markdown-command "pandoc") (setq markdown-command "pandoc")
(use-package markdown-mode (use-package markdown-mode