chore: code cleanup (nixpkgs-fmt style)

This commit is contained in:
Swarsel 2024-07-20 00:21:55 +02:00
parent 2a08576697
commit dc66bb27dd
Signed by: swarsel
GPG key ID: 26A54C31F2A4FD84
44 changed files with 1152 additions and 1138 deletions

112
flake.nix
View file

@ -2,6 +2,7 @@
description = "SwarseFlake - Nix Flake for all SwarselSystems"; description = "SwarseFlake - Nix Flake for all SwarselSystems";
inputs = { inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
nixpkgs-stable.url = "github:NixOS/nixpkgs/nixos-24.05"; nixpkgs-stable.url = "github:NixOS/nixpkgs/nixos-24.05";
@ -67,26 +68,29 @@
url = "github:nix-community/nix-index-database"; url = "github:nix-community/nix-index-database";
inputs.nixpkgs.follows = "nixpkgs"; inputs.nixpkgs.follows = "nixpkgs";
}; };
}; };
outputs = inputs @ { outputs =
nixpkgs, inputs@{ nixpkgs
nixpkgs-stable, , nixpkgs-stable
home-manager, , home-manager
nix-on-droid, , nix-on-droid
emacs-overlay, , emacs-overlay
nur, , nur
nixgl, , nixgl
stylix, , stylix
sops-nix, , sops-nix
lanzaboote, , lanzaboote
nixos-hardware, , nixos-hardware
nix-alien, , nix-alien
nixos-generators, , nixos-generators
nswitch-rcm-nix, , nswitch-rcm-nix
nix-index-database, , nix-index-database
... , ...
}: let }:
let
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 { pkgs = import nixpkgs {
inherit system; inherit system;
@ -110,11 +114,7 @@
nswitch-rcm-nix.nixosModules.nswitch-rcm nswitch-rcm-nix.nixosModules.nswitch-rcm
./profiles/common/nixos.nix ./profiles/common/nixos.nix
# dynamic library loading # dynamic library loading
({ ({ self, system, ... }: {
self,
system,
...
}: {
environment.systemPackages = with self.inputs.nix-alien.packages.${system}; [ environment.systemPackages = with self.inputs.nix-alien.packages.${system}; [
nix-alien nix-alien
]; ];
@ -133,7 +133,10 @@
nix-index-database.hmModules.nix-index nix-index-database.hmModules.nix-index
./profiles/common/home.nix ./profiles/common/home.nix
]; ];
in {
in
{
# NixOS setups - run home-manager as a NixOS module for better compatibility # NixOS setups - run home-manager as a NixOS module for better compatibility
# another benefit - full rebuild on nixos-rebuild switch # another benefit - full rebuild on nixos-rebuild switch
# run rebuild using `nswitch` # run rebuild using `nswitch`
@ -142,17 +145,14 @@
# Make sure to move hardware-configuration to the appropriate location, by default it is found in /etc/nixos/. # Make sure to move hardware-configuration to the appropriate location, by default it is found in /etc/nixos/.
nixosConfigurations = { nixosConfigurations = {
onett = nixpkgs.lib.nixosSystem { onett = nixpkgs.lib.nixosSystem {
specialArgs = { inherit inputs pkgs; }; specialArgs = { inherit inputs pkgs; };
modules = modules = nixModules ++ [
nixModules
++ [
./profles/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 = mixedModules ++ [
mixedModules
++ [
./profiles/onett/home.nix ./profiles/onett/home.nix
]; ];
} }
@ -169,15 +169,11 @@
twoson = nixpkgs.lib.nixosSystem { twoson = nixpkgs.lib.nixosSystem {
specialArgs = { inherit inputs pkgs; }; specialArgs = { inherit inputs pkgs; };
modules = modules = nixModules ++ [
nixModules
++ [
./profiles/twoson/nixos.nix ./profiles/twoson/nixos.nix
home-manager.nixosModules.home-manager home-manager.nixosModules.home-manager
{ {
home-manager.users.swarsel.imports = home-manager.users.swarsel.imports = mixedModules ++ [
mixedModules
++ [
./profiles/twoson/home.nix ./profiles/twoson/home.nix
]; ];
} }
@ -186,16 +182,12 @@
threed = nixpkgs.lib.nixosSystem { threed = nixpkgs.lib.nixosSystem {
specialArgs = { inherit inputs pkgs; }; specialArgs = { inherit inputs pkgs; };
modules = modules = nixModules ++ [
nixModules
++ [
lanzaboote.nixosModules.lanzaboote lanzaboote.nixosModules.lanzaboote
./profiles/threed/nixos.nix ./profiles/threed/nixos.nix
home-manager.nixosModules.home-manager home-manager.nixosModules.home-manager
{ {
home-manager.users.swarsel.imports = home-manager.users.swarsel.imports = mixedModules ++ [
mixedModules
++ [
./profiles/threed/home.nix ./profiles/threed/home.nix
]; ];
} }
@ -204,16 +196,12 @@
fourside = nixpkgs.lib.nixosSystem { fourside = nixpkgs.lib.nixosSystem {
specialArgs = { inherit inputs pkgs; }; specialArgs = { inherit inputs pkgs; };
modules = modules = nixModules ++ [
nixModules
++ [
nixos-hardware.nixosModules.lenovo-thinkpad-p14s-amd-gen2 nixos-hardware.nixosModules.lenovo-thinkpad-p14s-amd-gen2
./profiles/fourside/nixos.nix ./profiles/fourside/nixos.nix
home-manager.nixosModules.home-manager home-manager.nixosModules.home-manager
{ {
home-manager.users.swarsel.imports = home-manager.users.swarsel.imports = mixedModules ++ [
mixedModules
++ [
./profiles/fourside/home.nix ./profiles/fourside/home.nix
]; ];
} }
@ -222,16 +210,12 @@
winters = nixpkgs.lib.nixosSystem { winters = nixpkgs.lib.nixosSystem {
specialArgs = { inherit inputs pkgs; }; specialArgs = { inherit inputs pkgs; };
modules = modules = nixModules ++ [
nixModules
++ [
nixos-hardware.nixosModules.framework-16-inch-7040-amd nixos-hardware.nixosModules.framework-16-inch-7040-amd
./profiles/winters/nixos.nix ./profiles/winters/nixos.nix
home-manager.nixosModules.home-manager home-manager.nixosModules.home-manager
{ {
home-manager.users.swarsel.imports = home-manager.users.swarsel.imports = mixedModules ++ [
mixedModules
++ [
./profiles/winters/home.nix ./profiles/winters/home.nix
]; ];
} }
@ -240,15 +224,11 @@
stand = nixpkgs.lib.nixosSystem { stand = nixpkgs.lib.nixosSystem {
specialArgs = { inherit inputs pkgs; }; specialArgs = { inherit inputs pkgs; };
modules = modules = nixModules ++ [
nixModules
++ [
./profiles/stand/nixos.nix ./profiles/stand/nixos.nix
home-manager.nixosModules.home-manager home-manager.nixosModules.home-manager
{ {
home-manager.users.homelen.imports = home-manager.users.homelen.imports = mixedModules ++ [
mixedModules
++ [
./profiles/stand/home.nix ./profiles/stand/home.nix
]; ];
} }
@ -344,26 +324,28 @@
# run rebuild using `hmswitch` # run rebuild using `hmswitch`
homeConfigurations = { homeConfigurations = {
"leons@PCisLee" = home-manager.lib.homeManagerConfiguration { "leons@PCisLee" = home-manager.lib.homeManagerConfiguration {
inherit pkgs; inherit pkgs;
modules = modules = homeModules ++ mixedModules ++ [
homeModules
++ mixedModules
++ [
./profiles/surface/home.nix ./profiles/surface/home.nix
]; ];
}; };
}; };
nixOnDroidConfigurations = { nixOnDroidConfigurations = {
default = nix-on-droid.lib.nixOnDroidConfiguration { default = nix-on-droid.lib.nixOnDroidConfiguration {
modules = [ modules = [
./profiles/mysticant/configuration.nix ./profiles/mysticant/configuration.nix
]; ];
}; };
}; };
packages.x86_64-linux = { packages.x86_64-linux = {
proxmox-lxc = nixos-generators.nixosGenerate { proxmox-lxc = nixos-generators.nixosGenerate {
inherit system; inherit system;
modules = [ modules = [
@ -371,6 +353,8 @@
]; ];
format = "proxmox-lxc"; format = "proxmox-lxc";
}; };
}; };
}; };
} }

View file

@ -3,7 +3,7 @@
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"> <html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head> <head>
<!-- 2024-07-20 Sa 00:04 --> <!-- 2024-07-20 Sa 00:16 -->
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" /> <meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" /> <meta name="viewport" content="width=device-width, initial-scale=1" />
<title>SwarselSystems: NixOS + Emacs Configuration</title> <title>SwarselSystems: NixOS + Emacs Configuration</title>
@ -261,7 +261,7 @@
<li><a href="#h:5ef03803-e150-41bc-b603-e80d60d96efc">3.3.6. Linking dotfiles</a></li> <li><a href="#h:5ef03803-e150-41bc-b603-e80d60d96efc">3.3.6. Linking dotfiles</a></li>
<li><a href="#h:4486b02f-4fb8-432b-bfa2-2e786206341d">3.3.7. Sourcing environment variables</a></li> <li><a href="#h:4486b02f-4fb8-432b-bfa2-2e786206341d">3.3.7. Sourcing environment variables</a></li>
<li><a href="#h:070a75ce-e209-4cda-aa25-e979bbf75d47">3.3.8. Programs</a></li> <li><a href="#h:070a75ce-e209-4cda-aa25-e979bbf75d47">3.3.8. Programs</a></li>
<li><a href="#org1d39a6e">3.3.9. nix-index</a></li> <li><a href="#org05cfe0c">3.3.9. nix-index</a></li>
<li><a href="#h:ac0e5e62-0dbf-4782-9a96-9e558eae86ae">3.3.10. password-store</a></li> <li><a href="#h:ac0e5e62-0dbf-4782-9a96-9e558eae86ae">3.3.10. password-store</a></li>
<li><a href="#h:1ab84307-b3fb-4c32-9def-4b89a53a8547">3.3.11. direnv</a></li> <li><a href="#h:1ab84307-b3fb-4c32-9def-4b89a53a8547">3.3.11. direnv</a></li>
<li><a href="#h:1bd6b0c7-f201-43e2-9624-6c50de00a1f6">3.3.12. eza</a></li> <li><a href="#h:1bd6b0c7-f201-43e2-9624-6c50de00a1f6">3.3.12. eza</a></li>
@ -329,7 +329,7 @@
<ul> <ul>
<li><a href="#h:99544398-72af-4382-b8e1-01b2221baff4">4.4.1. Org Mode</a></li> <li><a href="#h:99544398-72af-4382-b8e1-01b2221baff4">4.4.1. Org Mode</a></li>
<li><a href="#h:406c2ecc-0e3e-4d9f-9ae3-3eb1f8b87d1b">4.4.2. Nix Mode</a></li> <li><a href="#h:406c2ecc-0e3e-4d9f-9ae3-3eb1f8b87d1b">4.4.2. Nix Mode</a></li>
<li><a href="#org23b260b">4.4.3. nixpkgs-fmt</a></li> <li><a href="#orgc3f7bff">4.4.3. nixpkgs-fmt</a></li>
<li><a href="#h:50327461-a11b-4e81-830a-90febc720cfa">4.4.4. Markdown Mode</a></li> <li><a href="#h:50327461-a11b-4e81-830a-90febc720cfa">4.4.4. Markdown Mode</a></li>
<li><a href="#h:65e69741-9860-4ed0-bbed-7b7be9a2a9d6">4.4.5. Olivetti</a></li> <li><a href="#h:65e69741-9860-4ed0-bbed-7b7be9a2a9d6">4.4.5. Olivetti</a></li>
<li><a href="#h:94d4a0dc-b0d7-4702-b760-beeaa6da2b8f">4.4.6. darkroom</a></li> <li><a href="#h:94d4a0dc-b0d7-4702-b760-beeaa6da2b8f">4.4.6. darkroom</a></li>
@ -389,7 +389,7 @@
</div> </div>
</div> </div>
<p> <p>
<b>This file has 41226 words spanning 10979 lines and was last revised on 2024-07-20 00:04:46 +0200.</b> <b>This file has 41230 words spanning 10979 lines and was last revised on 2024-07-20 00:16:24 +0200.</b>
</p> </p>
<p> <p>
@ -439,7 +439,7 @@ This section defines my Emacs configuration. For a while, I considered to use ry
</p> </p>
<p> <p>
My emacs is built using the emacs-overlay nix flake, which builds a bleeding edge emacs on wayland (pgtk) with utilities like treesitter support. By executing the below source block, the current build setting can be updated at any time, and you can see my most up-to-date build options (last updated: 2024-07-20 00:04:46 +0200) My emacs is built using the emacs-overlay nix flake, which builds a bleeding edge emacs on wayland (pgtk) with utilities like treesitter support. By executing the below source block, the current build setting can be updated at any time, and you can see my most up-to-date build options (last updated: 2024-07-20 00:16:24 +0200)
</p></li> </p></li>
</ul> </ul>
@ -6993,8 +6993,8 @@ programs = {
</li> </li>
</ol> </ol>
</div> </div>
<div id="outline-container-org1d39a6e" class="outline-4"> <div id="outline-container-org05cfe0c" class="outline-4">
<h4 id="org1d39a6e"><span class="section-number-4">3.3.9.</span> nix-index</h4> <h4 id="org05cfe0c"><span class="section-number-4">3.3.9.</span> nix-index</h4>
<div class="outline-text-4" id="text-3-3-9"> <div class="outline-text-4" id="text-3-3-9">
<p> <p>
nix-index provides a way to find out which packages are provided by which derivations. By default it also comes with a replacement for <code>command-not-found.sh</code>, 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 <code>command-not-found.sh</code>, 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.
@ -9266,10 +9266,10 @@ We set a hook that runs everytime we save the file. It would be a bit more effic
</p> </p>
<div class="org-src-container"> <div class="org-src-container">
<pre class="src src-emacs-lisp">(defun run-alejandra () <pre class="src src-emacs-lisp">(defun swarsel/run-formatting ()
(interactive) (interactive)
(let ((default-directory (expand-file-name "~/.dotfiles"))) (let ((default-directory (expand-file-name "~/.dotfiles")))
(shell-command "alejandra . -q"))) (shell-command "nixpkgs-fmt . &gt; /dev/null")))
(defun swarsel/org-babel-tangle-config () (defun swarsel/org-babel-tangle-config ()
(when (string-equal (buffer-file-name) (when (string-equal (buffer-file-name)
@ -9278,7 +9278,7 @@ We set a hook that runs everytime we save the file. It would be a bit more effic
(let ((org-confirm-babel-evaluate nil)) (let ((org-confirm-babel-evaluate nil))
(org-html-export-to-html) (org-html-export-to-html)
(org-babel-tangle) (org-babel-tangle)
(run-alejandra)))) (swarsel/run-formatting))))
(setq org-html-htmlize-output-type nil) (setq org-html-htmlize-output-type nil)
@ -9391,7 +9391,7 @@ The standard Emacs behaviour for the Python process shell is a bit annoying. Thi
</div> </div>
</div> </div>
</li> </li>
<li><a id="org58d332d"></a>Nix common prefix bracketer<br /> <li><a id="org5914746"></a>Nix common prefix bracketer<br />
<div class="outline-text-5" id="text-4-2-1-15"> <div class="outline-text-5" id="text-4-2-1-15">
<p> <p>
This function searches for common delimiters in region and removes them, summarizing all captured lines by it. This function searches for common delimiters in region and removes them, summarizing all captured lines by it.
@ -9424,7 +9424,7 @@ This function searches for common delimiters in region and removes them, summari
</div> </div>
</div> </div>
</li> </li>
<li><a id="orge56e7f4"></a>Nix formatters<br /> <li><a id="orgd08d04a"></a>Nix formatters<br />
<div class="outline-text-5" id="text-4-2-1-16"> <div class="outline-text-5" id="text-4-2-1-16">
<p> <p>
This formats the org code block at <code>point</code> in accordance to the <code>nixpkgs-fmt</code> formatter This formats the org code block at <code>point</code> in accordance to the <code>nixpkgs-fmt</code> formatter
@ -10997,8 +10997,8 @@ This adds a rudimentary nix-mode to Emacs. I have not really tried this out, as
</div> </div>
</div> </div>
</div> </div>
<div id="outline-container-org23b260b" class="outline-4"> <div id="outline-container-orgc3f7bff" class="outline-4">
<h4 id="org23b260b"><span class="section-number-4">4.4.3.</span> nixpkgs-fmt</h4> <h4 id="orgc3f7bff"><span class="section-number-4">4.4.3.</span> nixpkgs-fmt</h4>
<div class="outline-text-4" id="text-4-4-3"> <div class="outline-text-4" id="text-4-4-3">
<p> <p>
Adds functions for formatting nix code. Adds functions for formatting nix code.
@ -13013,7 +13013,7 @@ My laptop, sadly soon to be replaced by a new one, since most basic functions ar
</div> </div>
<div id="postamble" class="status"> <div id="postamble" class="status">
<p class="author">Author: Leon Schwarzäugl</p> <p class="author">Author: Leon Schwarzäugl</p>
<p class="date">Created: 2024-07-20 Sa 00:04</p> <p class="date">Created: 2024-07-20 Sa 00:16</p>
<p class="validation"><a href="https://validator.w3.org/check?uri=referer">Validate</a></p> <p class="validation"><a href="https://validator.w3.org/check?uri=referer">Validate</a></p>
</div> </div>
</body> </body>

View file

@ -1,8 +1,8 @@
{ config, pkgs, ... }:
{ {
config,
pkgs,
...
}: {
services.gpg-agent = { services.gpg-agent = {
enable = true; enable = true;
enableSshSupport = true; enableSshSupport = true;
@ -109,6 +109,7 @@
natural_scroll = "enabled"; natural_scroll = "enabled";
middle_emulation = "enabled"; middle_emulation = "enabled";
}; };
}; };
output = { output = {
@ -119,21 +120,25 @@
}; };
}; };
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\"";
}; };
startup = [ startup = [
{ command = "nextcloud --background"; } { command = "nextcloud --background"; }
{ command = "discord --start-minimized"; } { command = "discord --start-minimized"; }
{ command = "element-desktop --hidden -enable-features=UseOzonePlatform -ozone-platform=wayland --disable-gpu-driver-bug-workarounds"; } { command = "element-desktop --hidden -enable-features=UseOzonePlatform -ozone-platform=wayland --disable-gpu-driver-bug-workarounds"; }
{ command = "ANKI_WAYLAND=1 anki"; } { command = "ANKI_WAYLAND=1 anki"; }
{ command = "OBSIDIAN_USE_WAYLAND=1 obsidian"; } { command = "OBSIDIAN_USE_WAYLAND=1 obsidian"; }
{ command = "nm-applet"; } { command = "nm-applet"; }
]; ];
}; };
}; };

View file

@ -1,8 +1,14 @@
{pkgs, ...}: { { pkgs, ... }:
imports = [
{
imports =
[
./hardware-configuration.nix ./hardware-configuration.nix
]; ];
services = { services = {
getty.autologinUser = "TEMPLATE"; getty.autologinUser = "TEMPLATE";
greetd.settings.initial_session.user = "TEMPLATE"; greetd.settings.initial_session.user = "TEMPLATE";
@ -78,6 +84,7 @@
}; };
}; };
# Configure keymap in X11 (only used for login) # Configure keymap in X11 (only used for login)
services.xserver = { services.xserver = {
layout = "us"; layout = "us";
@ -95,4 +102,5 @@
]; ];
system.stateVersion = "23.05"; # TEMPLATE - but probably no need to change system.stateVersion = "23.05"; # TEMPLATE - but probably no need to change
} }

View file

@ -1,10 +1,8 @@
{ config, pkgs, fetchFromGitHub, ... }:
{ {
config,
pkgs,
fetchFromGitHub,
...
}: {
home.packages = with pkgs; [ home.packages = with pkgs; [
# audio stuff # audio stuff
spek # spectrum analyzer spek # spectrum analyzer
losslessaudiochecker losslessaudiochecker
@ -150,17 +148,9 @@
# latex and related packages # latex and related packages
(pkgs.texlive.combine { (pkgs.texlive.combine {
inherit inherit (pkgs.texlive) scheme-full
(pkgs.texlive) dvisvgm dvipng# for preview and export as html
scheme-full wrapfig amsmath ulem hyperref capt-of;
dvisvgm
dvipng # for preview and export as html
wrapfig
amsmath
ulem
hyperref
capt-of
;
}) })
# font stuff # font stuff
@ -319,6 +309,7 @@
cp "$1"{,.bak} cp "$1"{,.bak}
''; '';
}) })
]; ];
sops = { sops = {
@ -431,6 +422,7 @@
stylix.targets.emacs.enable = false; stylix.targets.emacs.enable = false;
xdg.desktopEntries = { xdg.desktopEntries = {
cura = { cura = {
name = "Ultimaker Cura"; name = "Ultimaker Cura";
genericName = "Cura"; genericName = "Cura";
@ -471,6 +463,7 @@
terminal = false; terminal = false;
categories = [ "Development" "TextEditor" ]; categories = [ "Development" "TextEditor" ];
}; };
}; };
home.file = { home.file = {
@ -519,7 +512,8 @@
zoxide.enable = true; zoxide.enable = true;
}; };
programs.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} \
@ -527,7 +521,8 @@
--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";
@ -936,11 +931,13 @@
}; };
packageRequires = [ ]; packageRequires = [ ];
}) })
]; ];
}; };
}; };
programs.waybar = { programs.waybar = {
enable = true; enable = true;
# systemd.enable = true; # systemd.enable = true;
settings = { settings = {
@ -993,6 +990,7 @@
critical-threshold = 80; critical-threshold = 80;
format-critical = " {temperatureC}°C"; format-critical = " {temperatureC}°C";
format = " {temperatureC}°C"; format = " {temperatureC}°C";
}; };
mpris = { mpris = {
@ -1080,6 +1078,7 @@
format-icons = [ "" "" "" "" "" "" "" "" ]; format-icons = [ "" "" "" "" "" "" "" "" ];
# on-click-right= "com.github.stsdc.monitor"; # on-click-right= "com.github.stsdc.monitor";
on-click-right = "kitty -o confirm_os_window_close=0 btm"; on-click-right = "kitty -o confirm_os_window_close=0 btm";
}; };
battery = { battery = {
states = { states = {
@ -1174,65 +1173,45 @@
search.engines = { search.engines = {
"Nix Packages" = { "Nix Packages" = {
urls = [ urls = [{
{
template = "https://search.nixos.org/packages"; template = "https://search.nixos.org/packages";
params = [ params = [
{ { name = "type"; value = "packages"; }
name = "type"; { name = "query"; value = "{searchTerms}"; }
value = "packages";
}
{
name = "query";
value = "{searchTerms}";
}
];
}
]; ];
}];
icon = "${pkgs.nixos-icons}/share/icons/hicolor/scalable/apps/nix-snowflake.svg"; icon = "${pkgs.nixos-icons}/share/icons/hicolor/scalable/apps/nix-snowflake.svg";
definedAliases = [ "@np" ]; definedAliases = [ "@np" ];
}; };
"NixOS Wiki" = { "NixOS Wiki" = {
urls = [ urls = [{
{
template = "https://nixos.wiki/index.php?search={searchTerms}"; template = "https://nixos.wiki/index.php?search={searchTerms}";
} }];
];
iconUpdateURL = "https://nixos.wiki/favicon.png"; iconUpdateURL = "https://nixos.wiki/favicon.png";
updateInterval = 24 * 60 * 60 * 1000; # every day updateInterval = 24 * 60 * 60 * 1000; # every day
definedAliases = [ "@nw" ]; definedAliases = [ "@nw" ];
}; };
"NixOS Options" = { "NixOS Options" = {
urls = [ urls = [{
{
template = "https://search.nixos.org/options"; template = "https://search.nixos.org/options";
params = [ params = [
{ { name = "query"; value = "{searchTerms}"; }
name = "query";
value = "{searchTerms}";
}
];
}
]; ];
}];
icon = "${pkgs.nixos-icons}/share/icons/hicolor/scalable/apps/nix-snowflake.svg"; icon = "${pkgs.nixos-icons}/share/icons/hicolor/scalable/apps/nix-snowflake.svg";
definedAliases = [ "@no" ]; definedAliases = [ "@no" ];
}; };
"Home Manager Options" = { "Home Manager Options" = {
urls = [ urls = [{
{
template = "https://home-manager-options.extranix.com/"; template = "https://home-manager-options.extranix.com/";
params = [ params = [
{ { name = "query"; value = "{searchTerms}"; }
name = "query";
value = "{searchTerms}";
}
];
}
]; ];
}];
icon = "${pkgs.nixos-icons}/share/icons/hicolor/scalable/apps/nix-snowflake.svg"; icon = "${pkgs.nixos-icons}/share/icons/hicolor/scalable/apps/nix-snowflake.svg";
definedAliases = [ "@hm" "@ho" "@hmo" ]; definedAliases = [ "@hm" "@ho" "@hmo" ];
@ -1312,9 +1291,11 @@ group-by=category
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";
@ -1479,6 +1460,7 @@ group-by=category
# }; # };
# } # }
{ {
command = "resize set width 60 ppt height 60 ppt, sticky enable, move container to scratchpad"; command = "resize set width 60 ppt height 60 ppt, sticky enable, move container to scratchpad";
criteria = { criteria = {
class = "Spotify"; class = "Spotify";
@ -1523,7 +1505,8 @@ group-by=category
# 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
@ -1535,7 +1518,8 @@ group-by=category
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 {
@ -1558,4 +1542,5 @@ group-by=category
"; ";
}; };
} }

View file

@ -1,9 +1,6 @@
{ config, lib, pkgs, ... }:
{ {
config,
lib,
pkgs,
...
}: {
home-manager = { home-manager = {
useGlobalPkgs = true; useGlobalPkgs = true;
useUserPackages = true; useUserPackages = true;
@ -238,7 +235,8 @@
proxy = { }; proxy = { };
vpn = { vpn = {
auth = "sha1"; auth = "sha1";
ca = "${config.users.users.swarsel.home}/.dotfiles/secrets/certs/sweden-aes-128-cbc-udp-dns-ca.pem"; ca =
"${config.users.users.swarsel.home}/.dotfiles/secrets/certs/sweden-aes-128-cbc-udp-dns-ca.pem";
challenge-response-flags = "2"; challenge-response-flags = "2";
cipher = "aes-128-cbc"; cipher = "aes-128-cbc";
compress = "yes"; compress = "yes";
@ -279,6 +277,7 @@
psk = "$HOTSPOT"; psk = "$HOTSPOT";
}; };
}; };
}; };
}; };
}; };
@ -303,6 +302,7 @@
}; };
sops = { sops = {
defaultSopsFile = "${config.users.users.swarsel.home}/.dotfiles/secrets/general/secrets.yaml"; defaultSopsFile = "${config.users.users.swarsel.home}/.dotfiles/secrets/general/secrets.yaml";
validateSopsFiles = false; validateSopsFiles = false;
@ -405,7 +405,9 @@
tar xvf $src -C $out/ tar xvf $src -C $out/
mv $out/oama-0.13.1-Linux-x86_64-static/oama $out/bin/ mv $out/oama-0.13.1-Linux-x86_64-static/oama $out/bin/
''; '';
}) })
]; ];
programs = { programs = {
@ -454,7 +456,8 @@
# 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
@ -465,7 +468,8 @@
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} \
@ -505,4 +509,5 @@
environment.etc."greetd/environments".text = '' environment.etc."greetd/environments".text = ''
sway sway
''; '';
} }

View file

@ -1,11 +1,10 @@
# Do not modify this file! It was generated by nixos-generate-config # Do not modify this file! It was generated by nixos-generate-config
# and may be overwritten by future invocations. Please make changes # and may be overwritten by future invocations. Please make changes
# to /etc/nixos/configuration.nix instead. # to /etc/nixos/configuration.nix instead.
{ { config
config, , lib
lib, , modulesPath
modulesPath, , ...
...
}: { }: {
imports = [ imports = [
(modulesPath + "/installer/scan/not-detected.nix") (modulesPath + "/installer/scan/not-detected.nix")

View file

@ -1,8 +1,8 @@
{ config, pkgs, ... }:
{ {
config,
pkgs,
...
}: {
services.gpg-agent = { services.gpg-agent = {
enable = true; enable = true;
enableSshSupport = true; enableSshSupport = true;
@ -34,6 +34,7 @@
temperature.input-filename = "temp1_input"; temperature.input-filename = "temp1_input";
}; };
programs.waybar.settings.mainBar.modules-right = [ programs.waybar.settings.mainBar.modules-right = [
"custom/outer-left-arrow-dark" "custom/outer-left-arrow-dark"
"mpris" "mpris"
@ -52,6 +53,7 @@
"clock#1" "clock#1"
]; ];
wayland.windowManager.sway = { wayland.windowManager.sway = {
config = rec { config = rec {
# update for actual inputs here, # update for actual inputs here,
@ -72,6 +74,7 @@
natural_scroll = "enabled"; natural_scroll = "enabled";
middle_emulation = "enabled"; middle_emulation = "enabled";
}; };
}; };
output = { output = {
@ -90,19 +93,16 @@
}; };
workspaceOutputAssign = [ workspaceOutputAssign = [
{ { output = "eDP-1"; workspace = "1:"; }
output = "eDP-1"; { output = "DP-4"; workspace = "2:"; }
workspace = "1:";
}
{
output = "DP-4";
workspace = "2:";
}
]; ];
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%-";
@ -119,12 +119,14 @@
}; };
startup = [ startup = [
{ command = "nextcloud --background"; } { command = "nextcloud --background"; }
{ command = "discord --start-minimized"; } { command = "discord --start-minimized"; }
{ command = "element-desktop --hidden -enable-features=UseOzonePlatform -ozone-platform=wayland --disable-gpu-driver-bug-workarounds"; } { command = "element-desktop --hidden -enable-features=UseOzonePlatform -ozone-platform=wayland --disable-gpu-driver-bug-workarounds"; }
{ command = "ANKI_WAYLAND=1 anki"; } { command = "ANKI_WAYLAND=1 anki"; }
{ command = "OBSIDIAN_USE_WAYLAND=1 obsidian"; } { command = "OBSIDIAN_USE_WAYLAND=1 obsidian"; }
{ command = "nm-applet"; } { command = "nm-applet"; }
]; ];
}; };
}; };

View file

@ -1,15 +1,15 @@
{ config, pkgs, ... }:
{ {
config,
pkgs,
...
}: {
# #
# imports = # imports =
# [ # [
# ./hardware-configuration.nix # ./hardware-configuration.nix
# ]; # ];
# #
imports = [ imports =
[
./hardware-configuration.nix ./hardware-configuration.nix
]; ];
@ -36,24 +36,12 @@
allowedUDPPorts = [ 4380 27036 14242 34197 51820 ]; # 34197: factorio; 4380 27036 14242: barotrauma; 51820: wireguard allowedUDPPorts = [ 4380 27036 14242 34197 51820 ]; # 34197: factorio; 4380 27036 14242: barotrauma; 51820: wireguard
allowedTCPPorts = [ ]; # 34197: factorio; 4380 27036 14242: barotrauma; 51820: wireguard allowedTCPPorts = [ ]; # 34197: factorio; 4380 27036 14242: barotrauma; 51820: wireguard
allowedTCPPortRanges = [ allowedTCPPortRanges = [
{ { from = 27015; to = 27030; } # barotrauma
from = 27015; { from = 27036; to = 27037; } # barotrauma
to = 27030;
} # barotrauma
{
from = 27036;
to = 27037;
} # barotrauma
]; ];
allowedUDPPortRanges = [ allowedUDPPortRanges = [
{ { from = 27000; to = 27031; } # barotrauma
from = 27000; { from = 58962; to = 58964; } # barotrauma
to = 27031;
} # barotrauma
{
from = 58962;
to = 58964;
} # barotrauma
]; ];
}; };
}; };
@ -117,6 +105,7 @@
}; };
}; };
hardware = { hardware = {
graphics = { graphics = {
enable = true; enable = true;
@ -177,4 +166,6 @@
]; ];
system.stateVersion = "23.05"; system.stateVersion = "23.05";
} }

View file

@ -1,11 +1,9 @@
{ { config, pkgs, sops, ... }:
config, let
pkgs,
sops,
...
}: let
matrixDomain = "swatrix.swarsel.win"; matrixDomain = "swatrix.swarsel.win";
in { in
{
imports = [ imports = [
./hardware-configuration.nix ./hardware-configuration.nix
]; ];
@ -82,6 +80,7 @@ in {
recommendedOptimisation = true; recommendedOptimisation = true;
recommendedGzipSettings = true; recommendedGzipSettings = true;
virtualHosts = { virtualHosts = {
"swatrix.swarsel.win" = { "swatrix.swarsel.win" = {
enableACME = true; enableACME = true;
forceSSL = true; forceSSL = true;
@ -291,6 +290,7 @@ in {
domain = matrixDomain; domain = matrixDomain;
}; };
appservice = { appservice = {
address = "http://localhost:29328"; address = "http://localhost:29328";
hostname = "0.0.0.0"; hostname = "0.0.0.0";
port = 29328; port = 29328;
@ -336,4 +336,5 @@ in {
User = "root"; User = "root";
}; };
}; };
} }

View file

@ -1,8 +1,7 @@
{ { config
config, , lib
lib, , modulesPath
modulesPath, , ...
...
}: { }: {
imports = [ imports = [
(modulesPath + "/profiles/qemu-guest.nix") (modulesPath + "/profiles/qemu-guest.nix")

View file

@ -1,8 +1,6 @@
{ config, pkgs, ... }:
{ {
config,
pkgs,
...
}: {
imports = [ imports = [
./hardware-configuration.nix ./hardware-configuration.nix
]; ];
@ -46,6 +44,7 @@
recommendedOptimisation = true; recommendedOptimisation = true;
recommendedGzipSettings = true; recommendedGzipSettings = true;
virtualHosts = { virtualHosts = {
"synki.swarsel.win" = { "synki.swarsel.win" = {
enableACME = true; enableACME = true;
forceSSL = true; forceSSL = true;
@ -161,4 +160,5 @@
}; };
}; };
}; };
} }

View file

@ -1,11 +1,10 @@
# Do not modify this file! It was generated by nixos-generate-config # Do not modify this file! It was generated by nixos-generate-config
# and may be overwritten by future invocations. Please make changes # and may be overwritten by future invocations. Please make changes
# to /etc/nixos/configuration.nix instead. # to /etc/nixos/configuration.nix instead.
{ { config
config, , lib
lib, , modulesPath
modulesPath, , ...
...
}: { }: {
imports = [ imports = [
(modulesPath + "/installer/scan/not-detected.nix") (modulesPath + "/installer/scan/not-detected.nix")

View file

@ -1,11 +1,9 @@
{ { config, pkgs, sops, ... }:
config, let
pkgs,
sops,
...
}: let
matrixDomain = "swatrix.swarsel.win"; matrixDomain = "swatrix.swarsel.win";
in { in
{
imports = [ imports = [
./hardware-configuration.nix ./hardware-configuration.nix
]; ];
@ -109,10 +107,12 @@ in {
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 = {
@ -137,23 +137,28 @@ in {
zfs zfs
]; ];
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";
}; };
@ -269,12 +274,10 @@ in {
openssh = { openssh = {
enable = true; enable = true;
settings.PermitRootLogin = "yes"; settings.PermitRootLogin = "yes";
listenAddresses = [ listenAddresses = [{
{
port = 22; port = 22;
addr = "0.0.0.0"; addr = "0.0.0.0";
} }];
];
}; };
nginx = { nginx = {
@ -284,6 +287,7 @@ in {
recommendedOptimisation = true; recommendedOptimisation = true;
recommendedGzipSettings = true; recommendedGzipSettings = true;
virtualHosts = { virtualHosts = {
"stash.swarsel.win" = { "stash.swarsel.win" = {
enableACME = true; enableACME = true;
forceSSL = true; forceSSL = true;
@ -318,6 +322,7 @@ in {
}; };
}; };
"sound.swarsel.win" = { "sound.swarsel.win" = {
enableACME = true; enableACME = true;
forceSSL = true; forceSSL = true;
@ -512,6 +517,9 @@ in {
# MAUTRIX_TELEGRAM_TELEGRAM_API_HASH=${config.sops.placeholder.mautrixtelegram_api_hash} # MAUTRIX_TELEGRAM_TELEGRAM_API_HASH=${config.sops.placeholder.mautrixtelegram_api_hash}
# ''; # '';
# ---------------- # ----------------
# sops.secrets.mautrixwhatsapp_shared = {owner="matrix-synapse";}; # sops.secrets.mautrixwhatsapp_shared = {owner="matrix-synapse";};
# sops.templates.mautrixwhatsapp.owner = "matrix-synapse"; # sops.templates.mautrixwhatsapp.owner = "matrix-synapse";
@ -678,6 +686,7 @@ in {
domain = matrixDomain; domain = matrixDomain;
}; };
appservice = { appservice = {
address = "http://localhost:29328"; address = "http://localhost:29328";
hostname = "0.0.0.0"; hostname = "0.0.0.0";
port = 29328; port = 29328;
@ -741,6 +750,7 @@ in {
]; ];
}; };
spotifyd = { spotifyd = {
enable = true; enable = true;
settings = { settings = {
@ -789,6 +799,7 @@ in {
}; };
}; };
avahi = { avahi = {
publish.enable = true; publish.enable = true;
publish.userServices = true; publish.userServices = true;

View file

@ -1,8 +1,6 @@
{ pkgs, modulesPath, ... }:
{ {
pkgs,
modulesPath,
...
}: {
imports = [ imports = [
(modulesPath + "/virtualisation/proxmox-lxc.nix") (modulesPath + "/virtualisation/proxmox-lxc.nix")
]; ];

View file

@ -1,9 +1,6 @@
{ config, pkgs, modulesPath, ... }:
{ {
config,
pkgs,
modulesPath,
...
}: {
imports = [ imports = [
(modulesPath + "/virtualisation/proxmox-lxc.nix") (modulesPath + "/virtualisation/proxmox-lxc.nix")
./hardware-configuration.nix ./hardware-configuration.nix
@ -68,4 +65,6 @@
port = 8080; port = 8080;
tokenKeyFile = config.sops.secrets.kavita.path; tokenKeyFile = config.sops.secrets.kavita.path;
}; };
} }

View file

@ -1,9 +1,6 @@
{ config, pkgs, modulesPath, ... }:
{ {
config,
pkgs,
modulesPath,
...
}: {
imports = [ imports = [
(modulesPath + "/virtualisation/proxmox-lxc.nix") (modulesPath + "/virtualisation/proxmox-lxc.nix")
./hardware-configuration.nix ./hardware-configuration.nix
@ -76,4 +73,5 @@
user = "jellyfin"; user = "jellyfin";
# openFirewall = true; # this works only for the default ports # openFirewall = true; # this works only for the default ports
}; };
} }

View file

@ -1,12 +1,10 @@
{ { config, pkgs, modulesPath, sops, ... }:
config, let
pkgs,
modulesPath,
sops,
...
}: let
matrixDomain = "matrix2.swarsel.win"; matrixDomain = "matrix2.swarsel.win";
in { in
{
services = { services = {
xserver = { xserver = {
layout = "us"; layout = "us";
@ -15,12 +13,10 @@ in {
openssh = { openssh = {
enable = true; enable = true;
settings.PermitRootLogin = "yes"; settings.PermitRootLogin = "yes";
listenAddresses = [ listenAddresses = [{
{
port = 22; port = 22;
addr = "0.0.0.0"; addr = "0.0.0.0";
} }];
];
}; };
}; };
@ -46,6 +42,7 @@ in {
nswitch = "cd /.dotfiles; git pull; nixos-rebuild --flake .#$(hostname) switch; cd -;"; nswitch = "cd /.dotfiles; git pull; nixos-rebuild --flake .#$(hostname) switch; cd -;";
}; };
imports = [ imports = [
(modulesPath + "/virtualisation/proxmox-lxc.nix") (modulesPath + "/virtualisation/proxmox-lxc.nix")
./hardware-configuration.nix ./hardware-configuration.nix
@ -261,6 +258,7 @@ in {
domain = matrixDomain; domain = matrixDomain;
}; };
appservice = { appservice = {
address = "http://localhost:29328"; address = "http://localhost:29328";
hostname = "0.0.0.0"; hostname = "0.0.0.0";
port = 29328; port = 29328;
@ -306,4 +304,5 @@ in {
User = "root"; User = "root";
}; };
}; };
} }

View file

@ -1,9 +1,5 @@
{ config, pkgs, modulesPath, ... }:
{ {
config,
pkgs,
modulesPath,
...
}: {
imports = [ imports = [
(modulesPath + "/virtualisation/proxmox-lxc.nix") (modulesPath + "/virtualisation/proxmox-lxc.nix")
./hardware-configuration.nix ./hardware-configuration.nix
@ -73,6 +69,7 @@
recommendedOptimisation = true; recommendedOptimisation = true;
recommendedGzipSettings = true; recommendedGzipSettings = true;
virtualHosts = { virtualHosts = {
"stash.swarsel.win" = { "stash.swarsel.win" = {
enableACME = true; enableACME = true;
forceSSL = true; forceSSL = true;
@ -110,6 +107,7 @@
}; };
}; };
"sound.swarsel.win" = { "sound.swarsel.win" = {
enableACME = true; enableACME = true;
forceSSL = true; forceSSL = true;
@ -199,6 +197,8 @@
}; };
}; };
}; };
}; };
}; };
} }

View file

@ -1,14 +1,14 @@
{ config, pkgs, modulesPath, ... }:
{ {
config,
pkgs,
modulesPath,
...
}: {
imports = [ imports = [
(modulesPath + "/virtualisation/proxmox-lxc.nix") (modulesPath + "/virtualisation/proxmox-lxc.nix")
./hardware-configuration.nix ./hardware-configuration.nix
]; ];
services = { services = {
xserver = { xserver = {
layout = "us"; layout = "us";
@ -17,12 +17,10 @@
openssh = { openssh = {
enable = true; enable = true;
settings.PermitRootLogin = "yes"; settings.PermitRootLogin = "yes";
listenAddresses = [ listenAddresses = [{
{
port = 22; port = 22;
addr = "0.0.0.0"; addr = "0.0.0.0";
} }];
];
}; };
}; };
@ -48,6 +46,8 @@
nswitch = "cd /.dotfiles; git pull; nixos-rebuild --flake .#$(hostname) switch; cd -;"; nswitch = "cd /.dotfiles; git pull; nixos-rebuild --flake .#$(hostname) switch; cd -;";
}; };
users.groups.lxc_shares = { users.groups.lxc_shares = {
gid = 10000; gid = 10000;
members = [ members = [
@ -90,4 +90,5 @@
}; };
}; };
}; };
} }

View file

@ -1,14 +1,14 @@
{ config, pkgs, modulesPath, ... }:
{ {
config,
pkgs,
modulesPath,
...
}: {
imports = [ imports = [
(modulesPath + "/virtualisation/proxmox-lxc.nix") (modulesPath + "/virtualisation/proxmox-lxc.nix")
./hardware-configuration.nix ./hardware-configuration.nix
]; ];
services = { services = {
xserver = { xserver = {
layout = "us"; layout = "us";
@ -17,12 +17,10 @@
openssh = { openssh = {
enable = true; enable = true;
settings.PermitRootLogin = "yes"; settings.PermitRootLogin = "yes";
listenAddresses = [ listenAddresses = [{
{
port = 22; port = 22;
addr = "0.0.0.0"; addr = "0.0.0.0";
} }];
];
}; };
}; };
@ -48,6 +46,8 @@
nswitch = "cd /.dotfiles; git pull; nixos-rebuild --flake .#$(hostname) switch; cd -;"; nswitch = "cd /.dotfiles; git pull; nixos-rebuild --flake .#$(hostname) switch; cd -;";
}; };
proxmoxLXC.privileged = true; # manage hostname myself proxmoxLXC.privileged = true; # manage hostname myself
users = { users = {

View file

@ -1,13 +1,14 @@
{ pkgs, modulesPath, ... }:
{ {
pkgs,
modulesPath,
...
}: {
imports = [ imports = [
(modulesPath + "/virtualisation/proxmox-lxc.nix") (modulesPath + "/virtualisation/proxmox-lxc.nix")
./hardware-configuration.nix ./hardware-configuration.nix
]; ];
services = { services = {
xserver = { xserver = {
layout = "us"; layout = "us";
@ -16,12 +17,10 @@
openssh = { openssh = {
enable = true; enable = true;
settings.PermitRootLogin = "yes"; settings.PermitRootLogin = "yes";
listenAddresses = [ listenAddresses = [{
{
port = 22; port = 22;
addr = "0.0.0.0"; addr = "0.0.0.0";
} }];
];
}; };
}; };
@ -47,6 +46,8 @@
nswitch = "cd /.dotfiles; git pull; nixos-rebuild --flake .#$(hostname) switch; cd -;"; nswitch = "cd /.dotfiles; git pull; nixos-rebuild --flake .#$(hostname) switch; cd -;";
}; };
proxmoxLXC.privileged = true; # manage hostname myself proxmoxLXC.privileged = true; # manage hostname myself
users.groups.spotifyd = { users.groups.spotifyd = {
@ -88,4 +89,5 @@
}; };
}; };
}; };
} }

View file

@ -1,9 +1,6 @@
{ config, pkgs, modulesPath, ... }:
{ {
config,
pkgs,
modulesPath,
...
}: {
imports = [ imports = [
(modulesPath + "/virtualisation/proxmox-lxc.nix") (modulesPath + "/virtualisation/proxmox-lxc.nix")
./hardware-configuration.nix ./hardware-configuration.nix
@ -90,23 +87,28 @@
''; '';
}; };
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";
}; };
@ -114,12 +116,10 @@
services.openssh = { services.openssh = {
enable = true; enable = true;
settings.PermitRootLogin = "yes"; settings.PermitRootLogin = "yes";
listenAddresses = [ listenAddresses = [{
{
port = 22; port = 22;
addr = "0.0.0.0"; addr = "0.0.0.0";
} }];
];
}; };
users.users.root.openssh.authorizedKeys.keyFiles = [ users.users.root.openssh.authorizedKeys.keyFiles = [
../../../secrets/keys/authorized_keys ../../../secrets/keys/authorized_keys
@ -199,6 +199,7 @@
user = "vpn"; user = "vpn";
group = "lxc_shares"; group = "lxc_shares";
settings = { settings = {
alt-speed-down = 8000; alt-speed-down = 8000;
alt-speed-enabled = false; alt-speed-enabled = false;
alt-speed-time-begin = 0; alt-speed-time-begin = 0;
@ -269,4 +270,6 @@
utp-enabled = false; utp-enabled = false;
}; };
}; };
} }

View file

@ -1,11 +1,10 @@
# Do not modify this file! It was generated by nixos-generate-config # Do not modify this file! It was generated by nixos-generate-config
# and may be overwritten by future invocations. Please make changes # and may be overwritten by future invocations. Please make changes
# to /etc/nixos/configuration.nix instead. # to /etc/nixos/configuration.nix instead.
{ { config
config, , lib
lib, , modulesPath
modulesPath, , ...
...
}: { }: {
imports = [ imports = [
(modulesPath + "/installer/scan/not-detected.nix") (modulesPath + "/installer/scan/not-detected.nix")

View file

@ -1,8 +1,8 @@
{ config, pkgs, ... }:
{ {
config,
pkgs,
...
}: {
services.gpg-agent = { services.gpg-agent = {
enable = true; enable = true;
enableSshSupport = true; enableSshSupport = true;
@ -16,6 +16,7 @@
''; '';
}; };
home = { home = {
username = "swarsel"; username = "swarsel";
homeDirectory = "/home/swarsel"; homeDirectory = "/home/swarsel";
@ -50,6 +51,7 @@
"clock#1" "clock#1"
]; ];
wayland.windowManager.sway = { wayland.windowManager.sway = {
config = rec { config = rec {
input = { input = {
@ -74,9 +76,11 @@
}; };
}; };
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";
@ -88,12 +92,14 @@
}; };
startup = [ startup = [
{ command = "nextcloud --background"; } { command = "nextcloud --background"; }
{ command = "discord --start-minimized"; } { command = "discord --start-minimized"; }
{ command = "element-desktop --hidden -enable-features=UseOzonePlatform -ozone-platform=wayland --disable-gpu-driver-bug-workarounds"; } { command = "element-desktop --hidden -enable-features=UseOzonePlatform -ozone-platform=wayland --disable-gpu-driver-bug-workarounds"; }
{ command = "ANKI_WAYLAND=1 anki"; } { command = "ANKI_WAYLAND=1 anki"; }
{ command = "OBSIDIAN_USE_WAYLAND=1 obsidian"; } { command = "OBSIDIAN_USE_WAYLAND=1 obsidian"; }
{ command = "nm-applet"; } { command = "nm-applet"; }
]; ];
keycodebindings = { keycodebindings = {

View file

@ -1,12 +1,13 @@
{ lib, pkgs, ... }:
{ {
lib,
pkgs, imports =
... [
}: {
imports = [
./hardware-configuration.nix ./hardware-configuration.nix
]; ];
services = { services = {
getty.autologinUser = "swarsel"; getty.autologinUser = "swarsel";
greetd.settings.initial_session.user = "swarsel"; greetd.settings.initial_session.user = "swarsel";
@ -81,6 +82,7 @@
}; };
}; };
users.users.swarsel = { users.users.swarsel = {
isNormalUser = true; isNormalUser = true;
description = "Leon S"; description = "Leon S";
@ -92,4 +94,5 @@
]; ];
system.stateVersion = "23.05"; system.stateVersion = "23.05";
} }

View file

@ -1,8 +1,8 @@
{ config, pkgs, ... }:
{ {
config,
pkgs,
...
}: {
services.gpg-agent = { services.gpg-agent = {
enable = true; enable = true;
enableSshSupport = true; enableSshSupport = true;
@ -34,6 +34,7 @@
temperature.input-filename = "temp1_input"; temperature.input-filename = "temp1_input";
}; };
programs.waybar.settings.mainBar.modules-right = [ programs.waybar.settings.mainBar.modules-right = [
"custom/outer-left-arrow-dark" "custom/outer-left-arrow-dark"
"mpris" "mpris"
@ -52,6 +53,7 @@
"clock#1" "clock#1"
]; ];
wayland.windowManager.sway = { wayland.windowManager.sway = {
config = rec { config = rec {
# update for actual inputs here, # update for actual inputs here,
@ -72,6 +74,7 @@
natural_scroll = "enabled"; natural_scroll = "enabled";
middle_emulation = "enabled"; middle_emulation = "enabled";
}; };
}; };
output = { output = {
@ -91,16 +94,11 @@
}; };
workspaceOutputAssign = [ workspaceOutputAssign = [
{ { output = "eDP-1"; workspace = "1:"; }
output = "eDP-1"; { output = "HDMI-A-1"; workspace = "2:"; }
workspace = "1:";
}
{
output = "HDMI-A-1";
workspace = "2:";
}
]; ];
# keybindings = let # keybindings = let
# inherit (config.wayland.windowManager.sway.config) modifier; # inherit (config.wayland.windowManager.sway.config) modifier;
# in { # in {
@ -108,12 +106,14 @@
# }; # };
startup = [ startup = [
{ command = "nextcloud --background"; } { command = "nextcloud --background"; }
{ command = "discord --start-minimized"; } { command = "discord --start-minimized"; }
{ command = "element-desktop --hidden -enable-features=UseOzonePlatform -ozone-platform=wayland --disable-gpu-driver-bug-workarounds"; } { command = "element-desktop --hidden -enable-features=UseOzonePlatform -ozone-platform=wayland --disable-gpu-driver-bug-workarounds"; }
{ command = "ANKI_WAYLAND=1 anki"; } { command = "ANKI_WAYLAND=1 anki"; }
{ command = "OBSIDIAN_USE_WAYLAND=1 obsidian"; } { command = "OBSIDIAN_USE_WAYLAND=1 obsidian"; }
{ command = "nm-applet"; } { command = "nm-applet"; }
]; ];
}; };
}; };

View file

@ -1,11 +1,15 @@
{pkgs, ...}: { { pkgs, ... }:
{
# #
# imports = # imports =
# [ # [
# ./hardware-configuration.nix # ./hardware-configuration.nix
# ]; # ];
# #
imports = [ imports =
[
./hardware-configuration.nix ./hardware-configuration.nix
]; ];
@ -95,6 +99,7 @@
}; };
}; };
hardware = { hardware = {
graphics = { graphics = {
enable = true; enable = true;
@ -133,4 +138,6 @@
]; ];
system.stateVersion = "23.05"; system.stateVersion = "23.05";
} }

View file

@ -171,10 +171,10 @@ create a new one."
visual-fill-column-center-text t) visual-fill-column-center-text t)
(visual-fill-column-mode 1)) (visual-fill-column-mode 1))
(defun run-alejandra () (defun swarsel/run-formatting ()
(interactive) (interactive)
(let ((default-directory (expand-file-name "~/.dotfiles"))) (let ((default-directory (expand-file-name "~/.dotfiles")))
(shell-command "alejandra . -q"))) (shell-command "nixpkgs-fmt . > /dev/null")))
(defun swarsel/org-babel-tangle-config () (defun swarsel/org-babel-tangle-config ()
(when (string-equal (buffer-file-name) (when (string-equal (buffer-file-name)
@ -183,7 +183,7 @@ create a new one."
(let ((org-confirm-babel-evaluate nil)) (let ((org-confirm-babel-evaluate nil))
(org-html-export-to-html) (org-html-export-to-html)
(org-babel-tangle) (org-babel-tangle)
(run-alejandra)))) (swarsel/run-formatting))))
(setq org-html-htmlize-output-type nil) (setq org-html-htmlize-output-type nil)

View file

@ -5,11 +5,13 @@
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
}; };
outputs = {nixpkgs, ...}: let outputs = { nixpkgs, ... }:
let
system = "x86_64-linux"; system = "x86_64-linux";
pkgs = nixpkgs.legacyPackages.${system}; pkgs = nixpkgs.legacyPackages.${system};
llvm = pkgs.llvmPackages_latest; llvm = pkgs.llvmPackages_latest;
in { in
{
devShells.${system}.default = pkgs.mkShell { devShells.${system}.default = pkgs.mkShell {
packages = with pkgs; [ packages = with pkgs; [
gcc gcc

View file

@ -5,13 +5,15 @@
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
}; };
outputs = {nixpkgs, ...}: let outputs = { nixpkgs, ... }:
let
system = "x86_64-linux"; system = "x86_64-linux";
pkgs = import nixpkgs { pkgs = import nixpkgs {
system = "x86_64-linux"; system = "x86_64-linux";
config.allowUnfree = true; config.allowUnfree = true;
}; };
in { in
{
devShells.${system}.default = pkgs.mkShell { devShells.${system}.default = pkgs.mkShell {
packages = with pkgs; [ packages = with pkgs; [
# gcc # gcc

View file

@ -4,10 +4,12 @@
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
}; };
outputs = {nixpkgs, ...}: let outputs = { nixpkgs, ... }:
let
system = "x86_64-linux"; system = "x86_64-linux";
pkgs = nixpkgs.legacyPackages.${system}; pkgs = nixpkgs.legacyPackages.${system};
in { in
{
devShells.${system}.default = pkgs.mkShell { devShells.${system}.default = pkgs.mkShell {
packages = with pkgs; [ packages = with pkgs; [
# fill here # fill here

View file

@ -4,10 +4,12 @@
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
}; };
outputs = {nixpkgs, ...}: let outputs = { nixpkgs, ... }:
let
system = "x86_64-linux"; system = "x86_64-linux";
pkgs = nixpkgs.legacyPackages.${system}; pkgs = nixpkgs.legacyPackages.${system};
in { in
{
devShells.${system}.default = pkgs.mkShell { devShells.${system}.default = pkgs.mkShell {
packages = [ packages = [
(pkgs.python3.withPackages (python-pkgs: [ (pkgs.python3.withPackages (python-pkgs: [

View file

@ -5,18 +5,20 @@
rust-overlay.url = "github:oxalica/rust-overlay"; rust-overlay.url = "github:oxalica/rust-overlay";
}; };
outputs = { outputs =
nixpkgs, { nixpkgs
rust-overlay, , rust-overlay
... , ...
}: let }:
let
system = "x86_64-linux"; system = "x86_64-linux";
pkgs = import nixpkgs { pkgs = import nixpkgs {
inherit system; inherit system;
overlays = [ rust-overlay.overlays.default ]; overlays = [ rust-overlay.overlays.default ];
}; };
toolchain = pkgs.rust-bin.fromRustupToolchainFile ./toolchain.toml; toolchain = pkgs.rust-bin.fromRustupToolchainFile ./toolchain.toml;
in { in
{
devShells.${system}.default = pkgs.mkShell { devShells.${system}.default = pkgs.mkShell {
packages = with pkgs; [ packages = with pkgs; [
cargo cargo