switch to nixpkgs-fmt

This commit is contained in:
Tim Schubert 2022-08-04 21:13:54 +02:00
parent 8cd6ed1502
commit c43341a8b2
Signed by: dadada
GPG key ID: EEB8D1CE62C4DFEA
69 changed files with 664 additions and 665 deletions

View file

@ -30,5 +30,5 @@
}; };
}; };
outputs = {...} @ args: import ./outputs.nix args; outputs = { ... } @ args: import ./outputs.nix args;
} }

View file

@ -1,29 +1,32 @@
{ { self
self, , nixpkgs
nixpkgs, , home-manager
home-manager, ,
} @ inputs: let } @ inputs:
hmConfiguration = { let
homeDirectory ? "/home/dadada", hmConfiguration =
extraModules ? [], { homeDirectory ? "/home/dadada"
system ? "x86_64-linux", , extraModules ? [ ]
username ? "dadada", , system ? "x86_64-linux"
stateVersion, , username ? "dadada"
}: (home-manager.lib.homeManagerConfiguration { , stateVersion
configuration = {...}: { ,
imports = (nixpkgs.lib.attrValues self.hmModules) ++ extraModules; }: (home-manager.lib.homeManagerConfiguration {
nixpkgs = { configuration = { ... }: {
config = import ./nixpkgs-config.nix { imports = (nixpkgs.lib.attrValues self.hmModules) ++ extraModules;
pkgs = nixpkgs; nixpkgs = {
config = import ./nixpkgs-config.nix {
pkgs = nixpkgs;
};
}; };
manual.manpages.enable = false;
}; };
manual.manpages.enable = false; inherit system homeDirectory username stateVersion;
}; });
inherit system homeDirectory username stateVersion; in
}); {
in {
home = hmConfiguration { home = hmConfiguration {
extraModules = [./home]; extraModules = [ ./home ];
stateVersion = "20.09"; stateVersion = "20.09";
}; };
} }

View file

@ -1,9 +1,9 @@
{ { config
config, , pkgs
pkgs, , lib
lib, , ...
... }:
}: let let
useFeatures = [ useFeatures = [
"alacritty" "alacritty"
#"emacs" #"emacs"
@ -18,7 +18,8 @@
"xdg" "xdg"
"zsh" "zsh"
]; ];
in { in
{
programs.git = { programs.git = {
signing = { signing = {
key = "D68C84695C087E0F733A28D0EEB8D1CE62C4DFEA"; key = "D68C84695C087E0F733A28D0EEB8D1CE62C4DFEA";
@ -31,7 +32,7 @@ in {
programs.gpg.settings.default-key = "99658A3EB5CD7C13"; programs.gpg.settings.default-key = "99658A3EB5CD7C13";
dadada.home = dadada.home =
lib.attrsets.genAttrs useFeatures (useFeatures: {enable = true;}) lib.attrsets.genAttrs useFeatures (useFeatures: { enable = true; })
// { // {
session = { session = {
enable = true; enable = true;
@ -49,8 +50,8 @@ in {
systemd.user.services."languagetool-http-server" = { systemd.user.services."languagetool-http-server" = {
Unit = { Unit = {
Description = "Languagetool HTTP server"; Description = "Languagetool HTTP server";
PartOf = ["graphical-session-pre.target"]; PartOf = [ "graphical-session-pre.target" ];
After = ["graphical-session.target"]; After = [ "graphical-session.target" ];
}; };
Service = { Service = {
@ -59,11 +60,11 @@ in {
Restart = "always"; Restart = "always";
}; };
Install = {WantedBy = ["graphical-session.target"];}; Install = { WantedBy = [ "graphical-session.target" ]; };
}; };
# Let Home Manager install and manage itself. # Let Home Manager install and manage itself.
programs.home-manager.enable = true; programs.home-manager.enable = true;
home.packages = import ./pkgs.nix {pkgs = pkgs;}; home.packages = import ./pkgs.nix { pkgs = pkgs; };
} }

View file

@ -1,4 +1,4 @@
{pkgs}: { pkgs }:
with pkgs; [ with pkgs; [
anki anki
aqbanking aqbanking

View file

@ -1,12 +1,12 @@
{ { pkgs
pkgs, , lib
lib, , config
config, , ...
...
}: }:
with lib; let with lib; let
cfg = config.dadada.home.alacritty; cfg = config.dadada.home.alacritty;
in { in
{
options.dadada.home.alacritty = { options.dadada.home.alacritty = {
enable = mkEnableOption "Enable alacritty config"; enable = mkEnableOption "Enable alacritty config";
}; };

View file

@ -1,7 +1,6 @@
{ { config
config, , lib
lib, , ...
...
}: }:
with lib; { with lib; {
options.dadada.home.colors = mkOption { options.dadada.home.colors = mkOption {

View file

@ -1,12 +1,11 @@
{ { self
self, , nix-doom-emacs
nix-doom-emacs, , ...
...
} @ inputs: { } @ inputs: {
alacritty = import ./alacritty; alacritty = import ./alacritty;
colors = import ./colors.nix; colors = import ./colors.nix;
direnv = import ./direnv.nix; direnv = import ./direnv.nix;
emacs = import ./emacs {inherit nix-doom-emacs;}; emacs = import ./emacs { inherit nix-doom-emacs; };
fish = import ./fish.nix; fish = import ./fish.nix;
git = import ./git.nix; git = import ./git.nix;
gpg = import ./gpg.nix; gpg = import ./gpg.nix;

View file

@ -1,12 +1,12 @@
{ { config
config, , pkgs
pkgs, , lib
lib, , ...
...
}: }:
with lib; let with lib; let
cfg = config.dadada.home.direnv; cfg = config.dadada.home.direnv;
in { in
{
options.dadada.home.direnv = { options.dadada.home.direnv = {
enable = mkEnableOption "Enable direnv config"; enable = mkEnableOption "Enable direnv config";
}; };

View file

@ -1,13 +1,13 @@
{nix-doom-emacs, ...}: { { nix-doom-emacs, ... }: { config
config, , pkgs
pkgs, , lib
lib, , ...
... }:
}:
with lib; let with lib; let
cfg = config.dadada.home.emacs; cfg = config.dadada.home.emacs;
in { in
imports = [nix-doom-emacs.hmModule]; {
imports = [ nix-doom-emacs.hmModule ];
options.dadada.home.emacs = { options.dadada.home.emacs = {
enable = mkEnableOption "Enable dadada emacs config"; enable = mkEnableOption "Enable dadada emacs config";
}; };
@ -17,40 +17,42 @@ in {
doomPrivateDir = ./doom.d; doomPrivateDir = ./doom.d;
emacsPackagesOverlay = self: super: emacsPackagesOverlay = self: super:
with pkgs; { with pkgs; {
tsc = super.tsc.overrideAttrs (old: let tsc = super.tsc.overrideAttrs (old:
libtsc_dyn = rustPlatform.buildRustPackage rec { let
pname = "emacs-tree-sitter"; libtsc_dyn = rustPlatform.buildRustPackage rec {
version = "0.15.1"; pname = "emacs-tree-sitter";
src = fetchFromGitHub { version = "0.15.1";
owner = "ubolonton"; src = fetchFromGitHub {
repo = "emacs-tree-sitter"; owner = "ubolonton";
rev = version; repo = "emacs-tree-sitter";
sha256 = "sha256-WgkGtmw63+kRLTRiSEO4bFF2IguH5g4odCujyazkwJc="; rev = version;
sha256 = "sha256-WgkGtmw63+kRLTRiSEO4bFF2IguH5g4odCujyazkwJc=";
};
preBuild = ''
export BINDGEN_EXTRA_CLANG_ARGS="$(< ${stdenv.cc}/nix-support/libc-crt1-cflags) \
$(< ${stdenv.cc}/nix-support/libc-cflags) \
$(< ${stdenv.cc}/nix-support/cc-cflags) \
$(< ${stdenv.cc}/nix-support/libcxx-cxxflags) \
${lib.optionalString stdenv.cc.isClang "-idirafter ${stdenv.cc.cc}/lib/clang/${lib.getVersion stdenv.cc.cc}/include"} \
${lib.optionalString stdenv.cc.isGNU
"-isystem ${stdenv.cc.cc}/lib/gcc/${stdenv.hostPlatform.config}/${lib.getVersion stdenv.cc.cc}/include/"} \
${lib.optionalString stdenv.cc.isGNU
"-isystem ${stdenv.cc.cc}/include/c++/${lib.getVersion stdenv.cc.cc} -isystem ${stdenv.cc.cc}/include/c++/${lib.getVersion stdenv.cc.cc}/${stdenv.hostPlatform.config}"} \
$NIX_CFLAGS_COMPILE"
'';
LIBCLANG_PATH = "${llvmPackages.libclang.lib}/lib";
cargoHash = "sha256-HB5tFR1slY2D6jb2mt4KrGrGBUUVrxiBjmVycO+qfYY=";
}; };
in
{
inherit (libtsc_dyn) src;
preBuild = '' preBuild = ''
export BINDGEN_EXTRA_CLANG_ARGS="$(< ${stdenv.cc}/nix-support/libc-crt1-cflags) \ ext=${stdenv.hostPlatform.extensions.sharedLibrary}
$(< ${stdenv.cc}/nix-support/libc-cflags) \ dest=$out/share/emacs/site-lisp/elpa/tsc-${old.version}
$(< ${stdenv.cc}/nix-support/cc-cflags) \ install -D ${libtsc_dyn}/lib/libtsc_dyn$ext $dest/tsc-dyn$ext
$(< ${stdenv.cc}/nix-support/libcxx-cxxflags) \ echo -n "0.15.1" > $dest/DYN-VERSION
${lib.optionalString stdenv.cc.isClang "-idirafter ${stdenv.cc.cc}/lib/clang/${lib.getVersion stdenv.cc.cc}/include"} \
${lib.optionalString stdenv.cc.isGNU
"-isystem ${stdenv.cc.cc}/lib/gcc/${stdenv.hostPlatform.config}/${lib.getVersion stdenv.cc.cc}/include/"} \
${lib.optionalString stdenv.cc.isGNU
"-isystem ${stdenv.cc.cc}/include/c++/${lib.getVersion stdenv.cc.cc} -isystem ${stdenv.cc.cc}/include/c++/${lib.getVersion stdenv.cc.cc}/${stdenv.hostPlatform.config}"} \
$NIX_CFLAGS_COMPILE"
''; '';
LIBCLANG_PATH = "${llvmPackages.libclang.lib}/lib"; });
cargoHash = "sha256-HB5tFR1slY2D6jb2mt4KrGrGBUUVrxiBjmVycO+qfYY=";
};
in {
inherit (libtsc_dyn) src;
preBuild = ''
ext=${stdenv.hostPlatform.extensions.sharedLibrary}
dest=$out/share/emacs/site-lisp/elpa/tsc-${old.version}
install -D ${libtsc_dyn}/lib/libtsc_dyn$ext $dest/tsc-dyn$ext
echo -n "0.15.1" > $dest/DYN-VERSION
'';
});
tree-sitter-langs = super.tree-sitter-langs.overrideAttrs (old: { tree-sitter-langs = super.tree-sitter-langs.overrideAttrs (old: {
postInstall = '' postInstall = ''
dest=$out/share/emacs/site-lisp/elpa/tree-sitter-langs-${old.version} dest=$out/share/emacs/site-lisp/elpa/tree-sitter-langs-${old.version}
@ -61,7 +63,7 @@ in {
}); });
}; };
}; };
home.file.".tree-sitter".source = pkgs.runCommand "grammars" {} '' home.file.".tree-sitter".source = pkgs.runCommand "grammars" { } ''
mkdir -p $out/bin mkdir -p $out/bin
echo -n "0.10.2" > $out/BUNDLE-VERSION echo -n "0.10.2" > $out/BUNDLE-VERSION
${lib.concatStringsSep "\n" ${lib.concatStringsSep "\n"

View file

@ -1,12 +1,12 @@
{ { config
config, , pkgs
pkgs, , lib
lib, , ...
...
}: }:
with lib; let with lib; let
cfg = config.dadada.home.fish; cfg = config.dadada.home.fish;
in { in
{
options.dadada.home.fish = { options.dadada.home.fish = {
enable = mkEnableOption "Enable fish config"; enable = mkEnableOption "Enable fish config";
}; };
@ -80,6 +80,6 @@ in {
}; };
}; };
home.packages = [pkgs.exa]; home.packages = [ pkgs.exa ];
}; };
} }

View file

@ -1,12 +1,12 @@
{ { config
config, , lib
lib, , pkgs
pkgs, , ...
...
}: }:
with lib; let with lib; let
cfg = config.dadada.home.git; cfg = config.dadada.home.git;
in { in
{
options.dadada.home.git = { options.dadada.home.git = {
enable = mkEnableOption "Enable git config"; enable = mkEnableOption "Enable git config";
}; };
@ -19,7 +19,7 @@ in {
tab-in-indent = true; tab-in-indent = true;
tabwidth = 4; tabwidth = 4;
}; };
alias = {}; alias = { };
pager = "delta"; pager = "delta";
}; };
column.ui = "never"; column.ui = "never";

View file

@ -1,11 +1,11 @@
{ { config
config, , lib
lib, , ...
...
}: }:
with lib; let with lib; let
cfg = config.dadada.home.gpg; cfg = config.dadada.home.gpg;
in { in
{
options.dadada.home.gpg = { options.dadada.home.gpg = {
enable = mkEnableOption "Enable GnuPG config"; enable = mkEnableOption "Enable GnuPG config";
}; };
@ -31,7 +31,7 @@ in {
}; };
programs.git.extraConfig = { programs.git.extraConfig = {
commit = {gpgSign = true;}; commit = { gpgSign = true; };
}; };
}; };
} }

View file

@ -1,12 +1,12 @@
{ { config
config, , lib
lib, , pkgs
pkgs, , ...
...
}: }:
with lib; let with lib; let
cfg = config.dadada.home.gtk; cfg = config.dadada.home.gtk;
in { in
{
options.dadada.home.gtk = { options.dadada.home.gtk = {
enable = mkEnableOption "Enable GTK config"; enable = mkEnableOption "Enable GTK config";
}; };

View file

@ -1,18 +1,18 @@
{ { config
config, , lib
lib, , ...
...
}: }:
with lib; let with lib; let
cfg = config.dadada.home.keyring; cfg = config.dadada.home.keyring;
in { in
{
options.dadada.home.keyring = { options.dadada.home.keyring = {
enable = mkEnableOption "Enable keyring config"; enable = mkEnableOption "Enable keyring config";
}; };
config = mkIf cfg.enable { config = mkIf cfg.enable {
services.gnome-keyring = { services.gnome-keyring = {
enable = false; enable = false;
components = ["pkcs11" "secrets"]; components = [ "pkcs11" "secrets" ];
}; };
}; };
} }

View file

@ -1,12 +1,12 @@
{ { pkgs
pkgs, , lib
lib, , config
config, , ...
...
}: }:
with lib; let with lib; let
cfg = config.dadada.home.kitty; cfg = config.dadada.home.kitty;
in { in
{
options.dadada.home.kitty = { options.dadada.home.kitty = {
enable = mkEnableOption "Enable kitty config"; enable = mkEnableOption "Enable kitty config";
}; };
@ -15,6 +15,6 @@ in {
enable = true; enable = true;
extraConfig = builtins.readFile ./config; extraConfig = builtins.readFile ./config;
}; };
home.packages = [pkgs.source-code-pro]; home.packages = [ pkgs.source-code-pro ];
}; };
} }

View file

@ -1,13 +1,13 @@
{ { config
config, , lib
lib, , pkgs
pkgs, , colors
colors, , ...
...
}: }:
with lib; let with lib; let
cfg = config.dadada.home.mako; cfg = config.dadada.home.mako;
in { in
{
options.dadada.home.mako = { options.dadada.home.mako = {
enable = mkEnableOption "Enable mako config"; enable = mkEnableOption "Enable mako config";
}; };

View file

@ -1,17 +1,17 @@
{ { config
config, , lib
lib, , ...
...
}: }:
with lib; let with lib; let
cfg = config.dadada.home.session; cfg = config.dadada.home.session;
in { in
{
options.dadada.home.session = { options.dadada.home.session = {
enable = mkEnableOption "Enable session variable management"; enable = mkEnableOption "Enable session variable management";
sessionVars = mkOption { sessionVars = mkOption {
description = "Session variables"; description = "Session variables";
type = types.attrs; type = types.attrs;
default = {}; default = { };
example = '' example = ''
EDITOR = "vim"; EDITOR = "vim";
PAGER = "less"; PAGER = "less";

View file

@ -1,11 +1,11 @@
{ { config
config, , lib
lib, , ...
...
}: }:
with lib; let with lib; let
cfg = config.dadada.home.ssh; cfg = config.dadada.home.ssh;
in { in
{
options.dadada.home.ssh = { options.dadada.home.ssh = {
enable = mkEnableOption "Enable SSH config"; enable = mkEnableOption "Enable SSH config";
}; };

View file

@ -1,13 +1,13 @@
{ { config
config, , pkgs
pkgs, , lib
lib, , colors
colors, , ...
...
}: }:
with lib; let with lib; let
cfg = config.dadada.home.sway; cfg = config.dadada.home.sway;
in { in
{
options.dadada.home.sway = { options.dadada.home.sway = {
enable = mkEnableOption "Enable Sway config"; enable = mkEnableOption "Enable Sway config";
}; };

View file

@ -1,12 +1,12 @@
{ { config
config, , pkgs
pkgs, , lib
lib, , ...
...
}: }:
with lib; let with lib; let
cfg = config.dadada.home.syncthing; cfg = config.dadada.home.syncthing;
in { in
{
options.dadada.home.syncthing = { options.dadada.home.syncthing = {
enable = mkEnableOption "Enable Syncthing config"; enable = mkEnableOption "Enable Syncthing config";
}; };

View file

@ -1,13 +1,13 @@
{ { config
config, , lib
lib, , pkgs
pkgs, , colors ? ../../lib/colors.nix
colors ? ../../lib/colors.nix, , ...
...
}: }:
with lib; let with lib; let
cfg = config.dadada.home.termite; cfg = config.dadada.home.termite;
in { in
{
options.dadada.home.termite = { options.dadada.home.termite = {
enable = mkEnableOption "Enable termite config"; enable = mkEnableOption "Enable termite config";
}; };

View file

@ -1,11 +1,11 @@
{ { config
config, , lib
lib, , ...
...
}: }:
with lib; let with lib; let
cfg = config.dadada.home.tmux; cfg = config.dadada.home.tmux;
in { in
{
options.dadada.home.tmux = { options.dadada.home.tmux = {
enable = mkEnableOption "Enable tmux config"; enable = mkEnableOption "Enable tmux config";
}; };

View file

@ -1,13 +1,13 @@
{ { config
config, , pkgs
pkgs, , lib
lib, , ...
...
}: }:
with lib; let with lib; let
cfg = config.dadada.home.vim; cfg = config.dadada.home.vim;
vimPlugins = pkgs.callPackage ../../../pkgs/vimPlugins {}; vimPlugins = pkgs.callPackage ../../../pkgs/vimPlugins { };
in { in
{
options.dadada.home.vim = { options.dadada.home.vim = {
enable = mkEnableOption "Enable VIM config"; enable = mkEnableOption "Enable VIM config";
}; };

View file

@ -1,8 +1,7 @@
{ { config
config, , pkgs
pkgs, , lib
lib, , ...
...
}: }:
with lib; let with lib; let
apps = { apps = {
@ -23,7 +22,8 @@ with lib; let
"application/pdf" = "org.pwmt.zathura.desktop"; "application/pdf" = "org.pwmt.zathura.desktop";
}; };
cfg = config.dadada.home.xdg; cfg = config.dadada.home.xdg;
in { in
{
options.dadada.home.xdg = { options.dadada.home.xdg = {
enable = mkEnableOption "Enable XDG config"; enable = mkEnableOption "Enable XDG config";
}; };

View file

@ -1,12 +1,12 @@
{ { config
config, , pkgs
pkgs, , lib
lib, , ...
...
}: }:
with lib; let with lib; let
cfg = config.dadada.home.zsh; cfg = config.dadada.home.zsh;
in { in
{
options.dadada.home.zsh = { options.dadada.home.zsh = {
enable = mkEnableOption "Enable ZSH config"; enable = mkEnableOption "Enable ZSH config";
}; };

View file

@ -1,4 +1,4 @@
{pkgs}: { { pkgs }: {
allowUnfree = true; allowUnfree = true;
allowUnfreePredicate = pkg: true; allowUnfreePredicate = pkg: true;
allowBroken = false; allowBroken = false;

View file

@ -1,4 +1,4 @@
{pkgs}: { pkgs }:
with pkgs.lib; { with pkgs.lib; {
# TODO # TODO
} }

View file

@ -1,8 +1,7 @@
{ { config
config, , pkgs
pkgs, , lib
lib, , ...
...
}: { }: {
imports = [ imports = [
./hardware-configuration.nix ./hardware-configuration.nix
@ -48,10 +47,10 @@
networking.bridges = { networking.bridges = {
"br-lan" = { "br-lan" = {
interfaces = ["lan"]; interfaces = [ "lan" ];
}; };
"br-backup" = { "br-backup" = {
interfaces = ["backup"]; interfaces = [ "backup" ];
}; };
}; };

View file

@ -1,28 +1,27 @@
# 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, , pkgs
pkgs, , modulesPath
modulesPath, , ...
...
}: { }: {
imports = [ imports = [
(modulesPath + "/installer/scan/not-detected.nix") (modulesPath + "/installer/scan/not-detected.nix")
]; ];
boot.initrd.availableKernelModules = ["xhci_pci" "ahci" "ehci_pci" "usb_storage" "sd_mod" "sdhci_pci"]; boot.initrd.availableKernelModules = [ "xhci_pci" "ahci" "ehci_pci" "usb_storage" "sd_mod" "sdhci_pci" ];
boot.initrd.kernelModules = []; boot.initrd.kernelModules = [ ];
boot.extraModulePackages = []; boot.extraModulePackages = [ ];
fileSystems."/" = { fileSystems."/" = {
device = "/dev/sda1"; device = "/dev/sda1";
fsType = "btrfs"; fsType = "btrfs";
options = ["subvol=root"]; options = [ "subvol=root" ];
}; };
swapDevices = []; swapDevices = [ ];
# The global useDHCP flag is deprecated, therefore explicitly set to false here. # The global useDHCP flag is deprecated, therefore explicitly set to false here.
# Per-interface useDHCP will be mandatory in the future, so this generated config # Per-interface useDHCP will be mandatory in the future, so this generated config

View file

@ -1,31 +1,33 @@
{ { self
self, , admins
admins, , nixpkgs
nixpkgs, , nixosSystem
nixosSystem, , home-manager
home-manager, , homePage
homePage, , nixos-hardware
nixos-hardware, , nvd
nvd, , scripts
scripts, , recipemd
recipemd, ,
}: let }:
let
adapterModule = system: { adapterModule = system: {
nixpkgs.config.allowUnfreePredicate = pkg: true; nixpkgs.config.allowUnfreePredicate = pkg: true;
nixpkgs.overlays = nixpkgs.overlays =
(nixpkgs.lib.attrValues self.overlays) (nixpkgs.lib.attrValues self.overlays)
++ [ ++ [
(final: prev: {homePage = homePage.defaultPackage.${system};}) (final: prev: { homePage = homePage.defaultPackage.${system}; })
(final: prev: {s = scripts;}) (final: prev: { s = scripts; })
(final: prev: {n = nvd;}) (final: prev: { n = nvd; })
(final: prev: {recipemd = recipemd.defaultPackage.${system};}) (final: prev: { recipemd = recipemd.defaultPackage.${system}; })
]; ];
}; };
lib = nixpkgs.lib; lib = nixpkgs.lib;
adminConfig = users: { adminConfig = users: {
dadada.admin.users = lib.getAttrs users admins; dadada.admin.users = lib.getAttrs users admins;
}; };
in { in
{
gorgon = nixosSystem rec { gorgon = nixosSystem rec {
system = "x86_64-linux"; system = "x86_64-linux";
modules = modules =
@ -40,7 +42,7 @@ in {
home-manager.sharedModules = home-manager.sharedModules =
(nixpkgs.lib.attrValues self.hmModules) (nixpkgs.lib.attrValues self.hmModules)
++ [ ++ [
{manual.manpages.enable = false;} { manual.manpages.enable = false; }
]; ];
home-manager.users.dadada = import ../home/home; home-manager.users.dadada = import ../home/home;
} }
@ -53,7 +55,7 @@ in {
modules = modules =
(nixpkgs.lib.attrValues self.nixosModules) (nixpkgs.lib.attrValues self.nixosModules)
++ [ ++ [
(adminConfig ["dadada"]) (adminConfig [ "dadada" ])
(adapterModule system) (adapterModule system)
./modules/profiles/server.nix ./modules/profiles/server.nix
./ifrit/configuration.nix ./ifrit/configuration.nix
@ -65,7 +67,7 @@ in {
modules = modules =
(nixpkgs.lib.attrValues self.nixosModules) (nixpkgs.lib.attrValues self.nixosModules)
++ [ ++ [
(adminConfig ["dadada"]) (adminConfig [ "dadada" ])
(adapterModule system) (adapterModule system)
./modules/profiles/server.nix ./modules/profiles/server.nix
./surgat/configuration.nix ./surgat/configuration.nix
@ -76,7 +78,7 @@ in {
modules = modules =
(nixpkgs.lib.attrValues self.nixosModules) (nixpkgs.lib.attrValues self.nixosModules)
++ [ ++ [
(adminConfig ["dadada"]) (adminConfig [ "dadada" ])
(adapterModule system) (adapterModule system)
./modules/profiles/laptop.nix ./modules/profiles/laptop.nix
./pruflas/configuration.nix ./pruflas/configuration.nix
@ -88,7 +90,7 @@ in {
modules = modules =
(nixpkgs.lib.attrValues self.nixosModules) (nixpkgs.lib.attrValues self.nixosModules)
++ [ ++ [
(adminConfig ["dadada"]) (adminConfig [ "dadada" ])
(adapterModule system) (adapterModule system)
./modules/profiles/server.nix ./modules/profiles/server.nix
./agares/configuration.nix ./agares/configuration.nix

View file

@ -1,20 +1,21 @@
{ { config
config, , pkgs
pkgs, , lib
lib, , ...
... }:
}: let let
signHook = signHook =
pkgs.writeShellScript "/etc/nix/sign-cache.sh" pkgs.writeShellScript "/etc/nix/sign-cache.sh"
'' ''
set -eu set -eu
set -f # disable globbing set -f # disable globbing
export IFS=' ' export IFS=' '
echo "Signing paths" $OUT_PATHS echo "Signing paths" $OUT_PATHS
nix store sign --key-file /etc/nix/key.private $OUT_PATHS nix store sign --key-file /etc/nix/key.private $OUT_PATHS
''; '';
in { in
{
imports = [ imports = [
./hardware-configuration.nix ./hardware-configuration.nix
]; ];
@ -26,7 +27,7 @@ in {
keep-derivations = true keep-derivations = true
''; '';
boot.kernelModules = ["kvm-amd"]; boot.kernelModules = [ "kvm-amd" ];
networking.hostName = "gorgon"; networking.hostName = "gorgon";
@ -103,23 +104,23 @@ in {
users.users = { users.users = {
dadada = { dadada = {
isNormalUser = true; isNormalUser = true;
extraGroups = ["wheel" "networkmanager" "libvirtd" "adbusers" "kvm" "video" "scanner" "lp" "docker"]; extraGroups = [ "wheel" "networkmanager" "libvirtd" "adbusers" "kvm" "video" "scanner" "lp" "docker" ];
shell = "/run/current-system/sw/bin/zsh"; shell = "/run/current-system/sw/bin/zsh";
}; };
}; };
networking.hosts = { networking.hosts = {
"10.1.2.9" = ["fgprinter.fginfo.tu-bs.de"]; "10.1.2.9" = [ "fgprinter.fginfo.tu-bs.de" ];
"127.0.0.2" = ["kanboard.dadada.li"]; "127.0.0.2" = [ "kanboard.dadada.li" ];
}; };
networking.wireguard.interfaces.uwupn = { networking.wireguard.interfaces.uwupn = {
ips = ["10.11.0.24/32" "fc00:1337:dead:beef::10.11.0.24/128"]; ips = [ "10.11.0.24/32" "fc00:1337:dead:beef::10.11.0.24/128" ];
privateKeyFile = "/var/lib/wireguard/uwu"; privateKeyFile = "/var/lib/wireguard/uwu";
peers = [ peers = [
{ {
publicKey = "tuoiOWqgHz/lrgTcLjX+xIhvxh9jDH6gmDw2ZMvX5T8="; publicKey = "tuoiOWqgHz/lrgTcLjX+xIhvxh9jDH6gmDw2ZMvX5T8=";
allowedIPs = ["10.11.0.0/22" "fc00:1337:dead:beef::10.11.0.0/118" "192.168.178.0/23"]; allowedIPs = [ "10.11.0.0/22" "fc00:1337:dead:beef::10.11.0.0/118" "192.168.178.0/23" ];
endpoint = "53c70r.de:51820"; endpoint = "53c70r.de:51820";
persistentKeepalive = 25; persistentKeepalive = 25;
} }

View file

@ -1,21 +1,20 @@
# 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, , pkgs
pkgs, , modulesPath
modulesPath, , ...
...
}: { }: {
imports = [ imports = [
(modulesPath + "/installer/scan/not-detected.nix") (modulesPath + "/installer/scan/not-detected.nix")
]; ];
boot.initrd.availableKernelModules = ["nvme" "ehci_pci" "xhci_pci" "usb_storage" "sd_mod" "rtsx_pci_sdmmc"]; boot.initrd.availableKernelModules = [ "nvme" "ehci_pci" "xhci_pci" "usb_storage" "sd_mod" "rtsx_pci_sdmmc" ];
boot.initrd.kernelModules = ["dm-snapshot"]; boot.initrd.kernelModules = [ "dm-snapshot" ];
boot.kernelModules = ["kvm-amd"]; boot.kernelModules = [ "kvm-amd" ];
boot.extraModulePackages = []; boot.extraModulePackages = [ ];
fileSystems."/" = { fileSystems."/" = {
device = "/dev/disk/by-uuid/2478e089-e5d6-480c-8530-4ea46988f9f7"; device = "/dev/disk/by-uuid/2478e089-e5d6-480c-8530-4ea46988f9f7";
@ -38,7 +37,7 @@
}; };
swapDevices = [ swapDevices = [
{device = "/dev/disk/by-uuid/92310a00-7f69-4775-85cb-38e1790f71db";} { device = "/dev/disk/by-uuid/92310a00-7f69-4775-85cb-38e1790f71db"; }
]; ];
nix.settings.max-jobs = lib.mkDefault 16; nix.settings.max-jobs = lib.mkDefault 16;

View file

@ -1,16 +1,17 @@
{ { config
config, , pkgs
pkgs, , lib
lib, , ...
... }:
}: let let
hostAliases = [ hostAliases = [
"ifrit.dadada.li" "ifrit.dadada.li"
"media.dadada.li" "media.dadada.li"
"backup0.dadada.li" "backup0.dadada.li"
]; ];
backups = "/mnt/storage/backup"; backups = "/mnt/storage/backup";
in { in
{
imports = [ imports = [
./hardware-configuration.nix ./hardware-configuration.nix
]; ];
@ -26,50 +27,50 @@ in {
services.borgbackup.repos = { services.borgbackup.repos = {
"metis" = { "metis" = {
allowSubRepos = false; allowSubRepos = false;
authorizedKeysAppendOnly = ["ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIDnc1gCi8lbhlLmPKvaExtCxVaAni8RrOuHUQO6wTbzR root@metis"]; authorizedKeysAppendOnly = [ "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIDnc1gCi8lbhlLmPKvaExtCxVaAni8RrOuHUQO6wTbzR root@metis" ];
authorizedKeys = ["ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIJyTgdVPPxQeL5KZo9frZQlDIv2QkelJw3gNGoGtUMfw tim@metis"]; authorizedKeys = [ "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIJyTgdVPPxQeL5KZo9frZQlDIv2QkelJw3gNGoGtUMfw tim@metis" ];
path = "${backups}/metis"; path = "${backups}/metis";
quota = "1T"; quota = "1T";
}; };
"gorgon" = { "gorgon" = {
allowSubRepos = false; allowSubRepos = false;
authorizedKeysAppendOnly = ["ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIP6p9b2D7y2W+9BGee2yk2xsCRewNNaE6oS3CqlW61ti root@gorgon"]; authorizedKeysAppendOnly = [ "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIP6p9b2D7y2W+9BGee2yk2xsCRewNNaE6oS3CqlW61ti root@gorgon" ];
authorizedKeys = ["ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIJyTgdVPPxQeL5KZo9frZQlDIv2QkelJw3gNGoGtUMfw tim@metis"]; authorizedKeys = [ "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIJyTgdVPPxQeL5KZo9frZQlDIv2QkelJw3gNGoGtUMfw tim@metis" ];
path = "${backups}/gorgon"; path = "${backups}/gorgon";
quota = "1T"; quota = "1T";
}; };
"surgat" = { "surgat" = {
allowSubRepos = false; allowSubRepos = false;
authorizedKeysAppendOnly = ["ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAINGhatanrNG+M6jAkU7Yi44mJmTreJkqyZ6Z+qiEgV7O root@surgat"]; authorizedKeysAppendOnly = [ "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAINGhatanrNG+M6jAkU7Yi44mJmTreJkqyZ6Z+qiEgV7O root@surgat" ];
authorizedKeys = ["ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIJyTgdVPPxQeL5KZo9frZQlDIv2QkelJw3gNGoGtUMfw tim@metis"]; authorizedKeys = [ "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIJyTgdVPPxQeL5KZo9frZQlDIv2QkelJw3gNGoGtUMfw tim@metis" ];
path = "${backups}/surgat"; path = "${backups}/surgat";
quota = "50G"; quota = "50G";
}; };
"pruflas" = { "pruflas" = {
allowSubRepos = false; allowSubRepos = false;
authorizedKeysAppendOnly = ["ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIBk7f9DSnXCOIUsxFsjCKG23vHShV4TSzzPJunPOwa1I root@pruflas"]; authorizedKeysAppendOnly = [ "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIBk7f9DSnXCOIUsxFsjCKG23vHShV4TSzzPJunPOwa1I root@pruflas" ];
authorizedKeys = ["ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIJyTgdVPPxQeL5KZo9frZQlDIv2QkelJw3gNGoGtUMfw tim@metis"]; authorizedKeys = [ "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIJyTgdVPPxQeL5KZo9frZQlDIv2QkelJw3gNGoGtUMfw tim@metis" ];
path = "${backups}/pruflas"; path = "${backups}/pruflas";
quota = "50G"; quota = "50G";
}; };
"wohnzimmerpi" = { "wohnzimmerpi" = {
allowSubRepos = false; allowSubRepos = false;
authorizedKeysAppendOnly = ["ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIK6uZ8mPQJWOL984gZKKPyxp7VLcxk42TpTh5iPP6N6k root@wohnzimmerpi"]; authorizedKeysAppendOnly = [ "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIK6uZ8mPQJWOL984gZKKPyxp7VLcxk42TpTh5iPP6N6k root@wohnzimmerpi" ];
authorizedKeys = ["ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIJyTgdVPPxQeL5KZo9frZQlDIv2QkelJw3gNGoGtUMfw tim@metis"]; authorizedKeys = [ "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIJyTgdVPPxQeL5KZo9frZQlDIv2QkelJw3gNGoGtUMfw tim@metis" ];
path = "${backups}/wohnzimmerpi"; path = "${backups}/wohnzimmerpi";
quota = "50G"; quota = "50G";
}; };
"fginfo" = { "fginfo" = {
allowSubRepos = false; allowSubRepos = false;
authorizedKeysAppendOnly = ["ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCxsyJeZVlVix0FPE8S/Gx0DVutS1ZNESVdYvHBwo36wGlYpSsQoSy/2HSwbpxs88MOGw1QNboxvvpBxCWxZ5HyjxuO5SwYgtmpjPXvmqfVqNXXnLChhSnKgk9b+HesQJCbHyrF9ZAJXEFCOGhOL3YTgd6lTX3lQUXgh/LEDlrPrigUMDNPecPWxpPskP6Vvpe9u+duhL+ihyxXaV+CoPk8nkWrov5jCGPiM48pugbwAfqARyZDgFpmWwL7Xg2UKgVZ1ttHZCWwH+htgioVZMYpdkQW1aq6LLGwN34Hj2VKXzmJN5frh6vQoZr2AFGHNKyJwAMpqnoY//QwuREpZTrh root@fginfo.ibr.cs.tu-bs.de"]; authorizedKeysAppendOnly = [ "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCxsyJeZVlVix0FPE8S/Gx0DVutS1ZNESVdYvHBwo36wGlYpSsQoSy/2HSwbpxs88MOGw1QNboxvvpBxCWxZ5HyjxuO5SwYgtmpjPXvmqfVqNXXnLChhSnKgk9b+HesQJCbHyrF9ZAJXEFCOGhOL3YTgd6lTX3lQUXgh/LEDlrPrigUMDNPecPWxpPskP6Vvpe9u+duhL+ihyxXaV+CoPk8nkWrov5jCGPiM48pugbwAfqARyZDgFpmWwL7Xg2UKgVZ1ttHZCWwH+htgioVZMYpdkQW1aq6LLGwN34Hj2VKXzmJN5frh6vQoZr2AFGHNKyJwAMpqnoY//QwuREpZTrh root@fginfo.ibr.cs.tu-bs.de" ];
authorizedKeys = ["ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIJyTgdVPPxQeL5KZo9frZQlDIv2QkelJw3gNGoGtUMfw tim@metis"]; authorizedKeys = [ "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIJyTgdVPPxQeL5KZo9frZQlDIv2QkelJw3gNGoGtUMfw tim@metis" ];
path = "${backups}/fginfo"; path = "${backups}/fginfo";
quota = "10G"; quota = "10G";
}; };
"fginfo-git" = { "fginfo-git" = {
allowSubRepos = false; allowSubRepos = false;
authorizedKeysAppendOnly = ["ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDmI6cUv3j0T9ofFB286sDwXwwczqi41cp4MZyGH3VWQnqBPNjICqAdY3CLhgvGBCxSe6ZgKQ+5YLsGSSlU1uhrJXW2UiVKuIPd0kjMF/9e8hmNoTTh0pdk9THfz9LLAdI1vPin1EeVReuDXlZkCI7DFYuTO9yiyZ1uLZUfT1KBRoqiqyypZhut7zT3UaDs2L+Y5hho6WiTdm7INuz6HEB7qYXzrmx93hlcuLZA7fDfyMO9F4APZFUqefcUIEyDI2b+Q/8Q2/rliT2PoC69XLVlj7HyVhfgKsOnopwBDNF3rRcJ6zz4WICPM18i4ZCmfoDTL/cFr5c41Lan1X7wS5wR root@fginfo-git"]; authorizedKeysAppendOnly = [ "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDmI6cUv3j0T9ofFB286sDwXwwczqi41cp4MZyGH3VWQnqBPNjICqAdY3CLhgvGBCxSe6ZgKQ+5YLsGSSlU1uhrJXW2UiVKuIPd0kjMF/9e8hmNoTTh0pdk9THfz9LLAdI1vPin1EeVReuDXlZkCI7DFYuTO9yiyZ1uLZUfT1KBRoqiqyypZhut7zT3UaDs2L+Y5hho6WiTdm7INuz6HEB7qYXzrmx93hlcuLZA7fDfyMO9F4APZFUqefcUIEyDI2b+Q/8Q2/rliT2PoC69XLVlj7HyVhfgKsOnopwBDNF3rRcJ6zz4WICPM18i4ZCmfoDTL/cFr5c41Lan1X7wS5wR root@fginfo-git" ];
authorizedKeys = ["ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIJyTgdVPPxQeL5KZo9frZQlDIv2QkelJw3gNGoGtUMfw tim@metis"]; authorizedKeys = [ "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIJyTgdVPPxQeL5KZo9frZQlDIv2QkelJw3gNGoGtUMfw tim@metis" ];
path = "${backups}/fginfo-git"; path = "${backups}/fginfo-git";
quota = "10G"; quota = "10G";
}; };
@ -101,7 +102,7 @@ in {
device = "/dev/disk/by-uuid/a34e36fc-d7dd-4ceb-93c4-48f9c2727cb7"; device = "/dev/disk/by-uuid/a34e36fc-d7dd-4ceb-93c4-48f9c2727cb7";
mountPoint = "/mnt/storage"; mountPoint = "/mnt/storage";
neededForBoot = false; neededForBoot = false;
options = ["nofail"]; options = [ "nofail" ];
}; };
networking.firewall = { networking.firewall = {
@ -116,7 +117,7 @@ in {
isNormalUser = true; isNormalUser = true;
}; };
environment.systemPackages = [pkgs.curl]; environment.systemPackages = [ pkgs.curl ];
system.stateVersion = "20.03"; system.stateVersion = "20.03";
} }

View file

@ -1,21 +1,20 @@
# 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, , pkgs
pkgs, , modulesPath
modulesPath, , ...
...
}: { }: {
imports = [ imports = [
(modulesPath + "/profiles/qemu-guest.nix") (modulesPath + "/profiles/qemu-guest.nix")
]; ];
boot.initrd.availableKernelModules = ["ata_piix" "uhci_hcd" "ehci_pci" "sd_mod" "sr_mod"]; boot.initrd.availableKernelModules = [ "ata_piix" "uhci_hcd" "ehci_pci" "sd_mod" "sr_mod" ];
boot.initrd.kernelModules = []; boot.initrd.kernelModules = [ ];
boot.kernelModules = []; boot.kernelModules = [ ];
boot.extraModulePackages = []; boot.extraModulePackages = [ ];
fileSystems."/" = { fileSystems."/" = {
device = "/dev/disk/by-uuid/0b4f5f01-5849-4f05-9822-b648abbc2485"; device = "/dev/disk/by-uuid/0b4f5f01-5849-4f05-9822-b648abbc2485";
@ -23,7 +22,7 @@
}; };
swapDevices = [ swapDevices = [
{device = "/dev/disk/by-uuid/53b5715e-2724-4800-9cfc-f892115681b6";} { device = "/dev/disk/by-uuid/53b5715e-2724-4800-9cfc-f892115681b6"; }
]; ];
nix.settings.max-jobs = lib.mkDefault 2; nix.settings.max-jobs = lib.mkDefault 2;

View file

@ -1,12 +1,11 @@
{ { config
config, , pkgs
pkgs, , lib
lib, , ...
...
}: }:
with lib; let with lib; let
cfg = config.dadada.admin; cfg = config.dadada.admin;
extraGroups = ["wheel" "libvirtd"]; extraGroups = [ "wheel" "libvirtd" ];
shells = { shells = {
"bash" = pkgs.bashInteractive; "bash" = pkgs.bashInteractive;
@ -16,40 +15,41 @@ with lib; let
shellNames = builtins.attrNames shells; shellNames = builtins.attrNames shells;
adminOpts = { adminOpts =
name, { name
config, , config
... , ...
}: { }: {
options = { options = {
keys = mkOption { keys = mkOption {
type = types.listOf types.str; type = types.listOf types.str;
default = []; default = [ ];
apply = x: assert (builtins.length x > 0 || abort "Please specify at least one key to be able to log in"); x; apply = x: assert (builtins.length x > 0 || abort "Please specify at least one key to be able to log in"); x;
description = '' description = ''
The keys that should be able to access the account. The keys that should be able to access the account.
''; '';
}; };
shell = mkOption { shell = mkOption {
type = types.nullOr types.str; type = types.nullOr types.str;
apply = x: assert (builtins.elem x shellNames || abort "Please specify one of ${builtins.toString shellNames}"); x; apply = x: assert (builtins.elem x shellNames || abort "Please specify one of ${builtins.toString shellNames}"); x;
default = "zsh"; default = "zsh";
defaultText = literalExpression "zsh"; defaultText = literalExpression "zsh";
example = literalExpression "bash"; example = literalExpression "bash";
description = '' description = ''
One of ${builtins.toString shellNames} One of ${builtins.toString shellNames}
''; '';
};
}; };
}; };
}; in
in { {
options = { options = {
dadada.admin = { dadada.admin = {
enable = mkEnableOption "Enable admin access"; enable = mkEnableOption "Enable admin access";
users = mkOption { users = mkOption {
type = with types; attrsOf (submodule adminOpts); type = with types; attrsOf (submodule adminOpts);
default = {}; default = { };
description = '' description = ''
Admin users with root access machine. Admin users with root access machine.
''; '';
@ -76,13 +76,13 @@ in {
users.users = users.users =
mapAttrs mapAttrs
(user: keys: { (user: keys: {
shell = shells."${keys.shell}"; shell = shells."${keys.shell}";
extraGroups = extraGroups; extraGroups = extraGroups;
isNormalUser = true; isNormalUser = true;
openssh.authorizedKeys.keys = keys.keys; openssh.authorizedKeys.keys = keys.keys;
}) })
cfg.users; cfg.users;
nix.trustedUsers = builtins.attrNames cfg.users; nix.trustedUsers = builtins.attrNames cfg.users;
@ -96,7 +96,7 @@ in {
services.tor.relay.onionServices = { services.tor.relay.onionServices = {
"rat" = mkIf cfg.rat.enable { "rat" = mkIf cfg.rat.enable {
name = "rat"; name = "rat";
map = [{port = 22;}]; map = [{ port = 22; }];
}; };
}; };
}; };

View file

@ -1,8 +1,7 @@
{ { config
config, , pkgs
pkgs, , lib
lib, , ...
...
}: }:
with lib; let with lib; let
backupExcludes = [ backupExcludes = [
@ -24,7 +23,8 @@ with lib; let
"/var/tmp" "/var/tmp"
]; ];
cfg = config.dadada.backupClient; cfg = config.dadada.backupClient;
in { in
{
options = { options = {
dadada.backupClient = { dadada.backupClient = {
gs = { gs = {
@ -62,7 +62,7 @@ in {
"/backup" = { "/backup" = {
device = "/dev/disk/by-uuid/0fdab735-cc3e-493a-b4ec-cbf6a77d48d5"; device = "/dev/disk/by-uuid/0fdab735-cc3e-493a-b4ec-cbf6a77d48d5";
fsType = "ext4"; fsType = "ext4";
options = ["x-systemd.automount" "noauto" "x-systemd.idle-timeout=600"]; options = [ "x-systemd.automount" "noauto" "x-systemd.idle-timeout=600" ];
}; };
}; };

View file

@ -1,41 +1,41 @@
{ { config
config, , pkgs
pkgs, , lib
lib, , ...
...
}: }:
with lib; let with lib; let
cfg = config.dadada.ddns; cfg = config.dadada.ddns;
ddnsConfig = hostNames: { ddnsConfig = hostNames: {
systemd.timers = listToAttrs (forEach hostNames (hostname: systemd.timers = listToAttrs (forEach hostNames (hostname:
nameValuePair "ddns-${hostname}" nameValuePair "ddns-${hostname}"
{ {
wantedBy = ["timers.target"]; wantedBy = [ "timers.target" ];
partOf = ["ddns-${hostname}.service"]; partOf = [ "ddns-${hostname}.service" ];
timerConfig.OnCalendar = "hourly"; timerConfig.OnCalendar = "hourly";
})); }));
systemd.services = listToAttrs (forEach hostNames (hostname: systemd.services = listToAttrs (forEach hostNames (hostname:
nameValuePair "ddns-${hostname}" nameValuePair "ddns-${hostname}"
{ {
serviceConfig.Type = "oneshot"; serviceConfig.Type = "oneshot";
script = '' script = ''
function url() { function url() {
echo "https://svc.joker.com/nic/update?username=$1&password=$2&hostname=$3" echo "https://svc.joker.com/nic/update?username=$1&password=$2&hostname=$3"
} }
IFS=':' IFS=':'
read -r user password < /var/lib/ddns/credentials read -r user password < /var/lib/ddns/credentials
unset IFS unset IFS
curl_url=$(url "$user" "$password" ${hostname}) curl_url=$(url "$user" "$password" ${hostname})
${pkgs.curl}/bin/curl -4 "$curl_url" ${pkgs.curl}/bin/curl -4 "$curl_url"
${pkgs.curl}/bin/curl -6 "$curl_url" ${pkgs.curl}/bin/curl -6 "$curl_url"
''; '';
})); }));
}; };
in { in
{
options = { options = {
dadada.ddns.domains = mkOption { dadada.ddns.domains = mkOption {
type = types.listOf types.str; type = types.listOf types.str;
@ -45,7 +45,7 @@ in {
example = '' example = ''
[ "example.com" ] [ "example.com" ]
''; '';
default = []; default = [ ];
}; };
}; };

View file

@ -1,4 +1,4 @@
{...} @ inputs: { { ... } @ inputs: {
admin = import ./admin.nix; admin = import ./admin.nix;
backup = import ./backup.nix; backup = import ./backup.nix;
ddns = import ./ddns.nix; ddns = import ./ddns.nix;

View file

@ -1,11 +1,12 @@
{ { config
config, , pkgs
pkgs, , lib
lib, , ...
... }:
}: let let
cfg = config.dadada.element; cfg = config.dadada.element;
in { in
{
options.dadada.element = { options.dadada.element = {
enable = lib.mkEnableOption "Enable element webapp"; enable = lib.mkEnableOption "Enable element webapp";
}; };

View file

@ -1,13 +1,13 @@
{ { config
config, , pkgs
pkgs, , lib
lib, , ...
...
}: }:
with lib; let with lib; let
luks = config.dadada.luks; luks = config.dadada.luks;
fido2 = config.dadada.fido2; fido2 = config.dadada.fido2;
in { in
{
options = { options = {
dadada.luks = { dadada.luks = {
uuid = mkOption { uuid = mkOption {

View file

@ -1,14 +1,14 @@
{ { config
config, , lib
lib, , ...
...
}: }:
with lib; let with lib; let
cfg = config.dadada.fileShare; cfg = config.dadada.fileShare;
sharePath = "/mnt/storage/share"; sharePath = "/mnt/storage/share";
ipv6 = "fd42:dead:beef::/48"; ipv6 = "fd42:dead:beef::/48";
ipv4 = "192.168.42.0/24"; ipv4 = "192.168.42.0/24";
in { in
{
options.dadada.fileShare = { options.dadada.fileShare = {
enable = mkEnableOption "Enable file share server"; enable = mkEnableOption "Enable file share server";
}; };

View file

@ -1,12 +1,13 @@
{ { config
config, , pkgs
pkgs, , lib
lib, , ...
... }:
}: let let
redisSocket = "127.0.0.1:6379"; redisSocket = "127.0.0.1:6379";
cfg = config.dadada.gitea; cfg = config.dadada.gitea;
in { in
{
options.dadada.gitea = { options.dadada.gitea = {
enable = lib.mkEnableOption "Enable gitea"; enable = lib.mkEnableOption "Enable gitea";
}; };

View file

@ -1,12 +1,12 @@
{ { config
config, , pkgs
pkgs, , lib
lib, , ...
...
}: }:
with lib; let with lib; let
cfg = config.dadada.headphones; cfg = config.dadada.headphones;
in { in
{
options = { options = {
dadada.headphones = { dadada.headphones = {
enable = mkEnableOption "Enable bluetooth headphones with more audio codecs."; enable = mkEnableOption "Enable bluetooth headphones with more audio codecs.";
@ -17,7 +17,7 @@ in {
bluetooth.enable = true; bluetooth.enable = true;
pulseaudio = { pulseaudio = {
enable = true; enable = true;
extraModules = [pkgs.pulseaudio-modules-bt]; extraModules = [ pkgs.pulseaudio-modules-bt ];
extraConfig = '' extraConfig = ''
set-source-volume 1 10000 set-source-volume 1 10000
''; '';

View file

@ -1,22 +1,22 @@
{ { config
config, , pkgs
pkgs, , lib
lib, , ...
... }:
}: let let
cfg = config.dadada.homePage; cfg = config.dadada.homePage;
in in
with lib; { with lib; {
options.dadada.homePage = { options.dadada.homePage = {
enable = mkEnableOption "Enable home page"; enable = mkEnableOption "Enable home page";
}; };
config = mkIf cfg.enable { config = mkIf cfg.enable {
services.nginx.enable = true; services.nginx.enable = true;
services.nginx.virtualHosts."dadada.li" = { services.nginx.virtualHosts."dadada.li" = {
enableACME = true; enableACME = true;
forceSSL = true; forceSSL = true;
root = "${pkgs.homePage}"; root = "${pkgs.homePage}";
};
}; };
} };
}

View file

@ -1,12 +1,13 @@
# Source https://github.com/NixOS/nixpkgs/issues/113384 # Source https://github.com/NixOS/nixpkgs/issues/113384
{ { config
config, , lib
lib, , pkgs
pkgs, , ...
... }:
}: let let
cfg = config.dadada.kanboard; cfg = config.dadada.kanboard;
in { in
{
options = { options = {
dadada.kanboard.enable = lib.mkEnableOption "Enable Kanboard"; dadada.kanboard.enable = lib.mkEnableOption "Enable Kanboard";
}; };
@ -23,7 +24,7 @@ in {
}; };
users.users.kanboard.isSystemUser = true; users.users.kanboard.isSystemUser = true;
users.users.kanboard.group = "kanboard"; users.users.kanboard.group = "kanboard";
users.groups.kanboard.members = ["kanboard"]; users.groups.kanboard.members = [ "kanboard" ];
systemd.tmpfiles.rules = [ systemd.tmpfiles.rules = [
"d /var/lib/kanboard/data 0750 kanboard nginx - -" "d /var/lib/kanboard/data 0750 kanboard nginx - -"
@ -35,7 +36,7 @@ in {
root = pkgs.buildEnv { root = pkgs.buildEnv {
name = "kanboard-configured"; name = "kanboard-configured";
paths = [ paths = [
(pkgs.runCommand "kanboard-over" {meta.priority = 0;} '' (pkgs.runCommand "kanboard-over" { meta.priority = 0; } ''
mkdir -p $out mkdir -p $out
for f in index.php jsonrpc.php ; do for f in index.php jsonrpc.php ; do
echo "<?php require('$out/config.php');" > $out/$f echo "<?php require('$out/config.php');" > $out/$f

View file

@ -1,13 +1,13 @@
{ { config
config, , pkgs
pkgs, , lib
lib, , ...
...
}: }:
with lib; let with lib; let
cfg = config.dadada.networking; cfg = config.dadada.networking;
vpnPubKey = "x/y6I59buVzv9Lfzl+b17mGWbzxU+3Ke9mQNa1DLsDI="; vpnPubKey = "x/y6I59buVzv9Lfzl+b17mGWbzxU+3Ke9mQNa1DLsDI=";
in { in
{
options = { options = {
dadada.networking = { dadada.networking = {
localResolver = { localResolver = {
@ -18,7 +18,7 @@ in {
wanInterfaces = mkOption { wanInterfaces = mkOption {
type = with types; listOf str; type = with types; listOf str;
description = "WAN network interfaces"; description = "WAN network interfaces";
default = []; default = [ ];
}; };
vpnExtension = mkOption { vpnExtension = mkOption {
type = with types; nullOr str; type = with types; nullOr str;
@ -122,7 +122,7 @@ in {
networking.wireguard.interfaces = mkIf (cfg.vpnExtension != null) { networking.wireguard.interfaces = mkIf (cfg.vpnExtension != null) {
dadada = { dadada = {
ips = ["fd42:9c3b:f96d:201::${cfg.vpnExtension}/64"]; ips = [ "fd42:9c3b:f96d:201::${cfg.vpnExtension}/64" ];
listenPort = 51234; listenPort = 51234;
privateKeyFile = "/var/lib/wireguard/privkey"; privateKeyFile = "/var/lib/wireguard/privkey";
@ -130,7 +130,7 @@ in {
peers = [ peers = [
{ {
publicKey = vpnPubKey; publicKey = vpnPubKey;
allowedIPs = ["fd42:9c3b:f96d::/48"]; allowedIPs = [ "fd42:9c3b:f96d::/48" ];
endpoint = "vpn.dadada.li:51234"; endpoint = "vpn.dadada.li:51234";
persistentKeepalive = 25; persistentKeepalive = 25;
} }
@ -140,8 +140,8 @@ in {
# https://lists.zx2c4.com/pipermail/wireguard/2017-November/002028.html # https://lists.zx2c4.com/pipermail/wireguard/2017-November/002028.html
systemd.timers.wg-reresolve-dns = mkIf (cfg.vpnExtension != null) { systemd.timers.wg-reresolve-dns = mkIf (cfg.vpnExtension != null) {
wantedBy = ["timers.target"]; wantedBy = [ "timers.target" ];
partOf = ["wg-reresolve-dns.service"]; partOf = [ "wg-reresolve-dns.service" ];
timerConfig.OnCalendar = "hourly"; timerConfig.OnCalendar = "hourly";
}; };
systemd.services.wg-reresolve-dns = mkIf (cfg.vpnExtension != null) { systemd.services.wg-reresolve-dns = mkIf (cfg.vpnExtension != null) {

View file

@ -1,14 +1,12 @@
{ { self
self, , home-manager
home-manager, , nixpkgs
nixpkgs, , ...
... }: { config
}: { , pkgs
config, , lib
pkgs, , ...
lib, }:
...
}:
# Global settings for nix daemon # Global settings for nix daemon
{ {
nix.nixPath = [ nix.nixPath = [

View file

@ -1,8 +1,7 @@
{ { config
config, , pkgs
pkgs, , lib
lib, , ...
...
}: }:
with lib; { with lib; {
networking.domain = mkDefault "dadada.li"; networking.domain = mkDefault "dadada.li";
@ -29,7 +28,7 @@ with lib; {
vteIntegration = true; vteIntegration = true;
syntaxHighlighting = { syntaxHighlighting = {
enable = true; enable = true;
highlighters = ["main" "brackets" "pattern" "root" "line"]; highlighters = [ "main" "brackets" "pattern" "root" "line" ];
}; };
}; };

View file

@ -1,8 +1,7 @@
{ { config
config, , pkgs
pkgs, , lib
lib, , ...
...
}: }:
with lib; { with lib; {
networking.domain = mkDefault "dadada.li"; networking.domain = mkDefault "dadada.li";

View file

@ -1,12 +1,12 @@
{ { config
config, , pkgs
pkgs, , lib
lib, , ...
...
}: }:
with lib; let with lib; let
cfg = config.dadada.share; cfg = config.dadada.share;
in { in
{
options.dadada.share = { options.dadada.share = {
enable = mkEnableOption "Enable file share"; enable = mkEnableOption "Enable file share";
}; };

View file

@ -1,12 +1,12 @@
{ { config
config, , pkgs
pkgs, , lib
lib, , ...
...
}: }:
with lib; let with lib; let
cfg = config.dadada.steam; cfg = config.dadada.steam;
in { in
{
options = { options = {
dadada.steam = { dadada.steam = {
enable = mkEnableOption "Enable Steam config"; enable = mkEnableOption "Enable Steam config";
@ -18,7 +18,7 @@ in {
hardware.opengl = { hardware.opengl = {
enable = true; enable = true;
driSupport32Bit = true; driSupport32Bit = true;
extraPackages32 = with pkgs.pkgsi686Linux; [libva]; extraPackages32 = with pkgs.pkgsi686Linux; [ libva ];
}; };
hardware.pulseaudio.support32Bit = true; hardware.pulseaudio.support32Bit = true;

View file

@ -1,12 +1,12 @@
{ { config
config, , pkgs
pkgs, , lib
lib, , ...
...
}: }:
with lib; let with lib; let
cfg = config.dadada.autoUpgrade; cfg = config.dadada.autoUpgrade;
in { in
{
options.dadada.autoUpgrade = { options.dadada.autoUpgrade = {
enable = mkEnableOption "Enable automatic upgrades"; enable = mkEnableOption "Enable automatic upgrades";
}; };

View file

@ -1,12 +1,11 @@
{ { config
config, , pkgs
pkgs, , lib
lib, , ...
...
}: }:
with lib; let with lib; let
cfg = config.dadada.vpnServer; cfg = config.dadada.vpnServer;
wgPeer = {name, ...}: { wgPeer = { name, ... }: {
options = { options = {
name = mkOption { name = mkOption {
internal = true; internal = true;
@ -24,13 +23,14 @@ with lib; let
}; };
}; };
}; };
in { in
{
options.dadada.vpnServer = { options.dadada.vpnServer = {
enable = mkEnableOption "Enable wireguard gateway"; enable = mkEnableOption "Enable wireguard gateway";
peers = mkOption { peers = mkOption {
description = "Set of extensions and public keys of peers"; description = "Set of extensions and public keys of peers";
type = with types; attrsOf (submodule wgPeer); type = with types; attrsOf (submodule wgPeer);
default = {}; default = { };
}; };
}; };
config = mkIf cfg.enable { config = mkIf cfg.enable {
@ -39,15 +39,15 @@ in {
interfaces."wg0" = { interfaces."wg0" = {
allowedIPsAsRoutes = true; allowedIPsAsRoutes = true;
privateKeyFile = "/var/lib/wireguard/wg0-key"; privateKeyFile = "/var/lib/wireguard/wg0-key";
ips = ["fd42:9c3b:f96d:0201::0/64"]; ips = [ "fd42:9c3b:f96d:0201::0/64" ];
listenPort = 51234; listenPort = 51234;
peers = peers =
map map
(peer: { (peer: {
allowedIPs = ["fd42:9c3b:f96d:0201::${peer.id}/128"]; allowedIPs = [ "fd42:9c3b:f96d:0201::${peer.id}/128" ];
publicKey = peer.key; publicKey = peer.key;
}) })
(attrValues cfg.peers); (attrValues cfg.peers);
postSetup = '' postSetup = ''
wg set wg0 fwmark 51234 wg set wg0 fwmark 51234
ip -6 route add table 2468 fd42:9c3b:f96d::/48 dev ens3 ip -6 route add table 2468 fd42:9c3b:f96d::/48 dev ens3

View file

@ -1,12 +1,12 @@
{ { config
config, , pkgs
pkgs, , lib
lib, , ...
...
}: }:
with lib; let with lib; let
cfg = config.dadada.weechat; cfg = config.dadada.weechat;
in { in
{
options.dadada.weechat = { options.dadada.weechat = {
enable = mkEnableOption "Enable weechat relay"; enable = mkEnableOption "Enable weechat relay";
}; };

View file

@ -1,8 +1,7 @@
{ { config
config, , pkgs
pkgs, , lib
lib, , ...
...
}: { }: {
programs.zsh = { programs.zsh = {
enable = true; enable = true;
@ -12,7 +11,7 @@
vteIntegration = true; vteIntegration = true;
syntaxHighlighting = { syntaxHighlighting = {
enable = true; enable = true;
highlighters = ["main" "brackets" "pattern" "root" "line"]; highlighters = [ "main" "brackets" "pattern" "root" "line" ];
}; };
}; };
} }

View file

@ -1,11 +1,10 @@
{ { config
config, , pkgs
pkgs, , lib
lib, , ...
...
}: }:
with lib; { with lib; {
imports = [./hardware-configuration.nix]; imports = [ ./hardware-configuration.nix ];
networking.hostName = "pruflas"; networking.hostName = "pruflas";
@ -16,7 +15,7 @@ with lib; {
package = pkgs.hydra-unstable; package = pkgs.hydra-unstable;
hydraURL = "https://hydra.dadada.li"; hydraURL = "https://hydra.dadada.li";
notificationSender = "hydra@localhost"; notificationSender = "hydra@localhost";
buildMachinesFiles = []; buildMachinesFiles = [ ];
useSubstitutes = true; useSubstitutes = true;
listenHost = "hydra.dadada.li"; listenHost = "hydra.dadada.li";
port = 3000; port = 3000;
@ -26,7 +25,7 @@ with lib; {
{ {
hostName = "localhost"; hostName = "localhost";
system = "x86_64-linux"; system = "x86_64-linux";
supportedFeatures = ["kvm" "nixos-test" "big-parallel" "benchmark"]; supportedFeatures = [ "kvm" "nixos-test" "big-parallel" "benchmark" ];
maxJobs = 8; maxJobs = 8;
} }
]; ];
@ -65,7 +64,7 @@ with lib; {
]; ];
}; };
boot.kernelModules = ["kvm-intel"]; boot.kernelModules = [ "kvm-intel" ];
# Use the systemd-boot EFI boot loader. # Use the systemd-boot EFI boot loader.
boot.loader.systemd-boot.enable = true; boot.loader.systemd-boot.enable = true;
@ -95,12 +94,12 @@ with lib; {
hardware.pulseaudio.enable = false; hardware.pulseaudio.enable = false;
environment.systemPackages = [pkgs.spotify pkgs.mpv]; environment.systemPackages = [ pkgs.spotify pkgs.mpv ];
users.users."media" = { users.users."media" = {
isNormalUser = true; isNormalUser = true;
description = "Media playback user"; description = "Media playback user";
extraGroups = ["users" "video"]; extraGroups = [ "users" "video" ];
}; };
networking.domain = "dadada.li"; networking.domain = "dadada.li";

View file

@ -1,21 +1,20 @@
# 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, , pkgs
pkgs, , modulesPath
modulesPath, , ...
...
}: { }: {
imports = [ imports = [
(modulesPath + "/installer/scan/not-detected.nix") (modulesPath + "/installer/scan/not-detected.nix")
]; ];
boot.initrd.availableKernelModules = ["xhci_pci" "ehci_pci" "ahci" "usb_storage" "sd_mod" "sr_mod" "sdhci_pci"]; boot.initrd.availableKernelModules = [ "xhci_pci" "ehci_pci" "ahci" "usb_storage" "sd_mod" "sr_mod" "sdhci_pci" ];
boot.initrd.kernelModules = []; boot.initrd.kernelModules = [ ];
boot.kernelModules = ["kvm-intel"]; boot.kernelModules = [ "kvm-intel" ];
boot.extraModulePackages = []; boot.extraModulePackages = [ ];
fileSystems."/" = { fileSystems."/" = {
device = "/dev/disk/by-uuid/6d7ea470-1909-4e84-82a6-d5d5e9eecf78"; device = "/dev/disk/by-uuid/6d7ea470-1909-4e84-82a6-d5d5e9eecf78";
@ -32,7 +31,7 @@
fsType = "vfat"; fsType = "vfat";
}; };
swapDevices = []; swapDevices = [ ];
powerManagement.cpuFreqGovernor = lib.mkDefault "performance"; powerManagement.cpuFreqGovernor = lib.mkDefault "performance";
} }

View file

@ -1,11 +1,12 @@
{ { config
config, , pkgs
pkgs, , lib
lib, , ...
... }:
}: let let
hostName = "surgat"; hostName = "surgat";
in { in
{
imports = [ imports = [
./hardware-configuration.nix ./hardware-configuration.nix
]; ];
@ -103,7 +104,7 @@ in {
]; ];
networking.wireguard.interfaces."hydra" = { networking.wireguard.interfaces."hydra" = {
ips = ["10.3.3.1/24"]; ips = [ "10.3.3.1/24" ];
listenPort = 51235; listenPort = 51235;
privateKeyFile = "/var/lib/wireguard/hydra"; privateKeyFile = "/var/lib/wireguard/hydra";
@ -111,7 +112,7 @@ in {
peers = [ peers = [
{ {
publicKey = "CTKwL6+SJIqKXr1DIHejMDgjoxlWPaT78Pz3+JqcNlw="; publicKey = "CTKwL6+SJIqKXr1DIHejMDgjoxlWPaT78Pz3+JqcNlw=";
allowedIPs = ["10.3.3.3/32"]; allowedIPs = [ "10.3.3.3/32" ];
persistentKeepalive = 25; persistentKeepalive = 25;
} }
]; ];

View file

@ -1,21 +1,20 @@
# 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, , pkgs
pkgs, , modulesPath
modulesPath, , ...
...
}: { }: {
imports = [ imports = [
(modulesPath + "/profiles/qemu-guest.nix") (modulesPath + "/profiles/qemu-guest.nix")
]; ];
boot.initrd.availableKernelModules = ["ata_piix" "virtio_pci" "xhci_pci" "sd_mod" "sr_mod"]; boot.initrd.availableKernelModules = [ "ata_piix" "virtio_pci" "xhci_pci" "sd_mod" "sr_mod" ];
boot.initrd.kernelModules = []; boot.initrd.kernelModules = [ ];
boot.kernelModules = []; boot.kernelModules = [ ];
boot.extraModulePackages = []; boot.extraModulePackages = [ ];
fileSystems."/" = { fileSystems."/" = {
device = "/dev/disk/by-uuid/bd0b4d2d-37e5-444b-82ba-d7629114bf11"; device = "/dev/disk/by-uuid/bd0b4d2d-37e5-444b-82ba-d7629114bf11";
@ -29,5 +28,5 @@
fsType = "ext2"; fsType = "ext2";
}; };
swapDevices = []; swapDevices = [ ];
} }

View file

@ -1,62 +1,63 @@
# Adapted from Mic92/dotfiles # Adapted from Mic92/dotfiles
{ { self
self, , flake-utils
flake-utils, , homePage
homePage, , nixpkgs
nixpkgs, , home-manager
home-manager, , nix-doom-emacs
nix-doom-emacs, , nixos-hardware
nixos-hardware, , nvd
nvd, , scripts
scripts, , recipemd
recipemd, , ...
...
} @ inputs: } @ inputs:
(flake-utils.lib.eachDefaultSystem (system: let (flake-utils.lib.eachDefaultSystem (system:
pkgs = nixpkgs.legacyPackages.${system}; let
selfPkgs = self.packages.${system}; pkgs = nixpkgs.legacyPackages.${system};
formatter = self.formatter.${system}; selfPkgs = self.packages.${system};
in { formatter = self.formatter.${system};
apps.nixos-switch = { in
type = "app"; {
program = toString (pkgs.writeScript "deploy" '' apps.nixos-switch = {
#!${pkgs.runtimeShell} type = "app";
flake=$(nix flake metadata --json ${./.} | jq -r .url) program = toString (pkgs.writeScript "deploy" ''
nixos-rebuild switch --flake ".#$1" --use-remote-sudo #!${pkgs.runtimeShell}
''); flake=$(nix flake metadata --json ${./.} | jq -r .url)
}; nixos-rebuild switch --flake ".#$1" --use-remote-sudo
apps.deploy = { '');
type = "app"; };
program = toString (pkgs.writeScript "deploy" '' apps.deploy = {
#!${pkgs.runtimeShell} type = "app";
domain='dadada.li' program = toString (pkgs.writeScript "deploy" ''
flake=$(nix flake metadata --json ${./.} | jq -r .url) #!${pkgs.runtimeShell}
nixos-rebuild switch --upgrade --flake "''${flake}#$1" --target-host "''${1}.$domain" --build-host localhost --use-remote-sudo domain='dadada.li'
''); flake=$(nix flake metadata --json ${./.} | jq -r .url)
}; nixos-rebuild switch --upgrade --flake "''${flake}#$1" --target-host "''${1}.$domain" --build-host localhost --use-remote-sudo
apps.hm-switch = { '');
type = "app"; };
program = toString (pkgs.writeScript "hm-switch" '' apps.hm-switch = {
#!${pkgs.runtimeShell} type = "app";
set -eu -o pipefail -x program = toString (pkgs.writeScript "hm-switch" ''
tmpdir=$(mktemp -d) #!${pkgs.runtimeShell}
export PATH=${pkgs.lib.makeBinPath [pkgs.coreutils pkgs.nixFlakes pkgs.jq]} set -eu -o pipefail -x
trap "rm -rf $tmpdir" EXIT tmpdir=$(mktemp -d)
declare -A profiles=(["gorgon"]="home") export PATH=${pkgs.lib.makeBinPath [pkgs.coreutils pkgs.nixFlakes pkgs.jq]}
profile=''${profiles[$HOSTNAME]:-common} trap "rm -rf $tmpdir" EXIT
flake=$(nix flake metadata --json ${./.} | jq -r .url) declare -A profiles=(["gorgon"]="home")
nix build --out-link "$tmpdir/result" "$flake#hmConfigurations.''${profile}.activationPackage" "$@" profile=''${profiles[$HOSTNAME]:-common}
link=$(realpath $tmpdir/result) flake=$(nix flake metadata --json ${./.} | jq -r .url)
$link/activate nix build --out-link "$tmpdir/result" "$flake#hmConfigurations.''${profile}.activationPackage" "$@"
''); link=$(realpath $tmpdir/result)
}; $link/activate
devShell = pkgs.callPackage ./shell.nix {}; '');
formatter = nixpkgs.legacyPackages."${system}".alejandra; };
checks = { devShell = pkgs.callPackage ./shell.nix { };
format = pkgs.runCommand "check-format" {buildInputs = [formatter];} "${formatter}/bin/alejandra -c ${./.} && touch $out"; formatter = nixpkgs.legacyPackages."${system}".nixpkgs-fmt;
}; checks = {
})) format = pkgs.runCommand "check-format" { buildInputs = [ formatter ]; } "${formatter}/bin/nixpkgs-fmt --check ${./.} && touch $out";
// { };
}))
// {
hmConfigurations = import ./home/configurations.nix { hmConfigurations = import ./home/configurations.nix {
inherit self nixpkgs home-manager; inherit self nixpkgs home-manager;
}; };
@ -71,13 +72,13 @@ in {
hydraJobs = hydraJobs =
( (
nixpkgs.lib.mapAttrs' nixpkgs.lib.mapAttrs'
(name: config: nixpkgs.lib.nameValuePair name config.config.system.build.toplevel) (name: config: nixpkgs.lib.nameValuePair name config.config.system.build.toplevel)
self.nixosConfigurations self.nixosConfigurations
) )
// ( // (
nixpkgs.lib.mapAttrs' nixpkgs.lib.mapAttrs'
(name: config: nixpkgs.lib.nameValuePair name config.activation-script) (name: config: nixpkgs.lib.nameValuePair name config.activation-script)
self.hmConfigurations self.hmConfigurations
) )
// (let tests = import ./tests; in flake-utils.lib.eachDefaultSystem tests); // (let tests = import ./tests; in flake-utils.lib.eachDefaultSystem tests);
} }

View file

@ -1,6 +1,7 @@
let let
python3Packages = import ./python3-packages.nix; python3Packages = import ./python3-packages.nix;
in { in
{
kanboard = final: prev: { kanboard = final: prev: {
kanboard = prev.kanboard.overrideAttrs (oldAttrs: { kanboard = prev.kanboard.overrideAttrs (oldAttrs: {
src = prev.fetchFromGitHub { src = prev.fetchFromGitHub {

View file

@ -2,6 +2,6 @@ self: super: {
python3Packages = python3Packages =
super.python3Packages super.python3Packages
// super.recurseIntoAttrs ( // super.recurseIntoAttrs (
super.python3Packages.callPackage ../pkgs/python-pkgs {} super.python3Packages.callPackage ../pkgs/python-pkgs { }
); );
} }

View file

@ -2,27 +2,27 @@ self: super: {
# Based on https://gist.github.com/clefru/9ed1186bf0b76d27e0ad20cbd9966b87 # Based on https://gist.github.com/clefru/9ed1186bf0b76d27e0ad20cbd9966b87
tubslatex = tubslatex =
super.lib.overrideDerivation super.lib.overrideDerivation
(super.texlive.combine { (super.texlive.combine {
inherit (super.texlive) scheme-full; inherit (super.texlive) scheme-full;
tubslatex.pkgs = [(super.callPackage ../pkgs/tubslatex {})]; tubslatex.pkgs = [ (super.callPackage ../pkgs/tubslatex { }) ];
}) })
(oldAttrs: { (oldAttrs: {
postBuild = postBuild =
'' ''
# Save the udpmap.cfg because texlive.combine removes it. # Save the udpmap.cfg because texlive.combine removes it.
cat $out/share/texmf/web2c/updmap.cfg > $out/share/texmf/web2c/updmap.cfg.1 cat $out/share/texmf/web2c/updmap.cfg > $out/share/texmf/web2c/updmap.cfg.1
'' ''
+ oldAttrs.postBuild + oldAttrs.postBuild
+ '' + ''
# Move updmap.cfg into its original place and rerun mktexlsr, so that kpsewhich finds it # Move updmap.cfg into its original place and rerun mktexlsr, so that kpsewhich finds it
rm $out/share/texmf/web2c/updmap.cfg || true rm $out/share/texmf/web2c/updmap.cfg || true
cat $out/share/texmf/web2c/updmap.cfg.1 > $out/share/texmf/web2c/updmap.cfg cat $out/share/texmf/web2c/updmap.cfg.1 > $out/share/texmf/web2c/updmap.cfg
rm $out/share/texmf/web2c/updmap.cfg.1 rm $out/share/texmf/web2c/updmap.cfg.1
perl `type -P mktexlsr.pl` $out/share/texmf perl `type -P mktexlsr.pl` $out/share/texmf
yes | perl `type -P updmap.pl` --sys --syncwithtrees --force || true yes | perl `type -P updmap.pl` --sys --syncwithtrees --force || true
perl `type -P updmap.pl` --sys --enable Map=NexusProSerif.map --enable Map=NexusProSans.map perl `type -P updmap.pl` --sys --enable Map=NexusProSerif.map --enable Map=NexusProSans.map
# Regenerate .map files. # Regenerate .map files.
perl `type -P updmap.pl` --sys perl `type -P updmap.pl` --sys
''; '';
}); });
} }

View file

@ -1,2 +1 @@
{callPackage}: { { callPackage }: { }
}

View file

@ -1,7 +1,7 @@
{ { pkgs
pkgs, , stdenv
stdenv, , lib
lib, ,
}: (import }: (import
(pkgs.fetchgit { (pkgs.fetchgit {
url = "https://git.dadada.li/dadada/scripts.git"; url = "https://git.dadada.li/dadada/scripts.git";

View file

@ -1,13 +1,13 @@
{ { stdenv
stdenv, , fetchzip
fetchzip, , unzip
unzip, ,
}: }:
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
src = ./tubslatex_1.3.2.tds.zip; src = ./tubslatex_1.3.2.tds.zip;
sourceRoot = "."; sourceRoot = ".";
nativeBuildInputs = [unzip]; nativeBuildInputs = [ unzip ];
buildInputs = [unzip]; buildInputs = [ unzip ];
installPhase = '' installPhase = ''
mkdir -p $out mkdir -p $out
cp -r * $out/ cp -r * $out/

View file

@ -1,8 +1,7 @@
{ { pkgs
pkgs, , lib
lib, , fetchFromGitHub
fetchFromGitHub, , ...
...
}: }:
with lib; { with lib; {
filetype = pkgs.vimUtils.buildVimPluginFrom2Nix { filetype = pkgs.vimUtils.buildVimPluginFrom2Nix {

View file

@ -1,4 +1,4 @@
{mkShell}: { mkShell }:
mkShell { mkShell {
buildInputs = [ buildInputs = [
]; ];

View file

@ -1,2 +1 @@
system: { system: { }
}