feat: Add automatic formatting for .nix files

This commit is contained in:
Swarsel 2024-07-19 00:45:48 +02:00
parent 9dc9a1fe1b
commit 72d321f478
Signed by: swarsel
GPG key ID: 26A54C31F2A4FD84
46 changed files with 3204 additions and 3164 deletions

View file

@ -14,7 +14,9 @@ jobs:
- name: Install Nix
uses: DeterminateSystems/nix-installer-action@v3
- uses: DeterminateSystems/magic-nix-cache-action@main
- name: Check for dead code
- name: Check for dead code in .nix files
run: git ls-files '*.nix' | nix run nixpkgs#deadnix
- name: Check for lints
- name: Check for lints in .nix files
run: nix run nixpkgs#statix -- check
- name: Check formatting in .nix files
run: git ls-files '*.nix' | xargs nix run nixpkgs#alejandra -- --check

View file

@ -5131,6 +5131,11 @@ Programming languages and default lsp's are defined here: [[#h:0e7e8bea-ec58-499
nmap
lsof
# nix
alejandra
deadnix
statix
# local file sharing
wormhole-rs
@ -7524,16 +7529,24 @@ Used in: [[#h:bbcfa895-4d46-4b1d-b84e-f634e982c46e][Centered org-mode Buffers]]
#+end_src
**** org-mode: Auto-tangle and export Configuration Files
**** org-mode: Upon-save actions (Auto-tangle, export to html, formatting)
:PROPERTIES:
:CUSTOM_ID: h:59d4306e-9b73-4b2c-b039-6a6518c357fc
:END:
This section automatically tangles all configuration blocks in this file to the defined Emacs org-file. It also exports the configuration file as html.
This section handles everything that shoudld happen when I save =SwarselSystems.org=. It:
1) automatically tangles all configuration blocks in this file
2) exports the configuration file as html for an easier reading experience with working links and index
3) formats the generated =.nix= files in accordance to the =Alejandra=-style.
We set a hook that runs everytime we save the file. It would be a bit more efficient to only export and format when we enter a magit window for instance (since especially the html export takes times), however, since I cannot be sure to only ever commit from magit (I do indeed sometimes use git from the command line), I prefer this approach.
#+begin_src emacs-lisp
(defun run-alejandra ()
(interactive)
(let ((default-directory (expand-file-name "~/.dotfiles")))
(shell-command "alejandra . -q")))
(defun swarsel/org-babel-tangle-config ()
(when (string-equal (buffer-file-name)
@ -7541,25 +7554,13 @@ This section automatically tangles all configuration blocks in this file to the
;; Dynamic scoping to the rescue
(let ((org-confirm-babel-evaluate nil))
(org-html-export-to-html)
(org-babel-tangle)))
(when (string-equal (buffer-file-name)
swarsel-emacs-org-filepath)
;; Dynamic scoping to the rescue
(let ((org-confirm-babel-evaluate nil))
(org-html-export-to-html)
(org-babel-tangle)))
(when (string-equal (buffer-file-name)
swarsel-nix-org-filepath)
;; Dynamic scoping to the rescue
(let ((org-confirm-babel-evaluate nil))
(org-babel-tangle))))
(org-babel-tangle)
(run-alejandra))))
(setq org-html-htmlize-output-type nil)
(add-hook 'org-mode-hook (lambda () (add-hook 'after-save-hook #'swarsel/org-babel-tangle-config)))
#+end_src
**** org-mode: Fold current heading

View file

@ -2,7 +2,6 @@
description = "SwarseFlake - Nix Flake for all SwarselSystems";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
nixpkgs-stable.url = "github:NixOS/nixpkgs/nixos-24.05";
@ -67,11 +66,9 @@
nswitch-rcm-nix = {
url = "github:Swarsel/nswitch-rcm-nix";
};
};
outputs = inputs @ {
nixpkgs,
nixpkgs-stable,
home-manager,
@ -85,13 +82,13 @@
nixos-hardware,
nix-alien,
nswitch-rcm-nix,
...
}: let
system = "x86_64-linux"; # not very portable, but I do not use other architectures at the moment
pkgs = import nixpkgs { inherit system;
overlays = [ emacs-overlay.overlay
pkgs = import nixpkgs {
inherit system;
overlays = [
emacs-overlay.overlay
nur.overlay
nixgl.overlay
(final: _prev: {
@ -104,12 +101,17 @@
};
# NixOS modules that can only be used on NixOS systems
nixModules = [ stylix.nixosModules.stylix
nixModules = [
stylix.nixosModules.stylix
sops-nix.nixosModules.sops
nswitch-rcm-nix.nixosModules.nswitch-rcm
./profiles/common/nixos.nix
# dynamic library loading
({ self, system, ... }: {
({
self,
system,
...
}: {
environment.systemPackages = with self.inputs.nix-alien.packages.${system}; [
nix-alien
];
@ -119,15 +121,15 @@
];
# 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
mixedModules = [ sops-nix.homeManagerModules.sops
mixedModules = [
sops-nix.homeManagerModules.sops
./profiles/common/home.nix
];
in {
# NixOS setups - run home-manager as a NixOS module for better compatibility
# another benefit - full rebuild on nixos-rebuild switch
# run rebuild using `nswitch`
@ -136,14 +138,17 @@
# Make sure to move hardware-configuration to the appropriate location, by default it is found in /etc/nixos/.
nixosConfigurations = {
onett = nixpkgs.lib.nixosSystem {
specialArgs = {inherit inputs pkgs;};
modules = nixModules ++ [
modules =
nixModules
++ [
./profiles/onett/nixos.nix
home-manager.nixosModules.home-manager
{
home-manager.users.swarsel.imports = mixedModules ++ [
home-manager.users.swarsel.imports =
mixedModules
++ [
./profiles/onett/home.nix
];
}
@ -160,11 +165,15 @@
twoson = nixpkgs.lib.nixosSystem {
specialArgs = {inherit inputs pkgs;};
modules = nixModules ++ [
modules =
nixModules
++ [
./profiles/twoson/nixos.nix
home-manager.nixosModules.home-manager
{
home-manager.users.swarsel.imports = mixedModules ++ [
home-manager.users.swarsel.imports =
mixedModules
++ [
./profiles/twoson/home.nix
];
}
@ -173,12 +182,16 @@
threed = nixpkgs.lib.nixosSystem {
specialArgs = {inherit inputs pkgs;};
modules = nixModules ++ [
modules =
nixModules
++ [
lanzaboote.nixosModules.lanzaboote
./profiles/threed/nixos.nix
home-manager.nixosModules.home-manager
{
home-manager.users.swarsel.imports = mixedModules ++ [
home-manager.users.swarsel.imports =
mixedModules
++ [
./profiles/threed/home.nix
];
}
@ -187,12 +200,16 @@
fourside = nixpkgs.lib.nixosSystem {
specialArgs = {inherit inputs pkgs;};
modules = nixModules ++ [
modules =
nixModules
++ [
nixos-hardware.nixosModules.lenovo-thinkpad-p14s-amd-gen2
./profiles/fourside/nixos.nix
home-manager.nixosModules.home-manager
{
home-manager.users.swarsel.imports = mixedModules ++ [
home-manager.users.swarsel.imports =
mixedModules
++ [
./profiles/fourside/home.nix
];
}
@ -201,12 +218,16 @@
winters = nixpkgs.lib.nixosSystem {
specialArgs = {inherit inputs pkgs;};
modules = nixModules ++ [
modules =
nixModules
++ [
nixos-hardware.nixosModules.framework-16-inch-7040-amd
./profiles/winters/nixos.nix
home-manager.nixosModules.home-manager
{
home-manager.users.swarsel.imports = mixedModules ++ [
home-manager.users.swarsel.imports =
mixedModules
++ [
./profiles/winters/home.nix
];
}
@ -215,11 +236,15 @@
stand = nixpkgs.lib.nixosSystem {
specialArgs = {inherit inputs pkgs;};
modules = nixModules ++ [
modules =
nixModules
++ [
./profiles/stand/nixos.nix
home-manager.nixosModules.home-manager
{
home-manager.users.homelen.imports = mixedModules ++ [
home-manager.users.homelen.imports =
mixedModules
++ [
./profiles/stand/home.nix
];
}
@ -315,29 +340,26 @@
# run rebuild using `hmswitch`
homeConfigurations = {
"leons@PCisLee" = home-manager.lib.homeManagerConfiguration {
inherit pkgs;
modules = homeModules ++ mixedModules ++ [
modules =
homeModules
++ mixedModules
++ [
./profiles/surface/home.nix
];
};
};
nixOnDroidConfigurations = {
default = nix-on-droid.lib.nixOnDroidConfiguration {
modules = [
./profiles/mysticant/configuration.nix
];
};
};
packages.x86_64-linux = {
};
};
}

View file

@ -3,7 +3,7 @@
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
<!-- 2024-07-19 Fr 00:29 -->
<!-- 2024-07-19 Fr 00:52 -->
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>SwarselSystems: NixOS + Emacs Configuration</title>
@ -387,7 +387,7 @@
</div>
</div>
<p>
<b>This file has 40971 words spanning 10908 lines and was last revised on 2024-07-19 00:29:02 +0200.</b>
<b>This file has 41033 words spanning 10909 lines and was last revised on 2024-07-19 00:52:31 +0200.</b>
</p>
<p>
@ -437,7 +437,7 @@ This section defines my Emacs configuration. For a while, I considered to use ry
</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-19 00:29:02 +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-19 00:52:31 +0200)
</p></li>
</ul>
@ -6335,6 +6335,11 @@ Programming languages and default lsp's are defined here: <a href="#h:0e7e8bea-e
nmap
lsof
# nix
alejandra
deadnix
statix
# local file sharing
wormhole-rs
@ -9194,41 +9199,41 @@ Used in: <a href="#h:bbcfa895-4d46-4b1d-b84e-f634e982c46e">Centered org-mode Buf
</div>
</div>
</li>
<li><a id="h:59d4306e-9b73-4b2c-b039-6a6518c357fc"></a>org-mode: Auto-tangle and export Configuration Files<br />
<li><a id="h:59d4306e-9b73-4b2c-b039-6a6518c357fc"></a>org-mode: Upon-save actions (Auto-tangle, export to html, formatting)<br />
<div class="outline-text-5" id="text-h:59d4306e-9b73-4b2c-b039-6a6518c357fc">
<p>
This section automatically tangles all configuration blocks in this file to the defined Emacs org-file. It also exports the configuration file as html.
This section handles everything that shoudld happen when I save <code>SwarselSystems.org</code>. It:
</p>
<ol class="org-ol">
<li>automatically tangles all configuration blocks in this file</li>
<li>exports the configuration file as html for an easier reading experience with working links and index</li>
<li>formats the generated <code>.nix</code> files in accordance to the <code>Alejandra</code>-style.</li>
</ol>
<p>
We set a hook that runs everytime we save the file. It would be a bit more efficient to only export and format when we enter a magit window for instance (since especially the html export takes times), however, since I cannot be sure to only ever commit from magit (I do indeed sometimes use git from the command line), I prefer this approach.
</p>
<div class="org-src-container">
<pre class="src src-emacs-lisp">
<pre class="src src-emacs-lisp">(defun run-alejandra ()
(interactive)
(let ((default-directory (expand-file-name "~/.dotfiles")))
(shell-command "alejandra . -q")))
(defun swarsel/org-babel-tangle-config ()
(when (string-equal (buffer-file-name)
swarsel-swarsel-org-filepath)
;; Dynamic scoping to the rescue
(let ((org-confirm-babel-evaluate nil))
(org-html-export-to-html)
(org-babel-tangle)))
(when (string-equal (buffer-file-name)
swarsel-emacs-org-filepath)
;; Dynamic scoping to the rescue
(let ((org-confirm-babel-evaluate nil))
(org-html-export-to-html)
(org-babel-tangle)))
(when (string-equal (buffer-file-name)
swarsel-nix-org-filepath)
;; Dynamic scoping to the rescue
(let ((org-confirm-babel-evaluate nil))
(org-babel-tangle))))
(org-babel-tangle)
(run-alejandra))))
(setq org-html-htmlize-output-type nil)
(add-hook 'org-mode-hook (lambda () (add-hook 'after-save-hook #'swarsel/org-babel-tangle-config)))
</pre>
</div>
</div>
@ -9336,7 +9341,7 @@ The standard Emacs behaviour for the Python process shell is a bit annoying. Thi
</div>
</div>
</li>
<li><a id="org03da7a6"></a>Nix common prefix bracketer<br />
<li><a id="orgbb564b1"></a>Nix common prefix bracketer<br />
<div class="outline-text-5" id="text-4-2-1-15">
<p>
This function searches for common delimiters in region and removes them, summarizing all captured lines by it.
@ -12907,7 +12912,7 @@ My laptop, sadly soon to be replaced by a new one, since most basic functions ar
</div>
<div id="postamble" class="status">
<p class="author">Author: Leon Schwarzäugl</p>
<p class="date">Created: 2024-07-19 Fr 00:29</p>
<p class="date">Created: 2024-07-19 Fr 00:52</p>
<p class="validation"><a href="https://validator.w3.org/check?uri=referer">Validate</a></p>
</div>
</body>

View file

@ -1,8 +1,8 @@
{ config, pkgs, ... }:
{
config,
pkgs,
...
}: {
services.gpg-agent = {
enable = true;
enableSshSupport = true;
@ -67,7 +67,8 @@
# -----------------------------------------------------------------
# if not always connected to power (laptop), use this (default):
programs.waybar.settings.mainBar.modules-right = ["custom/outer-left-arrow-dark"
programs.waybar.settings.mainBar.modules-right = [
"custom/outer-left-arrow-dark"
"mpris"
"custom/left-arrow-light"
"network"
@ -94,7 +95,8 @@
xkb_layout = "us";
xkb_variant = "altgr-intl";
};
"1:1:AT_Translated_Set_2_keyboard" = { # TEMPLATE
"1:1:AT_Translated_Set_2_keyboard" = {
# TEMPLATE
xkb_layout = "us";
xkb_options = "grp:win_space_toggle";
# xkb_options = "ctrl:nocaps,grp:win_space_toggle";
@ -106,7 +108,6 @@
natural_scroll = "enabled";
middle_emulation = "enabled";
};
};
output = {
@ -126,14 +127,12 @@
};
startup = [
{command = "nextcloud --background";}
{command = "discord --start-minimized";}
{command = "element-desktop --hidden -enable-features=UseOzonePlatform -ozone-platform=wayland --disable-gpu-driver-bug-workarounds";}
{command = "ANKI_WAYLAND=1 anki";}
{command = "OBSIDIAN_USE_WAYLAND=1 obsidian";}
{command = "nm-applet";}
];
};
};

View file

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

View file

@ -1,8 +1,10 @@
{ config, pkgs, fetchFromGitHub , ... }:
{
config,
pkgs,
fetchFromGitHub,
...
}: {
home.packages = with pkgs; [
# audio stuff
spek # spectrum analyzer
losslessaudiochecker
@ -25,6 +27,11 @@
nmap
lsof
# nix
alejandra
deadnix
statix
# local file sharing
wormhole-rs
@ -142,9 +149,17 @@
# latex and related packages
(pkgs.texlive.combine {
inherit (pkgs.texlive) scheme-full
dvisvgm dvipng # for preview and export as html
wrapfig amsmath ulem hyperref capt-of;
inherit
(pkgs.texlive)
scheme-full
dvisvgm
dvipng # for preview and export as html
wrapfig
amsmath
ulem
hyperref
capt-of
;
})
# font stuff
@ -155,7 +170,8 @@
noto-fonts-cjk-sans
# cura
(let cura5 = appimageTools.wrapType2 rec {
(let
cura5 = appimageTools.wrapType2 rec {
name = "cura5";
version = "5.4.0";
src = fetchurl {
@ -163,7 +179,9 @@
hash = "sha256-QVv7Wkfo082PH6n6rpsB79st2xK2+Np9ivBg/PYZd74=";
};
extraPkgs = pkgs: with pkgs; [];
}; in writeScriptBin "cura" ''
};
in
writeScriptBin "cura" ''
#! ${pkgs.bash}/bin/bash
# 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.
@ -298,7 +316,6 @@
cp "$1"{,.bak}
'';
})
];
sops = {
@ -447,7 +464,6 @@ programs.ssh= {
stylix.targets.emacs.enable = false;
xdg.desktopEntries = {
cura = {
name = "Ultimaker Cura";
genericName = "Cura";
@ -488,7 +504,6 @@ xdg.desktopEntries = {
terminal = false;
categories = ["Development" "TextEditor"];
};
};
home.file = {
@ -939,13 +954,11 @@ programs.emacs = {
};
packageRequires = [];
})
];
};
};
programs.waybar = {
enable = true;
# systemd.enable = true;
settings = {
@ -998,7 +1011,6 @@ programs.waybar = {
critical-threshold = 80;
format-critical = " {temperatureC}°C";
format = " {temperatureC}°C";
};
mpris = {
@ -1086,7 +1098,6 @@ programs.waybar = {
format-icons = ["" "" "" "" "" "" "" ""];
# on-click-right= "com.github.stsdc.monitor";
on-click-right = "kitty -o confirm_os_window_close=0 btm";
};
battery = {
states = {
@ -1181,44 +1192,65 @@ programs.firefox = {
search.engines = {
"Nix Packages" = {
urls = [{
urls = [
{
template = "https://search.nixos.org/packages";
params = [
{ name = "type"; value = "packages"; }
{ name = "query"; value = "{searchTerms}"; }
{
name = "type";
value = "packages";
}
{
name = "query";
value = "{searchTerms}";
}
];
}
];
}];
icon = "${pkgs.nixos-icons}/share/icons/hicolor/scalable/apps/nix-snowflake.svg";
definedAliases = ["@np"];
};
"NixOS Wiki" = {
urls = [{
urls = [
{
template = "https://nixos.wiki/index.php?search={searchTerms}";
}];
}
];
iconUpdateURL = "https://nixos.wiki/favicon.png";
updateInterval = 24 * 60 * 60 * 1000; # every day
definedAliases = ["@nw"];
};
"NixOS Options" = {
urls = [{
urls = [
{
template = "https://search.nixos.org/options";
params = [
{ name = "query"; value = "{searchTerms}"; }
{
name = "query";
value = "{searchTerms}";
}
];
}
];
}];
icon = "${pkgs.nixos-icons}/share/icons/hicolor/scalable/apps/nix-snowflake.svg";
definedAliases = ["@no"];
};
"Home Manager Options" = {
urls = [{ template = "https://home-manager-options.extranix.com/";
urls = [
{
template = "https://home-manager-options.extranix.com/";
params = [
{ name = "query"; value = "{searchTerms}"; }
{
name = "query";
value = "{searchTerms}";
}
];
}
];
}];
icon = "${pkgs.nixos-icons}/share/icons/hicolor/scalable/apps/nix-snowflake.svg";
definedAliases = ["@hm" "@ho" "@hmo"];
@ -1465,7 +1497,6 @@ wayland.windowManager.sway = {
# };
# }
{
command = "resize set width 60 ppt height 60 ppt, sticky enable, move container to scratchpad";
criteria = {
class = "Spotify";
@ -1545,5 +1576,4 @@ wayland.windowManager.sway = {
";
};
}

View file

@ -1,6 +1,9 @@
{ config, lib, pkgs, ... }:
{
config,
lib,
pkgs,
...
}: {
home-manager = {
useGlobalPkgs = true;
useUserPackages = true;
@ -235,8 +238,7 @@ networking.networkmanager = {
proxy = {};
vpn = {
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";
cipher = "aes-128-cbc";
compress = "yes";
@ -277,7 +279,6 @@ networking.networkmanager = {
psk = "$HOTSPOT";
};
};
};
};
};
@ -302,7 +303,6 @@ i18n = {
};
sops = {
defaultSopsFile = "${config.users.users.swarsel.home}/.dotfiles/secrets/general/secrets.yaml";
validateSopsFiles = false;
@ -405,9 +405,7 @@ environment.systemPackages = with pkgs; [
tar xvf $src -C $out/
mv $out/oama-0.13.1-Linux-x86_64-static/oama $out/bin/
'';
})
];
programs = {
@ -507,5 +505,4 @@ services.greetd = {
environment.etc."greetd/environments".text = ''
sway
'';
}

View file

@ -1,11 +1,14 @@
# Do not modify this file! It was generated by nixos-generate-config
# and may be overwritten by future invocations. Please make changes
# to /etc/nixos/configuration.nix instead.
{ config, lib, modulesPath, ... }:
{
imports =
[ (modulesPath + "/installer/scan/not-detected.nix")
config,
lib,
modulesPath,
...
}: {
imports = [
(modulesPath + "/installer/scan/not-detected.nix")
];
boot.initrd.availableKernelModules = ["nvme" "xhci_pci" "usb_storage" "sd_mod" "rtsx_pci_sdmmc"];
@ -13,18 +16,18 @@
boot.kernelModules = ["kvm-amd"];
boot.extraModulePackages = [];
fileSystems."/" =
{ device = "/dev/disk/by-uuid/55eee3d2-4125-4aba-a326-10cde2abdf26";
fileSystems."/" = {
device = "/dev/disk/by-uuid/55eee3d2-4125-4aba-a326-10cde2abdf26";
fsType = "ext4";
};
fileSystems."/boot" =
{ device = "/dev/disk/by-uuid/BC7A-F7D9";
fileSystems."/boot" = {
device = "/dev/disk/by-uuid/BC7A-F7D9";
fsType = "vfat";
};
swapDevices =
[ { device = "/dev/disk/by-uuid/0a74b04a-99e0-48cd-afcf-6ca849f6f85a"; }
swapDevices = [
{device = "/dev/disk/by-uuid/0a74b04a-99e0-48cd-afcf-6ca849f6f85a";}
];
# Enables DHCP on each ethernet and wireless interface. In case of scripted networking

View file

@ -1,8 +1,8 @@
{ config, pkgs, ... }:
{
config,
pkgs,
...
}: {
services.gpg-agent = {
enable = true;
enableSshSupport = true;
@ -34,8 +34,8 @@
temperature.input-filename = "temp1_input";
};
programs.waybar.settings.mainBar.modules-right = ["custom/outer-left-arrow-dark"
programs.waybar.settings.mainBar.modules-right = [
"custom/outer-left-arrow-dark"
"mpris"
"custom/left-arrow-light"
"network"
@ -52,7 +52,6 @@
"clock#1"
];
wayland.windowManager.sway = {
config = rec {
# update for actual inputs here,
@ -61,7 +60,8 @@
xkb_layout = "us";
xkb_variant = "altgr-intl";
};
"1:1:AT_Translated_Set_2_keyboard" = { # TEMPLATE
"1:1:AT_Translated_Set_2_keyboard" = {
# TEMPLATE
xkb_layout = "us";
xkb_options = "grp:win_space_toggle";
xkb_variant = "altgr-intl";
@ -72,7 +72,6 @@
natural_scroll = "enabled";
middle_emulation = "enabled";
};
};
output = {
@ -91,11 +90,16 @@
};
workspaceOutputAssign = [
{ output = "eDP-1"; workspace = "1:";}
{ output = "DP-4"; workspace = "2:";}
{
output = "eDP-1";
workspace = "1:";
}
{
output = "DP-4";
workspace = "2:";
}
];
keybindings = let
inherit (config.wayland.windowManager.sway.config) modifier;
in {
@ -115,14 +119,12 @@
};
startup = [
{command = "nextcloud --background";}
{command = "discord --start-minimized";}
{command = "element-desktop --hidden -enable-features=UseOzonePlatform -ozone-platform=wayland --disable-gpu-driver-bug-workarounds";}
{command = "ANKI_WAYLAND=1 anki";}
{command = "OBSIDIAN_USE_WAYLAND=1 obsidian";}
{command = "nm-applet";}
];
};
};

View file

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

View file

@ -1,6 +1,4 @@
{ pkgs, ... }:
{
{pkgs, ...}: {
environment.packages = with pkgs; [
vim
git
@ -18,5 +16,4 @@
nix.extraOptions = ''
experimental-features = nix-command flakes
'';
}

View file

@ -1,14 +1,18 @@
{ modulesPath, ... }:
{
{modulesPath, ...}: {
imports = [(modulesPath + "/profiles/qemu-guest.nix")];
boot.loader.grub = {
efiSupport = true;
efiInstallAsRemovable = true;
device = "nodev";
};
fileSystems."/boot" = { device = "/dev/disk/by-uuid/A1B2-7E6F"; fsType = "vfat"; };
fileSystems."/boot" = {
device = "/dev/disk/by-uuid/A1B2-7E6F";
fsType = "vfat";
};
boot.initrd.availableKernelModules = ["ata_piix" "uhci_hcd" "xen_blkfront" "vmw_pvscsi"];
boot.initrd.kernelModules = ["nvme"];
fileSystems."/" = { device = "/dev/mapper/ocivolume-root"; fsType = "xfs"; };
fileSystems."/" = {
device = "/dev/mapper/ocivolume-root";
fsType = "xfs";
};
}

View file

@ -1,7 +1,11 @@
{ config, pkgs, sops, ... }: let
{
config,
pkgs,
sops,
...
}: let
matrixDomain = "swatrix.swarsel.win";
in {
imports = [
./hardware-configuration.nix
];
@ -78,7 +82,6 @@ in {
recommendedOptimisation = true;
recommendedGzipSettings = true;
virtualHosts = {
"swatrix.swarsel.win" = {
enableACME = true;
forceSSL = true;
@ -164,7 +167,8 @@ in {
public_baseurl = "https://${matrixDomain}";
};
listeners = [
{ port = 8008;
{
port = 8008;
bind_addresses = ["0.0.0.0"];
type = "http";
tls = false;
@ -287,7 +291,6 @@ in {
domain = matrixDomain;
};
appservice = {
address = "http://localhost:29328";
hostname = "0.0.0.0";
port = 29328;
@ -333,5 +336,4 @@ in {
User = "root";
};
};
}

View file

@ -1,8 +1,11 @@
{ config, lib, modulesPath, ... }:
{
imports =
[ (modulesPath + "/profiles/qemu-guest.nix")
config,
lib,
modulesPath,
...
}: {
imports = [
(modulesPath + "/profiles/qemu-guest.nix")
];
boot.initrd.availableKernelModules = ["ata_piix" "uhci_hcd" "virtio_pci" "virtio_scsi" "sd_mod"];
@ -10,18 +13,18 @@
boot.kernelModules = ["kvm-amd"];
boot.extraModulePackages = [];
fileSystems."/" =
{ device = "/dev/disk/by-uuid/4b47378a-02eb-4548-bab8-59cbf379252a";
fileSystems."/" = {
device = "/dev/disk/by-uuid/4b47378a-02eb-4548-bab8-59cbf379252a";
fsType = "xfs";
};
fileSystems."/boot" =
{ device = "/dev/disk/by-uuid/2B75-2AD5";
fileSystems."/boot" = {
device = "/dev/disk/by-uuid/2B75-2AD5";
fsType = "vfat";
};
swapDevices =
[ { device = "/dev/disk/by-uuid/f0126a93-753e-4769-ada8-7499a1efb3a9"; }
swapDevices = [
{device = "/dev/disk/by-uuid/f0126a93-753e-4769-ada8-7499a1efb3a9";}
];
# Enables DHCP on each ethernet and wireless interface. In case of scripted networking

View file

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

View file

@ -1,11 +1,14 @@
# Do not modify this file! It was generated by nixos-generate-config
# and may be overwritten by future invocations. Please make changes
# to /etc/nixos/configuration.nix instead.
{ config, lib, modulesPath, ... }:
{
imports =
[ (modulesPath + "/installer/scan/not-detected.nix")
config,
lib,
modulesPath,
...
}: {
imports = [
(modulesPath + "/installer/scan/not-detected.nix")
];
boot.initrd.availableKernelModules = ["xhci_pci" "ehci_pci" "ata_piix" "usb_storage" "sd_mod" "sr_mod"];
@ -13,8 +16,8 @@
boot.kernelModules = ["kvm-intel"];
boot.extraModulePackages = [];
fileSystems."/" =
{ device = "/dev/disk/by-uuid/147e3682-eb15-4e96-9cac-4f2fb5888a69";
fileSystems."/" = {
device = "/dev/disk/by-uuid/147e3682-eb15-4e96-9cac-4f2fb5888a69";
fsType = "ext4";
};

View file

@ -1,7 +1,11 @@
{ config, pkgs, sops, ... }: let
{
config,
pkgs,
sops,
...
}: let
matrixDomain = "swatrix.swarsel.win";
in {
imports = [
./hardware-configuration.nix
];
@ -133,24 +137,24 @@ in {
zfs
];
etc = {
"openvpn/iptables.sh" =
{ source = ../../scripts/server1/iptables.sh;
"openvpn/iptables.sh" = {
source = ../../scripts/server1/iptables.sh;
mode = "0755";
};
"openvpn/update-resolv-conf" =
{ source = ../../scripts/server1/update-resolv-conf;
"openvpn/update-resolv-conf" = {
source = ../../scripts/server1/update-resolv-conf;
mode = "0755";
};
"openvpn/routing.sh" =
{ source = ../../scripts/server1/routing.sh;
"openvpn/routing.sh" = {
source = ../../scripts/server1/routing.sh;
mode = "0755";
};
"openvpn/ca.rsa.2048.crt" =
{ source = ../../secrets/certs/ca.rsa.2048.crt;
"openvpn/ca.rsa.2048.crt" = {
source = ../../secrets/certs/ca.rsa.2048.crt;
mode = "0644";
};
"openvpn/crl.rsa.2048.pem" =
{ source = ../../secrets/certs/crl.rsa.2048.pem;
"openvpn/crl.rsa.2048.pem" = {
source = ../../secrets/certs/crl.rsa.2048.pem;
mode = "0644";
};
};
@ -265,10 +269,12 @@ in {
openssh = {
enable = true;
settings.PermitRootLogin = "yes";
listenAddresses = [{
listenAddresses = [
{
port = 22;
addr = "0.0.0.0";
}];
}
];
};
nginx = {
@ -278,7 +284,6 @@ in {
recommendedOptimisation = true;
recommendedGzipSettings = true;
virtualHosts = {
"stash.swarsel.win" = {
enableACME = true;
forceSSL = true;
@ -313,7 +318,6 @@ in {
};
};
"sound.swarsel.win" = {
enableACME = true;
forceSSL = true;
@ -508,9 +512,6 @@ in {
# MAUTRIX_TELEGRAM_TELEGRAM_API_HASH=${config.sops.placeholder.mautrixtelegram_api_hash}
# '';
# ----------------
# sops.secrets.mautrixwhatsapp_shared = {owner="matrix-synapse";};
# sops.templates.mautrixwhatsapp.owner = "matrix-synapse";
@ -557,7 +558,8 @@ in {
config.sops.templates.matrixshared.path
];
settings.listeners = [
{ port = 8008;
{
port = 8008;
bind_addresses = ["0.0.0.0"];
type = "http";
tls = false;
@ -676,7 +678,6 @@ in {
domain = matrixDomain;
};
appservice = {
address = "http://localhost:29328";
hostname = "0.0.0.0";
port = 29328;
@ -740,7 +741,6 @@ in {
];
};
spotifyd = {
enable = true;
settings = {
@ -789,7 +789,6 @@ in {
};
};
avahi = {
publish.enable = true;
publish.userServices = true;

View file

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

View file

@ -1,9 +1,7 @@
# Do not modify this file! It was generated by nixos-generate-config
# and may be overwritten by future invocations. Please make changes
# to /etc/nixos/configuration.nix instead.
{ lib, ... }:
{
{lib, ...}: {
imports = [];
boot.initrd.availableKernelModules = ["ahci" "xhci_pci" "vfio_pci" "usbhid"];
@ -11,8 +9,8 @@
boot.kernelModules = ["kvm-intel"];
boot.extraModulePackages = [];
fileSystems."/" =
{ device = "/dev/mapper/pve-vm--120--disk--0";
fileSystems."/" = {
device = "/dev/mapper/pve-vm--120--disk--0";
fsType = "ext4";
};

View file

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

View file

@ -1,9 +1,7 @@
# Do not modify this file! It was generated by nixos-generate-config
# and may be overwritten by future invocations. Please make changes
# to /etc/nixos/configuration.nix instead.
{ lib, ... }:
{
{lib, ...}: {
imports = [];
boot.initrd.availableKernelModules = ["ahci" "xhci_pci" "vfio_pci" "usbhid"];
@ -11,13 +9,13 @@
boot.kernelModules = ["kvm-intel"];
boot.extraModulePackages = [];
fileSystems."/" =
{ device = "/dev/mapper/pve-vm--121--disk--0";
fileSystems."/" = {
device = "/dev/mapper/pve-vm--121--disk--0";
fsType = "ext4";
};
fileSystems."/media/Videos" =
{ device = "//192.168.1.3/Eternor";
fileSystems."/media/Videos" = {
device = "//192.168.1.3/Eternor";
fsType = "cifs";
};

View file

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

View file

@ -1,9 +1,7 @@
# Do not modify this file! It was generated by nixos-generate-config
# and may be overwritten by future invocations. Please make changes
# to /etc/nixos/configuration.nix instead.
{ lib, ... }:
{
{lib, ...}: {
imports = [];
boot.initrd.availableKernelModules = ["ahci" "xhci_pci" "vfio_pci" "usbhid"];
@ -11,8 +9,8 @@
boot.kernelModules = ["kvm-intel"];
boot.extraModulePackages = [];
fileSystems."/" =
{ device = "/dev/mapper/pve-vm--102--disk--0";
fileSystems."/" = {
device = "/dev/mapper/pve-vm--102--disk--0";
fsType = "ext4";
};

View file

@ -1,8 +1,12 @@
{ config, pkgs, modulesPath, sops, ... }: let
{
config,
pkgs,
modulesPath,
sops,
...
}: let
matrixDomain = "matrix2.swarsel.win";
in {
services = {
xserver = {
layout = "us";
@ -11,10 +15,12 @@ in {
openssh = {
enable = true;
settings.PermitRootLogin = "yes";
listenAddresses = [{
listenAddresses = [
{
port = 22;
addr = "0.0.0.0";
}];
}
];
};
};
@ -40,7 +46,6 @@ in {
nswitch = "cd /.dotfiles; git pull; nixos-rebuild --flake .#$(hostname) switch; cd -;";
};
imports = [
(modulesPath + "/virtualisation/proxmox-lxc.nix")
./hardware-configuration.nix
@ -132,7 +137,8 @@ in {
server_name = matrixDomain;
public_baseurl = "https://${matrixDomain}";
listeners = [
{ port = 8008;
{
port = 8008;
bind_addresses = ["0.0.0.0"];
type = "http";
tls = false;
@ -255,7 +261,6 @@ in {
domain = matrixDomain;
};
appservice = {
address = "http://localhost:29328";
hostname = "0.0.0.0";
port = 29328;
@ -301,5 +306,4 @@ in {
User = "root";
};
};
}

View file

@ -1,9 +1,7 @@
# Do not modify this file! It was generated by nixos-generate-config
# and may be overwritten by future invocations. Please make changes
# to /etc/nixos/configuration.nix instead.
{ lib, ... }:
{
{lib, ...}: {
imports = [];
boot.initrd.availableKernelModules = ["ahci" "xhci_pci" "vfio_pci" "usbhid"];
@ -11,8 +9,8 @@
boot.kernelModules = ["kvm-intel"];
boot.extraModulePackages = [];
fileSystems."/" =
{ device = "/dev/mapper/pve-vm--119--disk--0";
fileSystems."/" = {
device = "/dev/mapper/pve-vm--119--disk--0";
fsType = "ext4";
};

View file

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

View file

@ -1,9 +1,7 @@
# Do not modify this file! It was generated by nixos-generate-config
# and may be overwritten by future invocations. Please make changes
# to /etc/nixos/configuration.nix instead.
{ lib, ... }:
{
{lib, ...}: {
imports = [];
boot.initrd.availableKernelModules = ["ahci" "xhci_pci" "vfio_pci" "usbhid"];
@ -11,8 +9,8 @@
boot.kernelModules = ["kvm-intel"];
boot.extraModulePackages = [];
fileSystems."/" =
{ device = "/dev/mapper/pve-vm--117--disk--0";
fileSystems."/" = {
device = "/dev/mapper/pve-vm--117--disk--0";
fsType = "ext4";
};

View file

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

View file

@ -1,9 +1,7 @@
# Do not modify this file! It was generated by nixos-generate-config
# and may be overwritten by future invocations. Please make changes
# to /etc/nixos/configuration.nix instead.
{ lib, ... }:
{
{lib, ...}: {
imports = [];
boot.initrd.availableKernelModules = ["ahci" "xhci_pci" "vfio_pci" "usbhid"];
@ -11,14 +9,14 @@
boot.kernelModules = ["kvm-intel"];
boot.extraModulePackages = [];
fileSystems."/" =
{ device = "/mnt/data/images/118/vm-118-disk-0.raw";
fileSystems."/" = {
device = "/mnt/data/images/118/vm-118-disk-0.raw";
fsType = "ext4";
options = ["loop"];
};
fileSystems."/media" =
{ device = "//192.168.1.3/Eternor";
fileSystems."/media" = {
device = "//192.168.1.3/Eternor";
fsType = "cifs";
};

View file

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

View file

@ -1,9 +1,7 @@
# Do not modify this file! It was generated by nixos-generate-config
# and may be overwritten by future invocations. Please make changes
# to /etc/nixos/configuration.nix instead.
{ lib, ... }:
{
{lib, ...}: {
imports = [];
boot.initrd.availableKernelModules = ["ahci" "xhci_pci" "vfio_pci" "usbhid"];
@ -11,8 +9,8 @@
boot.kernelModules = ["kvm-intel"];
boot.extraModulePackages = [];
fileSystems."/" =
{ device = "/dev/mapper/pve-vm--123--disk--0";
fileSystems."/" = {
device = "/dev/mapper/pve-vm--123--disk--0";
fsType = "ext4";
};

View file

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

View file

@ -1,9 +1,7 @@
# Do not modify this file! It was generated by nixos-generate-config
# and may be overwritten by future invocations. Please make changes
# to /etc/nixos/configuration.nix instead.
{ lib, ... }:
{
{lib, ...}: {
imports = [];
boot.initrd.availableKernelModules = ["ahci" "xhci_pci" "vfio_pci" "usbhid"];
@ -11,8 +9,8 @@
boot.kernelModules = ["kvm-intel"];
boot.extraModulePackages = [];
fileSystems."/" =
{ device = "/dev/mapper/pve-vm--122--disk--0";
fileSystems."/" = {
device = "/dev/mapper/pve-vm--122--disk--0";
fsType = "ext4";
};

View file

@ -1,6 +1,9 @@
{ config, pkgs, modulesPath, ... }:
{
config,
pkgs,
modulesPath,
...
}: {
imports = [
(modulesPath + "/virtualisation/proxmox-lxc.nix")
./hardware-configuration.nix
@ -87,34 +90,36 @@
'';
};
environment.etc = {
"openvpn/iptables.sh" =
{ source = ../../../scripts/server1/iptables.sh;
"openvpn/iptables.sh" = {
source = ../../../scripts/server1/iptables.sh;
mode = "0755";
};
"openvpn/update-resolv-conf" =
{ source = ../../../scripts/server1/update-resolv-conf;
"openvpn/update-resolv-conf" = {
source = ../../../scripts/server1/update-resolv-conf;
mode = "0755";
};
"openvpn/routing.sh" =
{ source = ../../../scripts/server1/routing.sh;
"openvpn/routing.sh" = {
source = ../../../scripts/server1/routing.sh;
mode = "0755";
};
"openvpn/ca.rsa.2048.crt" =
{ source = ../../../secrets/certs/ca.rsa.2048.crt;
"openvpn/ca.rsa.2048.crt" = {
source = ../../../secrets/certs/ca.rsa.2048.crt;
mode = "0644";
};
"openvpn/crl.rsa.2048.pem" =
{ source = ../../../secrets/certs/crl.rsa.2048.pem;
"openvpn/crl.rsa.2048.pem" = {
source = ../../../secrets/certs/crl.rsa.2048.pem;
mode = "0644";
};
};
services.openssh = {
enable = true;
settings.PermitRootLogin = "yes";
listenAddresses = [{
listenAddresses = [
{
port = 22;
addr = "0.0.0.0";
}];
}
];
};
users.users.root.openssh.authorizedKeys.keyFiles = [
../../../secrets/keys/authorized_keys
@ -194,7 +199,6 @@
user = "vpn";
group = "lxc_shares";
settings = {
alt-speed-down = 8000;
alt-speed-enabled = false;
alt-speed-time-begin = 0;
@ -265,6 +269,4 @@
utp-enabled = false;
};
};
}

View file

@ -1,11 +1,14 @@
# Do not modify this file! It was generated by nixos-generate-config
# and may be overwritten by future invocations. Please make changes
# to /etc/nixos/configuration.nix instead.
{ config, lib, modulesPath, ... }:
{
imports =
[ (modulesPath + "/installer/scan/not-detected.nix")
config,
lib,
modulesPath,
...
}: {
imports = [
(modulesPath + "/installer/scan/not-detected.nix")
];
boot.initrd.availableKernelModules = ["xhci_pci" "ahci" "usb_storage" "sd_mod"];
@ -13,18 +16,18 @@
boot.kernelModules = ["kvm-intel"];
boot.extraModulePackages = [];
fileSystems."/" =
{ device = "/dev/disk/by-uuid/4a590cad-28d9-4153-bdb8-e424ec3bd5c8";
fileSystems."/" = {
device = "/dev/disk/by-uuid/4a590cad-28d9-4153-bdb8-e424ec3bd5c8";
fsType = "ext4";
};
fileSystems."/boot" =
{ device = "/dev/disk/by-uuid/C67D-61AD";
fileSystems."/boot" = {
device = "/dev/disk/by-uuid/C67D-61AD";
fsType = "vfat";
};
swapDevices =
[ { device = "/dev/disk/by-uuid/b07aac27-a443-489c-9fdb-01c1ef633699"; }
swapDevices = [
{device = "/dev/disk/by-uuid/b07aac27-a443-489c-9fdb-01c1ef633699";}
];
# Enables DHCP on each ethernet and wireless interface. In case of scripted networking

View file

@ -1,8 +1,8 @@
{ config, pkgs, ... }:
{
config,
pkgs,
...
}: {
services.gpg-agent = {
enable = true;
enableSshSupport = true;
@ -16,7 +16,6 @@
'';
};
home = {
username = "swarsel";
homeDirectory = "/home/swarsel";
@ -33,7 +32,8 @@
temperature.hwmon-path = "/sys/devices/platform/coretemp.0/hwmon/hwmon1/temp3_input";
};
programs.waybar.settings.mainBar.modules-right = ["custom/outer-left-arrow-dark"
programs.waybar.settings.mainBar.modules-right = [
"custom/outer-left-arrow-dark"
"mpris"
"custom/left-arrow-light"
"network"
@ -50,7 +50,6 @@
"clock#1"
];
wayland.windowManager.sway = {
config = rec {
input = {
@ -89,14 +88,12 @@
};
startup = [
{command = "nextcloud --background";}
{command = "discord --start-minimized";}
{command = "element-desktop --hidden -enable-features=UseOzonePlatform -ozone-platform=wayland --disable-gpu-driver-bug-workarounds";}
{command = "ANKI_WAYLAND=1 anki";}
{command = "OBSIDIAN_USE_WAYLAND=1 obsidian";}
{command = "nm-applet";}
];
keycodebindings = {

View file

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

View file

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

View file

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

View file

@ -171,24 +171,19 @@ create a new one."
visual-fill-column-center-text t)
(visual-fill-column-mode 1))
(defun run-alejandra ()
(interactive)
(let ((default-directory (expand-file-name "~/.dotfiles")))
(shell-command "alejandra . -q")))
(defun swarsel/org-babel-tangle-config ()
(when (string-equal (buffer-file-name)
swarsel-swarsel-org-filepath)
;; Dynamic scoping to the rescue
(let ((org-confirm-babel-evaluate nil))
(org-html-export-to-html)
(org-babel-tangle)))
(when (string-equal (buffer-file-name)
swarsel-emacs-org-filepath)
;; Dynamic scoping to the rescue
(let ((org-confirm-babel-evaluate nil))
(org-html-export-to-html)
(org-babel-tangle)))
(when (string-equal (buffer-file-name)
swarsel-nix-org-filepath)
;; Dynamic scoping to the rescue
(let ((org-confirm-babel-evaluate nil))
(org-babel-tangle))))
(org-babel-tangle)
(run-alejandra))))
(setq org-html-htmlize-output-type nil)

View file

@ -11,7 +11,6 @@
llvm = pkgs.llvmPackages_latest;
in {
devShells.${system}.default = pkgs.mkShell {
packages = with pkgs; [
gcc
#builder
@ -32,7 +31,6 @@
PATH_add ~/.dotfiles/scripts/devShell
'';
# ...
};
};
}

View file

@ -7,10 +7,12 @@
outputs = {nixpkgs, ...}: let
system = "x86_64-linux";
pkgs = import nixpkgs { system = "x86_64-linux"; config.allowUnfree = true; };
pkgs = import nixpkgs {
system = "x86_64-linux";
config.allowUnfree = true;
};
in {
devShells.${system}.default = pkgs.mkShell {
packages = with pkgs; [
# gcc
#builder
@ -39,7 +41,6 @@
];
hardeningDisable = ["all"];
# ...
};
};
}

View file

@ -9,7 +9,6 @@
pkgs = nixpkgs.legacyPackages.${system};
in {
devShells.${system}.default = pkgs.mkShell {
packages = with pkgs; [
# fill here
];

View file

@ -9,7 +9,6 @@
pkgs = nixpkgs.legacyPackages.${system};
in {
devShells.${system}.default = pkgs.mkShell {
packages = [
(pkgs.python3.withPackages (python-pkgs: [
python-pkgs.numpy

View file

@ -5,7 +5,11 @@
rust-overlay.url = "github:oxalica/rust-overlay";
};
outputs = { nixpkgs, rust-overlay, ...}: let
outputs = {
nixpkgs,
rust-overlay,
...
}: let
system = "x86_64-linux";
pkgs = import nixpkgs {
inherit system;
@ -14,7 +18,6 @@
toolchain = pkgs.rust-bin.fromRustupToolchainFile ./toolchain.toml;
in {
devShells.${system}.default = pkgs.mkShell {
packages = with pkgs; [
cargo
clippy
@ -30,7 +33,6 @@
RUST_SRC_PATH = "${toolchain}/lib/rustlib/src/rust/library";
# ...
};
};
}