From 47c5c9dc56271c3a9b2d5305b6d12df9be74c0e4 Mon Sep 17 00:00:00 2001 From: Stefan Junker Date: Mon, 31 Oct 2022 11:04:38 +0100 Subject: [PATCH] chore: nixfmt * --- _archive/environments/dev/cross.nix | 14 +- _archive/environments/dev/go/default.nix | 37 +- _archive/environments/dev/go/neovim-go.nix | 8 +- _archive/environments/dev/pandoc.nix | 34 +- _archive/environments/dev/rkt.nix | 9 +- _archive/environments/dev/rust/default.nix | 33 +- _archive/environments/dev/vim-go.nix | 27 +- _archive/environments/dev/vim-pandoc.nix | 12 +- _archive/environments/dev/vim-rust.nix | 11 +- _archive/environments/fhs/android.nix | 69 +-- _archive/environments/fhs/vscode.nix | 11 +- .../nixos-configuration/common/pkg/neovim.nix | 4 +- .../nixos-configuration/common/pkg/vim.nix | 6 +- .../common/user/steveej.nix | 6 +- default.nix | 3 +- nix/container-images/default.nix | 101 ++-- nix/default.nix | 15 +- .../configuration/graphical-fullblown.nix | 450 +++++++++--------- .../configuration/graphical-gnome3.nix | 159 +++---- .../configuration/graphical-removable.nix | 159 +++---- .../configuration/text-minimal.nix | 24 +- nix/home-manager/lib.nix | 13 +- nix/home-manager/profiles/common.nix | 35 +- nix/home-manager/profiles/dotfiles.nix | 8 +- .../profiles/dotfiles/vcsh.tmpl.nix | 49 +- nix/home-manager/profiles/nix-channels.nix | 45 +- nix/home-manager/profiles/qtile-desktop.nix | 408 ++++++++-------- nix/home-manager/programs/chromium.nix | 19 +- nix/home-manager/programs/emacs.nix | 34 +- nix/home-manager/programs/firefox.nix | 15 +- .../programs/holochain-launcher.nix | 4 +- nix/home-manager/programs/homeshick.nix | 49 +- nix/home-manager/programs/libreoffice.nix | 8 +- nix/home-manager/programs/neovim.nix | 205 ++++---- nix/home-manager/programs/pass.nix | 20 +- nix/home-manager/programs/podman.nix | 86 ++-- nix/home-manager/programs/vscode/default.nix | 14 +- nix/home-manager/programs/zsh.nix | 63 ++- nix/ops/nano/configuration.nix | 7 +- nix/ops/nano/hardware-configuration.nix | 15 +- nix/ops/nanos@kn.nix | 31 +- nix/os/containers/backup-target.nix | 65 +-- nix/os/containers/backup.nix | 57 +-- nix/os/containers/mailserver.nix | 104 ++-- nix/os/containers/syncthing.nix | 11 +- nix/os/containers/webserver.nix | 37 +- nix/os/devices/167.233.1.14/boot.nix | 4 +- nix/os/devices/167.233.1.14/configuration.nix | 3 +- nix/os/devices/167.233.1.14/hw.nix | 15 +- nix/os/devices/167.233.1.14/pkg.nix | 49 +- nix/os/devices/167.233.1.14/system.nix | 44 +- nix/os/devices/167.233.1.14/versions.nix | 3 +- nix/os/devices/167.233.1.14/versions.tmpl.nix | 35 +- nix/os/devices/default.nix | 61 +-- nix/os/devices/disk.nix | 60 ++- nix/os/devices/elias-e525/boot.nix | 6 +- nix/os/devices/elias-e525/hw.nix | 3 +- nix/os/devices/elias-e525/pkg.nix | 73 ++- nix/os/devices/elias-e525/system.nix | 19 +- nix/os/devices/elias-e525/user.nix | 4 +- nix/os/devices/elias-e525/versions.nix | 7 +- nix/os/devices/elias-e525/versions.tmpl.nix | 23 +- nix/os/devices/fwhost1/boot.nix | 6 +- nix/os/devices/fwhost1/hw.nix | 6 +- nix/os/devices/fwhost1/pkg.nix | 24 +- nix/os/devices/fwhost1/system.nix | 20 +- nix/os/devices/fwhost1/user.nix | 7 +- nix/os/devices/fwhost1/versions.nix | 7 +- nix/os/devices/fwhost1/versions.tmpl.nix | 23 +- nix/os/devices/fwhost2/boot.nix | 6 +- nix/os/devices/fwhost2/hw.nix | 6 +- nix/os/devices/fwhost2/pkg.nix | 24 +- nix/os/devices/fwhost2/system.nix | 21 +- nix/os/devices/fwhost2/user.nix | 4 +- nix/os/devices/fwhost2/versions.nix | 7 +- nix/os/devices/fwhost2/versions.tmpl.nix | 23 +- .../srv0.home-ch.stefanjunker.de/boot.nix | 4 +- .../configuration.nix | 3 +- .../srv0.home-ch.stefanjunker.de/hw.nix | 8 +- .../srv0.home-ch.stefanjunker.de/pkg.nix | 33 +- .../srv0.home-ch.stefanjunker.de/system.nix | 27 +- .../srv0.home-ch.stefanjunker.de/versions.nix | 3 +- .../versions.tmpl.nix | 15 +- .../devices/steveej-nuc7pjyh-work/system.nix | 2 +- nix/os/devices/steveej-nuc7pjyh-work/user.nix | 19 +- nix/os/devices/steveej-pa600/boot.nix | 6 +- nix/os/devices/steveej-pa600/hw.nix | 8 +- nix/os/devices/steveej-pa600/pkg.nix | 18 +- nix/os/devices/steveej-pa600/system.nix | 19 +- nix/os/devices/steveej-pa600/user.nix | 4 +- nix/os/devices/steveej-pa600/versions.nix | 7 +- .../devices/steveej-pa600/versions.tmpl.nix | 23 +- .../system.nix | 3 +- .../steveej-rmvbl-sdep0/configuration.nix | 9 +- .../devices/steveej-rmvbl-sdep0/versions.nix | 17 +- nix/os/devices/steveej-t14/boot.nix | 7 +- nix/os/devices/steveej-t14/hw.nix | 5 +- nix/os/devices/steveej-t14/pkg.nix | 18 +- nix/os/devices/steveej-t14/system.nix | 45 +- nix/os/devices/steveej-t14/user.nix | 4 +- nix/os/devices/steveej-t14/versions.nix | 7 +- nix/os/devices/steveej-t14/versions.tmpl.nix | 27 +- .../steveej-t480s-work/configuration.nix | 4 +- nix/os/devices/steveej-t480s-work/hw.nix | 5 +- nix/os/devices/steveej-t480s-work/pkg.nix | 18 +- nix/os/devices/steveej-t480s-work/system.nix | 47 +- nix/os/devices/steveej-t480s-work/user.nix | 4 +- .../devices/steveej-t480s-work/versions.nix | 7 +- .../steveej-t480s-work/versions.tmpl.nix | 23 +- .../steveej-utilitepro/configuration.nix | 421 ++++++++-------- .../hardware-configuration.nix | 20 +- .../vmd32387.contaboserver.net/boot.nix | 4 +- .../configuration.nix | 3 +- .../devices/vmd32387.contaboserver.net/hw.nix | 8 +- .../vmd32387.contaboserver.net/pkg.nix | 49 +- .../vmd32387.contaboserver.net/system.nix | 32 +- .../vmd32387.contaboserver.net/versions.nix | 7 +- .../versions.tmpl.nix | 39 +- nix/os/lib/default.nix | 67 +-- nix/os/modules/ddclient-ovh.nix | 27 +- nix/os/modules/initrd-network.nix | 37 +- nix/os/modules/natrouter.nix | 6 +- nix/os/modules/opinionatedDisk.nix | 30 +- nix/os/profiles/common/boot.nix | 9 +- nix/os/profiles/common/configuration.nix | 8 +- nix/os/profiles/common/hw.nix | 10 +- nix/os/profiles/common/pkg.nix | 16 +- nix/os/profiles/common/system.nix | 18 +- nix/os/profiles/common/user.nix | 8 +- nix/os/profiles/containers/configuration.nix | 8 +- nix/os/profiles/graphical/boot.nix | 8 +- nix/os/profiles/graphical/configuration.nix | 10 +- nix/os/profiles/graphical/hw.nix | 4 +- nix/os/profiles/graphical/system.nix | 33 +- nix/os/profiles/install-medium/iso/iso.nix | 100 ++-- nix/os/profiles/podman/configuration.nix | 10 +- nix/os/profiles/removable-medium/boot.nix | 6 +- .../removable-medium/configuration.nix | 2 +- nix/os/profiles/removable-medium/pkg.nix | 9 +- nix/os/profiles/removable-medium/system.nix | 5 +- nix/overlays/overrides.nix | 20 +- nix/overlays/pkgs.nix | 14 +- nix/overlays/posh.nix | 4 +- nix/pkgs/browserpass/default.nix | 41 +- nix/pkgs/default.nix | 148 +++--- nix/pkgs/duplicacy/default.nix | 4 +- nix/pkgs/duplicacy/deps.nix | 150 +++--- nix/pkgs/duplicacy/shell.nix | 4 +- nix/pkgs/mfcl3770cdw.nix | 50 +- nix/pkgs/nozbe/default.nix | 100 ++-- nix/pkgs/posh.nix | 95 ++-- nix/pkgs/slirp4netns.nix | 23 +- nix/pkgs/staruml.nix | 39 +- nix/sources.nix | 259 +++++----- nix/tests/buildvmwithbootloader/build-vm.nix | 39 +- .../buildvmwithbootloader/configuration.nix | 30 +- nix/tests/test-vm.nix | 5 +- nix/variables/passwords.crypt.nix | Bin 1799 -> 1797 bytes nix/variables/versions.nix | 7 +- nix/variables/versions.tmpl.nix | 23 +- shell.nix | 17 +- 161 files changed, 2693 insertions(+), 3029 deletions(-) diff --git a/_archive/environments/dev/cross.nix b/_archive/environments/dev/cross.nix index 59b6b3d..9031875 100644 --- a/_archive/environments/dev/cross.nix +++ b/_archive/environments/dev/cross.nix @@ -1,6 +1,6 @@ import /home/steveej/src/github/NixOS/nixpkgs/default.nix { crossSystem = rec { - config = "armv7l-unknown-linux-gnueabi"; + config = "armv7l-unknown-linux-gnueabi"; bigEndian = false; arch = "arm"; float = "hard"; @@ -21,12 +21,12 @@ import /home/steveej/src/github/NixOS/nixpkgs/default.nix { kernelDTB = true; kernelAutoModules = false; kernelExtraConfig = '' - NAMESPACES y - BTRFS_FS y - BTRFS_FS_POSIX_ACL y - OVERLAY_FS y - FUSE_FS y - ''; + NAMESPACES y + BTRFS_FS y + BTRFS_FS_POSIX_ACL y + OVERLAY_FS y + FUSE_FS y + ''; kernelTarget = "zImage"; uboot = null; }; diff --git a/_archive/environments/dev/go/default.nix b/_archive/environments/dev/go/default.nix index e67468d..19366f6 100644 --- a/_archive/environments/dev/go/default.nix +++ b/_archive/environments/dev/go/default.nix @@ -1,10 +1,5 @@ -{ gitpkgs ? import /home/steveej/src/github/NixOS/nixpkgs {} -, pkgs ? gitpkgs -, name ? "generic" -, version -, extraBuildInputs ? [] -, extraShellHook ? "" -}: +{ gitpkgs ? import /home/steveej/src/github/NixOS/nixpkgs { }, pkgs ? gitpkgs +, name ? "generic", version, extraBuildInputs ? [ ], extraShellHook ? "" }: let go = builtins.getAttr "go_${version}" pkgs; commonVimRC = '' @@ -55,21 +50,21 @@ let " } ''; buildInputs = with pkgs; [ - glibc.out - glibc.static + glibc.out + glibc.static - go - gotools - #gotools.bin - #gocode.bin - #godef godef.bin - godep - #godep.bin - gox.bin - #ginkgo ginkgo.bin - #gomega -# ( import ./vim-go.nix { pkgs=gitpkgs; commonRC=commonVimRC; } ) -# ( import ./neovim-go.nix { pkgs=gitpkgs; commonRC=commonVimRC; } ) + go + gotools + #gotools.bin + #gocode.bin + #godef godef.bin + godep + #godep.bin + gox.bin + #ginkgo ginkgo.bin + #gomega + # ( import ./vim-go.nix { pkgs=gitpkgs; commonRC=commonVimRC; } ) + # ( import ./neovim-go.nix { pkgs=gitpkgs; commonRC=commonVimRC; } ) ]; in pkgs.stdenv.mkDerivation { diff --git a/_archive/environments/dev/go/neovim-go.nix b/_archive/environments/dev/go/neovim-go.nix index c160104..771398a 100644 --- a/_archive/environments/dev/go/neovim-go.nix +++ b/_archive/environments/dev/go/neovim-go.nix @@ -1,4 +1,4 @@ -{ commonRC, ... } @ args : +{ commonRC, ... }@args: (import ../../pkg-configuration/vim-derivates/neovim.nix args // { additionalRC = commonRC + '' @@ -7,9 +7,5 @@ let g:deoplete#enable_smart_case = 1 " } ''; - additionalPlugins = [ - "deoplete-go" - "deoplete-nvim" - "vim-go" - ]; + additionalPlugins = [ "deoplete-go" "deoplete-nvim" "vim-go" ]; }) diff --git a/_archive/environments/dev/pandoc.nix b/_archive/environments/dev/pandoc.nix index 93a3fb1..19e7ecd 100644 --- a/_archive/environments/dev/pandoc.nix +++ b/_archive/environments/dev/pandoc.nix @@ -1,23 +1,21 @@ -{ gitpkgs ? import /home/steveej/src/github/NixOS/nixpkgs {} -, pkgs ? gitpkgs -, name ? "generic" -, version ? "Stable" -, extraBuildInputs ? [] -}: -let - commonVimRC = '' - ''; +{ gitpkgs ? import /home/steveej/src/github/NixOS/nixpkgs { }, pkgs ? gitpkgs +, name ? "generic", version ? "Stable", extraBuildInputs ? [ ] }: +let commonVimRC = ""; in pkgs.stdenv.mkDerivation { inherit name; - buildInputs = with pkgs; [ - ( import ./vim-pandoc.nix { pkgs=gitpkgs; commonRC=commonVimRC; }) - pandoc - texlive.combined.scheme-medium - python27Packages.pandocfilters - python27Packages.htmltreediff - python27Packages.html5lib - python27Packages.dbus-python - ] ++ extraBuildInputs; + buildInputs = with pkgs; + [ + (import ./vim-pandoc.nix { + pkgs = gitpkgs; + commonRC = commonVimRC; + }) + pandoc + texlive.combined.scheme-medium + python27Packages.pandocfilters + python27Packages.htmltreediff + python27Packages.html5lib + python27Packages.dbus-python + ] ++ extraBuildInputs; shellHook = '' pandocname=pandoc_${pkgs.pandoc.version} setPS1 $pandocname diff --git a/_archive/environments/dev/rkt.nix b/_archive/environments/dev/rkt.nix index 072018c..ddac04d 100644 --- a/_archive/environments/dev/rkt.nix +++ b/_archive/environments/dev/rkt.nix @@ -1,9 +1,6 @@ -{ -pkgs ? import /home/steveej/src/github/NixOS/nixpkgs {}, -mkGoEnv ? import ./go.nix, -rktPath, -}: -let +{ pkgs ? import /home/steveej/src/github/NixOS/nixpkgs { } +, mkGoEnv ? import ./go.nix, rktPath, }: +let rktBasebuildInputs = with pkgs; [ glibc.out glibc.static diff --git a/_archive/environments/dev/rust/default.nix b/_archive/environments/dev/rust/default.nix index acb6104..c0c8958 100644 --- a/_archive/environments/dev/rust/default.nix +++ b/_archive/environments/dev/rust/default.nix @@ -1,10 +1,6 @@ -{ gitpkgs ? import /home/steveej/src/github/NixOS/nixpkgs {} -, pkgs ? gitpkgs -, name ? "generic" -, version ? "Stable" -, extraBuildInputs ? [] -}: -let +{ gitpkgs ? import /home/steveej/src/github/NixOS/nixpkgs { }, pkgs ? gitpkgs +, name ? "generic", version ? "Stable", extraBuildInputs ? [ ] }: +let rustPackages = builtins.getAttr "rust${version}" pkgs; rustc = rustPackages.rustc; rustShellHook = { rustc, name }: '' @@ -12,20 +8,21 @@ let setPS1 $rustname unset name ''; - commonVimRC = '' - ''; + commonVimRC = ""; in pkgs.stdenv.mkDerivation { inherit name; - buildInputs = with rustPackages;[ - ( import ./vim-rust.nix { pkgs=gitpkgs; commonRC=commonVimRC; + buildInputs = with rustPackages; + [ + (import ./vim-rust.nix { + pkgs = gitpkgs; + commonRC = commonVimRC; inherit rustc; - racerd=pkgs.rustracerd; - }) - rustc cargo - ] ++ [ - pkgs.rustfmt - ] ++ extraBuildInputs; - shellHook = (rustShellHook){ + racerd = pkgs.rustracerd; + }) + rustc + cargo + ] ++ [ pkgs.rustfmt ] ++ extraBuildInputs; + shellHook = (rustShellHook) { inherit name; inherit rustc; }; diff --git a/_archive/environments/dev/vim-go.nix b/_archive/environments/dev/vim-go.nix index 977d555..e93bdf5 100644 --- a/_archive/environments/dev/vim-go.nix +++ b/_archive/environments/dev/vim-go.nix @@ -1,20 +1,17 @@ -{ commonRC, ... } @ args : +{ commonRC, ... }@args: import ../../pkg-configuration/vim-derivates/vim.nix (args // { name = "vim-for-go"; additionalRC = commonRC + '' - " Disable AutoComplPop. - let g:acp_enableAtStartup = 0 - " Use neocomplete. - let g:neocomplete#enable_at_startup = 1 - " Use smartcase. - let g:neocomplete#enable_smart_case = 1 - if !exists('g:neocomplete#sources#omni#input_patterns') - let g:neocomplete#sources#omni#input_patterns = {} - endif - ''; - additionalPlugins = [ - "neocomplete" - "vim-go" - ]; + " Disable AutoComplPop. + let g:acp_enableAtStartup = 0 + " Use neocomplete. + let g:neocomplete#enable_at_startup = 1 + " Use smartcase. + let g:neocomplete#enable_smart_case = 1 + if !exists('g:neocomplete#sources#omni#input_patterns') + let g:neocomplete#sources#omni#input_patterns = {} + endif + ''; + additionalPlugins = [ "neocomplete" "vim-go" ]; }) diff --git a/_archive/environments/dev/vim-pandoc.nix b/_archive/environments/dev/vim-pandoc.nix index 7e17759..ad9b782 100644 --- a/_archive/environments/dev/vim-pandoc.nix +++ b/_archive/environments/dev/vim-pandoc.nix @@ -1,6 +1,4 @@ -{ commonRC -, -... } @ args : +{ commonRC, ... }@args: import ../../pkg-configuration/vim-derivates/vim.nix (args // { name = "vim-for-pandoc"; @@ -13,10 +11,6 @@ import ../../pkg-configuration/vim-derivates/vim.nix (args // { let g:syntastic_auto_loc_list = 1 let g:syntastic_check_on_open = 1 let g:syntastic_check_on_wq = 0 - ''; - additionalPlugins = [ - "vim-pandoc" - "vim-pandoc-syntax" - "vimpreviewpandoc" - ]; + ''; + additionalPlugins = [ "vim-pandoc" "vim-pandoc-syntax" "vimpreviewpandoc" ]; }) diff --git a/_archive/environments/dev/vim-rust.nix b/_archive/environments/dev/vim-rust.nix index 4b4ade9..233c95a 100644 --- a/_archive/environments/dev/vim-rust.nix +++ b/_archive/environments/dev/vim-rust.nix @@ -1,7 +1,4 @@ -{ commonRC -, rustc -, racerd, -... } @ args : +{ commonRC, rustc, racerd, ... }@args: import ../../pkg-configuration/vim-derivates/vim.nix (args // { name = "vim-for-rust"; @@ -39,8 +36,6 @@ import ../../pkg-configuration/vim-derivates/vim.nix (args // { let g:ycm_rust_src_path = '${rustc.src}/src' let g:ycm_racerd_binary_path = '${racerd.out}/bin/racerd' - ''; - additionalPlugins = [ - "rust-vim" - ]; + ''; + additionalPlugins = [ "rust-vim" ]; }) diff --git a/_archive/environments/fhs/android.nix b/_archive/environments/fhs/android.nix index 616618b..3ff6787 100644 --- a/_archive/environments/fhs/android.nix +++ b/_archive/environments/fhs/android.nix @@ -1,40 +1,41 @@ -{ pkgs ? import {} }: +{ pkgs ? import { } }: (pkgs.buildFHSUserEnv { name = "devfhs"; - multiPkgs = pkgs: (with pkgs; [ - android-udev-rules - sudo - gawk - bzip2 - file - gcc - getopt - git - gnumake - ncurses - openssl - patch - perl - pkgconfig - python - openssh - subversion - unzip - wget - which - vim - zlib - libusb - libusb1 - systemd - strace - swt - xorg.libXtst - glib - gtk2 - gnome.gtk - ]); + multiPkgs = pkgs: + (with pkgs; [ + android-udev-rules + sudo + gawk + bzip2 + file + gcc + getopt + git + gnumake + ncurses + openssl + patch + perl + pkgconfig + python + openssh + subversion + unzip + wget + which + vim + zlib + libusb + libusb1 + systemd + strace + swt + xorg.libXtst + glib + gtk2 + gnome.gtk + ]); profile = '' export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/lib:/lib64:/lib32:/usr/lib32:/usr/lib64:${pkgs.xorg.libXtst}/lib:${pkgs.glib}/lib:${pkgs.gtk2}/lib ''; diff --git a/_archive/environments/fhs/vscode.nix b/_archive/environments/fhs/vscode.nix index e6d3b4b..23a39e2 100644 --- a/_archive/environments/fhs/vscode.nix +++ b/_archive/environments/fhs/vscode.nix @@ -1,9 +1,10 @@ -{ pkgs ? import {} }: +{ pkgs ? import { } }: (pkgs.buildFHSUserEnv { name = "everydayFHS"; - targetPkgs = pkgs: (with pkgs; - [ which + targetPkgs = pkgs: + (with pkgs; [ + which gitFull zsh file @@ -28,9 +29,7 @@ zlib libsecret ]); - multiPkgs = pkgs: (with pkgs; - [ - ]); + multiPkgs = pkgs: (with pkgs; [ ]); profile = '' export SHELL=/bin/zsh ''; diff --git a/_archive/nixos-configuration/common/pkg/neovim.nix b/_archive/nixos-configuration/common/pkg/neovim.nix index 2226a39..8852392 100644 --- a/_archive/nixos-configuration/common/pkg/neovim.nix +++ b/_archive/nixos-configuration/common/pkg/neovim.nix @@ -1,6 +1,4 @@ -{ config -, pkgs -, ... } @ args: +{ config, pkgs, ... }@args: { environment.systemPackages = [ diff --git a/_archive/nixos-configuration/common/pkg/vim.nix b/_archive/nixos-configuration/common/pkg/vim.nix index d3cd726..ee76e6d 100644 --- a/_archive/nixos-configuration/common/pkg/vim.nix +++ b/_archive/nixos-configuration/common/pkg/vim.nix @@ -1,9 +1,9 @@ -{ pkgs -, ... } @ args: +{ pkgs, ... }@args: { environment.systemPackages = [ pkgs.xsel - (import ../../../pkg-configuration/vim-derivates/vim.nix (args // { name = "vim"; })) + (import ../../../pkg-configuration/vim-derivates/vim.nix + (args // { name = "vim"; })) ]; } diff --git a/_archive/nixos-configuration/common/user/steveej.nix b/_archive/nixos-configuration/common/user/steveej.nix index dbea0b7..b3e68cd 100644 --- a/_archive/nixos-configuration/common/user/steveej.nix +++ b/_archive/nixos-configuration/common/user/steveej.nix @@ -1,8 +1,6 @@ -{ config -, pkgs -, ... }: +{ config, pkgs, ... }: -let +let passwords = import ../passwords.crypt.nix; keys = import ../keys.nix; inherit (import ../lib) mkUser; diff --git a/default.nix b/default.nix index b5e1171..bc8ccf6 100644 --- a/default.nix +++ b/default.nix @@ -5,8 +5,7 @@ # commands such as: # nix-build -A mypackage -{ pkgs ? import {} }: - +{ pkgs ? import { } }: { overlays = import ./nix/overlays; diff --git a/nix/container-images/default.nix b/nix/container-images/default.nix index e6d6f0b..691c0ce 100644 --- a/nix/container-images/default.nix +++ b/nix/container-images/default.nix @@ -1,11 +1,6 @@ -{ pkgs ? import {} -}: - -let - baseEnv = [ - "SSL_CERT_FILE=${pkgs.cacert}/etc/ssl/certs/ca-bundle.crt" - ]; +{ pkgs ? import { } }: +let baseEnv = [ "SSL_CERT_FILE=${pkgs.cacert}/etc/ssl/certs/ca-bundle.crt" ]; in rec { @@ -29,19 +24,12 @@ in rec { interactive_base = pkgs.dockerTools.buildImage { name = "interactive_base"; fromImage = base; - contents = with pkgs; [ - procps - zsh - coreutils - neovim - ]; + contents = with pkgs; [ procps zsh coreutils neovim ]; - config = { - Cmd = [ "/bin/zsh" ]; - }; + config = { Cmd = [ "/bin/zsh" ]; }; }; - s3ql = let + s3ql = let entrypoint = pkgs.writeScript "entrypoint" '' #!${pkgs.stdenv.shell} @@ -84,40 +72,37 @@ in rec { # FIXME: touch .isbucket after mount ''; - in pkgs.dockerTools.buildImage { - name = "s3ql"; - fromImage = interactive_base; - contents = [ - pkgs.s3ql - pkgs.fuse - ]; + in pkgs.dockerTools.buildImage { + name = "s3ql"; + fromImage = interactive_base; + contents = [ pkgs.s3ql pkgs.fuse ]; - runAsRoot = '' - #!${pkgs.stdenv.shell} - mkdir -p /usr/bin - cp -a ${pkgs.fuse}/bin/fusermount /usr/bin - chmod +s /usr/bin/fusermount - echo user_allow_other >> /etc/fuse.conf - ''; - - config = { - Env = baseEnv ++ [ - "HOME=/home/s3ql" - "S3QL_CACHE_DIR=/var/cache/s3ql" - "S3QL_AUTHINFO2=/etc/s3ql/authinfo2" - "CONTAINER_ENTRYPOINT=${entrypoint}" - ]; - Cmd = [ entrypoint ]; - Volumes = { - "/var/cache/s3ql" = {}; - "/etc/s3ql/authinfo2" = {}; - "/buckets" = {}; - "/tmp" = {}; + runAsRoot = '' + #!${pkgs.stdenv.shell} + mkdir -p /usr/bin + cp -a ${pkgs.fuse}/bin/fusermount /usr/bin + chmod +s /usr/bin/fusermount + echo user_allow_other >> /etc/fuse.conf + ''; + + config = { + Env = baseEnv ++ [ + "HOME=/home/s3ql" + "S3QL_CACHE_DIR=/var/cache/s3ql" + "S3QL_AUTHINFO2=/etc/s3ql/authinfo2" + "CONTAINER_ENTRYPOINT=${entrypoint}" + ]; + Cmd = [ entrypoint ]; + Volumes = { + "/var/cache/s3ql" = { }; + "/etc/s3ql/authinfo2" = { }; + "/buckets" = { }; + "/tmp" = { }; }; }; }; - syncthing = let + syncthing = let entrypoint = pkgs.writeScript "entrypoint" '' #!${pkgs.stdenv.shell} set -x @@ -140,19 +125,15 @@ in rec { -gui-address=$SYNCTHING_GUI_ADDRESS \ -no-browser ''; - in pkgs.dockerTools.buildImage { - name = "syncthing"; - fromImage = interactive_base; - contents = pkgs.syncthing; - - config = { - Env = baseEnv ++ [ - "SYNCTHING_HOME=/home/syncthing" - ]; - Cmd = [ entrypoint ]; - Volumes = { - "/data" = {}; - }; - }; + in pkgs.dockerTools.buildImage { + name = "syncthing"; + fromImage = interactive_base; + contents = pkgs.syncthing; + + config = { + Env = baseEnv ++ [ "SYNCTHING_HOME=/home/syncthing" ]; + Cmd = [ entrypoint ]; + Volumes = { "/data" = { }; }; }; + }; } diff --git a/nix/default.nix b/nix/default.nix index 7a19c2d..6aab683 100644 --- a/nix/default.nix +++ b/nix/default.nix @@ -3,25 +3,22 @@ let channelVersions = (import versionsPath); mkChannelSource = name: - let - channelVersion = builtins.getAttr name channelVersions; + let channelVersion = builtins.getAttr name channelVersions; in builtins.fetchGit { # Descriptive name to make the store path easier to identify inherit name; inherit (channelVersion) url ref rev; - }; + }; nixPath = builtins.concatStringsSep ":" (builtins.map (elemName: let elem = builtins.getAttr elemName channelVersions; elemPath = (mkChannelSource elemName); suffix = if builtins.hasAttr "suffix" elem then elem.suffix else ""; - in - builtins.concatStringsSep "=" [ elemName elemPath ] + suffix - ) (builtins.attrNames channelVersions)); - pkgs = import (mkChannelSource "nixpkgs") {}; -in + in builtins.concatStringsSep "=" [ elemName elemPath ] + suffix) + (builtins.attrNames channelVersions)); + pkgs = import (mkChannelSource "nixpkgs") { }; -{ +in { inherit nixPath; channelSources = pkgs.writeText "channels.rc" '' export NIX_PATH=${nixPath} diff --git a/nix/home-manager/configuration/graphical-fullblown.nix b/nix/home-manager/configuration/graphical-fullblown.nix index 619a3cb..71a808e 100644 --- a/nix/home-manager/configuration/graphical-fullblown.nix +++ b/nix/home-manager/configuration/graphical-fullblown.nix @@ -1,16 +1,13 @@ { pkgs }: -let - zshCurried = import ../programs/zsh.nix { inherit pkgs; }; -in +let zshCurried = import ../programs/zsh.nix { inherit pkgs; }; -{ pkgs -, config -, ... }: +in { pkgs, config, ... }: let # gitpkgs = import /home/steveej/src/github/NixOS/nixpkgs {}; - unstablepkgs = import { config = config.nixpkgs.config; }; + unstablepkgs = + import { config = config.nixpkgs.config; }; masterpkgs = import { config = config.nixpkgs.config; }; in { @@ -37,274 +34,255 @@ in { gnutls = true; }; - packageOverrides = pkgs: with pkgs; { - }; + packageOverrides = pkgs: with pkgs; { }; }; home.sessionVariables = { # TODO: find a way to prevent using a store path for the current file # HM_CONFIG_PATH=builtins.toString "${./.}"; - HM_CONFIG="graphical-fullblown"; + HM_CONFIG = "graphical-fullblown"; - GOPATH="$HOME/src/go"; + GOPATH = "$HOME/src/go"; - PATH=pkgs.lib.concatStringsSep ":" [ - "$HOME/.local/bin" - "$PATH" - ]; + PATH = pkgs.lib.concatStringsSep ":" [ "$HOME/.local/bin" "$PATH" ]; }; - home.packages = [] - ++ (with pkgs; [ - # Authentication - cacert - fprintd - openssl - mkpasswd + home.packages = [ ] ++ (with pkgs; [ + # Authentication + cacert + fprintd + openssl + mkpasswd - # Nix package related tools - patchelf - nix-index - nox - nix-prefetch-scripts - nix-prefetch-github + # Nix package related tools + patchelf + nix-index + nox + nix-prefetch-scripts + nix-prefetch-github - # Version Control Systems - pijul - gitless - gitRepo - git-lfs + # Version Control Systems + pijul + gitless + gitRepo + git-lfs - # Process/System Administration - htop - gnome.gnome-tweaks - xorg.xhost - dmidecode - evtest + # Process/System Administration + htop + gnome.gnome-tweaks + xorg.xhost + dmidecode + evtest - # Archive Managers - sshfs-fuse - xarchive - p7zip - zip - unzip - gzip - lzop + # Archive Managers + sshfs-fuse + xarchive + p7zip + zip + unzip + gzip + lzop - # Password Management - gnupg - yubikey-manager - yubikey-manager-qt - yubikey-personalization - yubikey-personalization-gui - gnome.gnome-keyring - gnome.seahorse + # Password Management + gnupg + yubikey-manager + yubikey-manager-qt + yubikey-personalization + yubikey-personalization-gui + gnome.gnome-keyring + gnome.seahorse - # Language Support - hunspellDicts.en-us - hunspellDicts.de-de + # Language Support + hunspellDicts.en-us + hunspellDicts.de-de - # Messaging/Communication - signal-desktop - pidgin - hexchat - aspellDicts.en - aspellDicts.de - skypeforlinux - unstablepkgs.jitsi-meet-electron - unstablepkgs.zoom-us - thunderbird - evolution # gnome4.glib_networking - kotatogram-desktop - gnome.cheese - masterpkgs.discord + # Messaging/Communication + signal-desktop + pidgin + hexchat + aspellDicts.en + aspellDicts.de + skypeforlinux + unstablepkgs.jitsi-meet-electron + unstablepkgs.zoom-us + thunderbird + evolution # gnome4.glib_networking + kotatogram-desktop + gnome.cheese + masterpkgs.discord - # Virtualization - virtmanager - # (pkgs.lib.hiPrio qemu) - # virtualbox - # vagrant - # docker_compose - # unstablepkgs.kubernetes - # unstablepkgs.minikube - # unstablepkgs.openshift - # (unstablepkgs.minikube.overrideAttrs (oldAttrs: { - # patches = oldAttrs.patches ++ [ - # (builtins.fetchurl { url ="https://patch-diff.githubusercontent.com/raw/kubernetes/minikube/pull/2517.diff"; }) - # ]; - # })) - appimage-run + # Virtualization + virtmanager + # (pkgs.lib.hiPrio qemu) + # virtualbox + # vagrant + # docker_compose + # unstablepkgs.kubernetes + # unstablepkgs.minikube + # unstablepkgs.openshift + # (unstablepkgs.minikube.overrideAttrs (oldAttrs: { + # patches = oldAttrs.patches ++ [ + # (builtins.fetchurl { url ="https://patch-diff.githubusercontent.com/raw/kubernetes/minikube/pull/2517.diff"; }) + # ]; + # })) + appimage-run + # Remote Control Tools + remmina + freerdp + teamviewer + rustdesk - # Remote Control Tools - remmina - freerdp - teamviewer - rustdesk + # Audio/Video Players + ffmpeg + vlc + audacity + spotify + youtube-dl-light + libwebcam - # Audio/Video Players - ffmpeg - vlc - audacity - spotify - youtube-dl-light - libwebcam + # Network Tools + openvpn + tcpdump + iftop + iperf + bind + socat + # 2019-03-05: broken on 19.03 linssid + iptraf-ng + ipmitool - # Network Tools - openvpn - tcpdump - iftop - iperf - bind - socat - # 2019-03-05: broken on 19.03 linssid - iptraf-ng - ipmitool + # samba + iptables + nftables + wireshark - # samba - iptables - nftables - wireshark + # Code Editors + # unstablepkgs.atom + xclip + xsel - # Code Editors - # unstablepkgs.atom - xclip - xsel + # Image/Graphic/Design Tools + gnome.eog + gimp + imagemagick + exiv2 + graphviz + inkscape + # barcode + qrencode + zbar + feh + # digikam - # Image/Graphic/Design Tools - gnome.eog - gimp - imagemagick - exiv2 - graphviz - inkscape - # barcode - qrencode - zbar - feh - # digikam + # Modelling Tools + # plantuml + # umlet + # staruml + # eclipses.eclipse-modeling + # dia + # astah-community + # Misc Development Tools + qrcode + # travis + jq + # prometheus + cdrtools - # Modelling Tools - # plantuml - # umlet - # staruml - # eclipses.eclipse-modeling - # dia - # astah-community + # Document Processing and Management + # zathura + mendeley + # zotero + pandoc + unstablepkgs.logseq - # Misc Development Tools - qrcode - # travis - jq - # prometheus - cdrtools + # has an EOL version of electron + # obsidian - # Document Processing and Management - # zathura - mendeley - # zotero - pandoc - unstablepkgs.logseq + # LaTeX + perlPackages.YAMLTiny + perlPackages.FileHomeDir + perlPackages.UnicodeLineBreak + (texlive.combine { + inherit (texlive) + scheme-small texlive-de texlive-en texlive-scripts collection-langgerman - # has an EOL version of electron - # obsidian + latexindent latexmk - # LaTeX - perlPackages.YAMLTiny - perlPackages.FileHomeDir - perlPackages.UnicodeLineBreak - (texlive.combine { - inherit (texlive) - scheme-small - texlive-de - texlive-en - texlive-scripts - collection-langgerman + algorithms cm-super - latexindent - latexmk + preprint enumitem draftwatermark everypage ulem placeins minted + ifplatform fvextra xstring framed; + }) - algorithms - cm-super + pdftk + # broken as of 2021-04-24 + # masterpdfeditor - preprint - enumitem - draftwatermark - everypage - ulem - placeins - minted ifplatform fvextra xstring framed - ; - }) + # File Synchronzation + # seafile-client + # grive2 + dropbox + rsync - pdftk - # broken as of 2021-04-24 - # masterpdfeditor + # Filesystem Tools + ntfs3g + ddrescue + ncdu + woeusb + unetbootin + pcmanfm + hdparm + testdisk + binwalk + gptfdisk + gparted + smartmontools - # File Synchronzation - # seafile-client - # grive2 - dropbox - rsync + ## Android + androidenv.androidPkgs_9_0.platform-tools - # Filesystem Tools - ntfs3g - ddrescue - ncdu - woeusb - unetbootin - pcmanfm - hdparm - testdisk - binwalk - gptfdisk - gparted - smartmontools + ## Python + myPython - ## Android - androidenv.androidPkgs_9_0.platform-tools + # Code generators + # unstablepkgs.swagger-codegen - ## Python - myPython + # Misc Desktop Tools + # TODO: this may be required if brightness control isn't working + # brightnessctl + ltunify + # solaar # TODO: conflicts with solar over udev rules + dex + # kitty + busyboxStatic + xorg.xbacklight + coreutils + lsof + x11_ssh_askpass + xdotool + xdg_utils + xdg-user-dirs + dconf + picocom + glib.dev # contains gdbus tool + alacritty + unstablepkgs.wally-cli + man-pages - # Code generators - # unstablepkgs.swagger-codegen + # Screen recording + # gtk-recordmydesktop # can't select the window + # qt-recordmydesktop + # vokoscreen + # shutter + # kazam # doesn't start + # xvidcap # doesn't keep the recording rectangle + obs-studio + screenkey + # shotcut + # openshot-qt - # Misc Desktop Tools - # TODO: this may be required if brightness control isn't working - # brightnessctl - ltunify - # solaar # TODO: conflicts with solar over udev rules - dex - # kitty - busyboxStatic - xorg.xbacklight - coreutils - lsof - x11_ssh_askpass - xdotool - xdg_utils - xdg-user-dirs - dconf - picocom - glib.dev # contains gdbus tool - alacritty - unstablepkgs.wally-cli - man-pages - - # Screen recording - # gtk-recordmydesktop # can't select the window - # qt-recordmydesktop - # vokoscreen - # shutter - # kazam # doesn't start - # xvidcap # doesn't keep the recording rectangle - obs-studio - screenkey - # shotcut - # openshot-qt - - unstablepkgs.ledger-live-desktop + unstablepkgs.ledger-live-desktop ]); } diff --git a/nix/home-manager/configuration/graphical-gnome3.nix b/nix/home-manager/configuration/graphical-gnome3.nix index 7face1e..1d36934 100644 --- a/nix/home-manager/configuration/graphical-gnome3.nix +++ b/nix/home-manager/configuration/graphical-gnome3.nix @@ -1,15 +1,12 @@ { pkgs }: -let - zshCurried = import ../programs/zsh.nix { inherit pkgs; }; -in +let zshCurried = import ../programs/zsh.nix { inherit pkgs; }; -{ pkgs -, config, -... }: +in { pkgs, config, ... }: let - unstablepkgs = import { config = config.nixpkgs.config; }; + unstablepkgs = + import { config = config.nixpkgs.config; }; in { imports = [ @@ -30,100 +27,96 @@ in { gnutls = true; }; - packageOverrides = pkgs: with pkgs; { - }; + packageOverrides = pkgs: with pkgs; { }; }; - home.sessionVariables = { - }; + home.sessionVariables = { }; + home.packages = [ ] ++ (with pkgs; [ + # Nix package related tools + patchelf + nix-index + nix-prefetch-scripts - home.packages = - [] ++ (with pkgs; [ - # Nix package related tools - patchelf - nix-index - nix-prefetch-scripts + # Version Control Systems + gitless - # Version Control Systems - gitless + # Process/System Administration + htop + gnome.gnome-tweaks + xorg.xhost + dmidecode + evtest - # Process/System Administration - htop - gnome.gnome-tweaks - xorg.xhost - dmidecode - evtest + # Archive Managers + sshfs-fuse + xarchive + p7zip + zip + unzip + gzip + lzop - # Archive Managers - sshfs-fuse - xarchive - p7zip - zip - unzip - gzip - lzop + # Password Management + gnome.gnome-keyring + gnome.seahorse - # Password Management - gnome.gnome-keyring - gnome.seahorse + # Remote Control Tools + remmina + freerdp - # Remote Control Tools - remmina - freerdp + # Network Tools + openvpn + tcpdump + iftop + iperf + bind + socat - # Network Tools - openvpn - tcpdump - iftop - iperf - bind - socat + # samba + iptables + nftables + wireshark - # samba - iptables - nftables - wireshark + # Code Editors + xclip + xsel + unstablepkgs.vscode - # Code Editors - xclip - xsel - unstablepkgs.vscode + # Image/Graphic/Design Tools + gnome.eog + gimp + inkscape - # Image/Graphic/Design Tools - gnome.eog - gimp - inkscape + # Misc Development Tools + qrcode + jq + cdrtools - # Misc Development Tools - qrcode - jq - cdrtools + # Document Processing and Management + zathura - # Document Processing and Management - zathura + # File Synchronzation + rsync - # File Synchronzation - rsync + # Filesystem Tools + ntfs3g + ddrescue + ncdu + unstablepkgs.woeusb + unetbootin + pcmanfm + hdparm + testdisk + python38Packages.binwalk + gptfdisk - # Filesystem Tools - ntfs3g - ddrescue - ncdu - unstablepkgs.woeusb - unetbootin - pcmanfm - hdparm - testdisk - python38Packages.binwalk - gptfdisk + ## Python + myPython - ## Python - myPython + busyboxStatic - busyboxStatic - - # Virtualization - virtmanager + # Virtualization + virtmanager ]); } diff --git a/nix/home-manager/configuration/graphical-removable.nix b/nix/home-manager/configuration/graphical-removable.nix index 7d7b6a0..b1a7a4a 100644 --- a/nix/home-manager/configuration/graphical-removable.nix +++ b/nix/home-manager/configuration/graphical-removable.nix @@ -1,15 +1,12 @@ { pkgs }: -let - zshCurried = import ../programs/zsh.nix { inherit pkgs; }; -in +let zshCurried = import ../programs/zsh.nix { inherit pkgs; }; -{ pkgs -, config, -... }: +in { pkgs, config, ... }: let - unstablepkgs = import { config = config.nixpkgs.config; }; + unstablepkgs = + import { config = config.nixpkgs.config; }; in { imports = [ @@ -32,100 +29,96 @@ in { gnutls = true; }; - packageOverrides = pkgs: with pkgs; { - }; + packageOverrides = pkgs: with pkgs; { }; }; - home.sessionVariables = { - }; + home.sessionVariables = { }; + home.packages = [ ] ++ (with pkgs; [ + # Nix package related tools + patchelf + nix-index + nix-prefetch-scripts - home.packages = - [] ++ (with pkgs; [ - # Nix package related tools - patchelf - nix-index - nix-prefetch-scripts + # Version Control Systems + gitless - # Version Control Systems - gitless + # Process/System Administration + htop + gnome.gnome-tweaks + xorg.xhost + dmidecode + evtest - # Process/System Administration - htop - gnome.gnome-tweaks - xorg.xhost - dmidecode - evtest + # Archive Managers + sshfs-fuse + xarchive + p7zip + zip + unzip + gzip + lzop - # Archive Managers - sshfs-fuse - xarchive - p7zip - zip - unzip - gzip - lzop + # Password Management + gnome.gnome-keyring + gnome.seahorse - # Password Management - gnome.gnome-keyring - gnome.seahorse + # Remote Control Tools + remmina + freerdp - # Remote Control Tools - remmina - freerdp + # Network Tools + openvpn + tcpdump + iftop + iperf + bind + socat - # Network Tools - openvpn - tcpdump - iftop - iperf - bind - socat + # samba + iptables + nftables + wireshark - # samba - iptables - nftables - wireshark + # Code Editors + xclip + xsel + unstablepkgs.vscode - # Code Editors - xclip - xsel - unstablepkgs.vscode + # Image/Graphic/Design Tools + gnome.eog + gimp + inkscape - # Image/Graphic/Design Tools - gnome.eog - gimp - inkscape + # Misc Development Tools + qrcode + jq + cdrtools - # Misc Development Tools - qrcode - jq - cdrtools + # Document Processing and Management + zathura - # Document Processing and Management - zathura + # File Synchronzation + rsync - # File Synchronzation - rsync + # Filesystem Tools + ntfs3g + ddrescue + ncdu + unstablepkgs.woeusb + unetbootin + pcmanfm + hdparm + testdisk + binwalk + gptfdisk - # Filesystem Tools - ntfs3g - ddrescue - ncdu - unstablepkgs.woeusb - unetbootin - pcmanfm - hdparm - testdisk - binwalk - gptfdisk + ## Python + myPython - ## Python - myPython + busyboxStatic - busyboxStatic - - # Virtualization - virtmanager + # Virtualization + virtmanager ]); } diff --git a/nix/home-manager/configuration/text-minimal.nix b/nix/home-manager/configuration/text-minimal.nix index 4eca703..9440cd1 100644 --- a/nix/home-manager/configuration/text-minimal.nix +++ b/nix/home-manager/configuration/text-minimal.nix @@ -1,12 +1,8 @@ -{ pkgs, extraPackages ? [] }: +{ pkgs, extraPackages ? [ ] }: -let - zshCurried = import ../programs/zsh.nix { inherit pkgs; }; -in +let zshCurried = import ../programs/zsh.nix { inherit pkgs; }; -{ pkgs -, config -, ... }: +in { pkgs, config, ... }: let @@ -18,18 +14,10 @@ in { zshCurried ]; - nixpkgs.config = { - packageOverrides = pkgs: with pkgs; { - }; - }; + nixpkgs.config = { packageOverrides = pkgs: with pkgs; { }; }; - home.sessionVariables = { - }; + home.sessionVariables = { }; home.packages = extraPackages - ++ (with pkgs; [ - iperf3 - inetutils - speedtest-cli - ]); + ++ (with pkgs; [ iperf3 inetutils speedtest-cli ]); } diff --git a/nix/home-manager/lib.nix b/nix/home-manager/lib.nix index 0c240cc..333e0e3 100644 --- a/nix/home-manager/lib.nix +++ b/nix/home-manager/lib.nix @@ -1,7 +1,6 @@ -{ -}: +{ }: -let +let in { mkSimpleTrayService = { execStart }: { @@ -11,12 +10,8 @@ in { PartOf = [ "graphical-session.target" ]; }; - Install = { - WantedBy = [ "graphical-session.target" ]; - }; + Install = { WantedBy = [ "graphical-session.target" ]; }; - Service = { - ExecStart = execStart; - }; + Service = { ExecStart = execStart; }; }; } diff --git a/nix/home-manager/profiles/common.nix b/nix/home-manager/profiles/common.nix index b350058..e7ae0b2 100644 --- a/nix/home-manager/profiles/common.nix +++ b/nix/home-manager/profiles/common.nix @@ -1,8 +1,6 @@ -{ pkgs -, ... -}: +{ pkgs, ... }: -let +let in { # TODO: re-enable this with the appropriate version # programs.home-manager.enable = true; @@ -18,9 +16,9 @@ in { home.keyboard = { layout = "us"; variant = "altgr-intl"; - options = [ + options = [ "nodeadkeys" - # "caps:swapescape" + # "caps:swapescape" ]; }; @@ -36,19 +34,18 @@ in { programs.command-not-found.enable = true; programs.fzf.enable = true; - home.packages = - [] ++ (with pkgs; [ - # git helpers - git-crypt + home.packages = [ ] ++ (with pkgs; [ + # git helpers + git-crypt - vcsh - # Authentication - cacert - openssl - mkpasswd + vcsh + # Authentication + cacert + openssl + mkpasswd - just - ripgrep - du-dust - ]); + just + ripgrep + du-dust + ]); } diff --git a/nix/home-manager/profiles/dotfiles.nix b/nix/home-manager/profiles/dotfiles.nix index 6b5f114..496c569 100644 --- a/nix/home-manager/profiles/dotfiles.nix +++ b/nix/home-manager/profiles/dotfiles.nix @@ -1,10 +1,6 @@ -{ pkgs -, config -, ... -}: +{ pkgs, config, ... }: -let - vcshActivationScript = pkgs.callPackage ./dotfiles/vcsh.nix {}; +let vcshActivationScript = pkgs.callPackage ./dotfiles/vcsh.nix { }; in { # TODO: fix the dotfiles diff --git a/nix/home-manager/profiles/dotfiles/vcsh.tmpl.nix b/nix/home-manager/profiles/dotfiles/vcsh.tmpl.nix index 521a126..87a45a0 100644 --- a/nix/home-manager/profiles/dotfiles/vcsh.tmpl.nix +++ b/nix/home-manager/profiles/dotfiles/vcsh.tmpl.nix @@ -1,39 +1,36 @@ -{ pkgs -, repoHttps ? "https://gitlab.com/steveeJ/dotfiles.git" -, repoSsh ? "git@gitlab.com:/steveeJ/dotfiles.git" -, ... -}: +{ pkgs, repoHttps ? "https://gitlab.com/steveeJ/dotfiles.git" +, repoSsh ? "git@gitlab.com:/steveeJ/dotfiles.git", ... }: let repoBareLocal = pkgs.runCommand "fetchbare" { - outputHashMode = "recursive"; - outputHashAlgo = "sha256"; - outputHash = "0000000000000000000000000000000000000000000000000000"; - } '' + outputHashMode = "recursive"; + outputHashAlgo = "sha256"; + outputHash = "0000000000000000000000000000000000000000000000000000"; + } '' ( set -xe export GIT_SSL_CAINFO=${pkgs.cacert}/etc/ssl/certs/ca-bundle.crt export SSL_CERT_FILE=${pkgs.cacert}/etc/ssl/certs/ca-bundle.crt ${pkgs.git}/bin/git clone --mirror ${repoHttps} $out ) - ''; + ''; in pkgs.writeScript "activation-script" '' - export HOST=$(hostname -s) + export HOST=$(hostname -s) - function set_remotes { - ${pkgs.vcsh}/bin/vcsh dotfiles remote set-url origin $1 - ${pkgs.vcsh}/bin/vcsh dotfiles remote set-url --push origin $2 - } + function set_remotes { + ${pkgs.vcsh}/bin/vcsh dotfiles remote set-url origin $1 + ${pkgs.vcsh}/bin/vcsh dotfiles remote set-url --push origin $2 + } - if ! test -d $HOME/.config/vcsh/repo.d/dotfiles.git; then - echo Cloning dotfiles for $HOST... - ${pkgs.vcsh}/bin/vcsh clone -b $HOST ${repoBareLocal} dotfiles - set_remotes ${repoHttps} ${repoSsh} - else - set_remotes ${repoBareLocal} ${repoSsh} - echo Updating dotfiles for $HOST... - ${pkgs.vcsh}/bin/vcsh pull $HOST || true - set_remotes ${repoHttps} ${repoSsh} - fi - '' + if ! test -d $HOME/.config/vcsh/repo.d/dotfiles.git; then + echo Cloning dotfiles for $HOST... + ${pkgs.vcsh}/bin/vcsh clone -b $HOST ${repoBareLocal} dotfiles + set_remotes ${repoHttps} ${repoSsh} + else + set_remotes ${repoBareLocal} ${repoSsh} + echo Updating dotfiles for $HOST... + ${pkgs.vcsh}/bin/vcsh pull $HOST || true + set_remotes ${repoHttps} ${repoSsh} + fi +'' diff --git a/nix/home-manager/profiles/nix-channels.nix b/nix/home-manager/profiles/nix-channels.nix index e2901ba..7a1d1de 100644 --- a/nix/home-manager/profiles/nix-channels.nix +++ b/nix/home-manager/profiles/nix-channels.nix @@ -1,28 +1,27 @@ -{ pkgs -, config -, ... -}: +{ pkgs, config, ... }: let in { - home.file.".nix-channels".text = '' - ''; + home.file.".nix-channels".text = ""; - home.activation.removeExistingNixChannels = config.lib.dag.entryBefore ["checkLinkTargets"] '' - $DRY_RUN_CMD ${pkgs.writeScript "activation-script" '' - set -ex - if test -f $HOME/.nix-channels; then - echo Uninstalling available channels... - if test -f $HOME/.nix-channel; then - while read url channel; do - nix-channel --remove $channel - done < $HOME/.nix-channel - fi - echo Moving existing file away... - touch $HOME/.nix-channels.dummy - mv --backup=numbered $HOME/.nix-channels.dummy $HOME/.nix-channels - rm $HOME/.nix-channels - fi - ''}; - ''; + home.activation.removeExistingNixChannels = + config.lib.dag.entryBefore [ "checkLinkTargets" ] '' + $DRY_RUN_CMD ${ + pkgs.writeScript "activation-script" '' + set -ex + if test -f $HOME/.nix-channels; then + echo Uninstalling available channels... + if test -f $HOME/.nix-channel; then + while read url channel; do + nix-channel --remove $channel + done < $HOME/.nix-channel + fi + echo Moving existing file away... + touch $HOME/.nix-channels.dummy + mv --backup=numbered $HOME/.nix-channels.dummy $HOME/.nix-channels + rm $HOME/.nix-channels + fi + '' + }; + ''; } diff --git a/nix/home-manager/profiles/qtile-desktop.nix b/nix/home-manager/profiles/qtile-desktop.nix index db368aa..10f3806 100644 --- a/nix/home-manager/profiles/qtile-desktop.nix +++ b/nix/home-manager/profiles/qtile-desktop.nix @@ -1,16 +1,13 @@ -{ pkgs -, ... -}: +{ pkgs, ... }: let - inherit (import ../lib.nix { }) - mkSimpleTrayService - ; + inherit (import ../lib.nix { }) mkSimpleTrayService; audio = pkgs.writeShellScript "audio" '' - export PATH=${with pkgs; lib.makeBinPath [ - pulseaudio findutils gnugrep - ]}:$PATH + export PATH=${ + with pkgs; + lib.makeBinPath [ pulseaudio findutils gnugrep ] + }:$PATH export MUTEFILE=''${TEMPDIR:-/tmp}/.qtilemute case $1 in @@ -34,9 +31,7 @@ let terminalCommand = "${pkgs.alacritty}/bin/alacritty"; dpmsScript = pkgs.writeShellScript "dpmsScript" '' - export PATH=${with pkgs; lib.makeBinPath [ - xorg.xset - ]}:$PATH + export PATH=${with pkgs; lib.makeBinPath [ xorg.xset ]}:$PATH set -xe @@ -59,9 +54,7 @@ let ''; screenLockCommand = pkgs.writeShellScript "screenLock" '' - export PATH=${with pkgs; lib.makeBinPath [ - i3lock - ]}:$PATH + export PATH=${with pkgs; lib.makeBinPath [ i3lock ]}:$PATH revert() { ${dpmsScript} default @@ -82,186 +75,185 @@ let ''; qtileConfig = pkgs.writeScript "qtile_config.py" '' -from libqtile.config import Key, Screen, Group, Drag, Click -from libqtile.command import lazy -from libqtile import layout, bar, widget -from libqtile import hook + from libqtile.config import Key, Screen, Group, Drag, Click + from libqtile.command import lazy + from libqtile import layout, bar, widget + from libqtile import hook -import logging, os -logger = logging.getLogger() -logger.setLevel(logging.WARN) + import logging, os + logger = logging.getLogger() + logger.setLevel(logging.WARN) -handler = logging.handlers.RotatingFileHandler( - os.path.join(os.getenv('TEMPDIR', default="/tmp"), '.qtilelog'), maxBytes=10240000, - backupCount=7 -) -handler.setLevel(logging.WARN) -logger.addHandler(handler) - -key_super = "mod4" -key_alt = "mod1" -key_control = "control" - -keys = [ - # https://github.com/qtile/qtile/blob/master/libqtile/backend/x11/xkeysyms.py - Key([key_super], "Return", lazy.spawn("${terminalCommand}")), - Key([key_super], "r", lazy.spawncmd()), - Key([key_super], "w", lazy.window.kill()), - - Key([key_alt, key_super], "l", lazy.spawn('${pkgs.bash}/bin/sh -c "loginctl lock-session $XDG_SESSION_ID"')), - Key([key_alt, key_super], "s", lazy.spawn("${pkgs.systemd}/bin/systemctl suspend")), - - Key([key_super, key_control], "r", lazy.spawn("${initScreen}")), - Key([key_super, key_control], "q", lazy.shutdown()), - - # Toggle between different layouts as defined below - Key([key_super], "Tab", lazy.next_layout()), - - # this is usefull when floating windows get buried - Key([key_super], "Escape", lazy.window.bring_to_front()), - - # common to all layouts - Key([key_control, key_alt], "h", lazy.layout.grow_left()), - Key([key_control, key_alt], "j", lazy.layout.grow_down()), - Key([key_control, key_alt], "k", lazy.layout.grow_up()), - Key([key_control, key_alt], "l", lazy.layout.grow_right()), - Key([key_super], "n", lazy.layout.normalize()), - Key([key_super], "o", lazy.layout.maximize()), - - # MonadTall keybindings - Key([key_super], "h", lazy.layout.left().when(layout="monad")), - Key([key_super], "l", lazy.layout.right().when(layout="monad")), - Key([key_super], "j", lazy.layout.down().when(layout="monad")), - Key([key_super], "k", lazy.layout.up().when(layout="monad")), - Key([key_super, key_control], "h", lazy.layout.shuffle_left().when(layout="monad")), - Key([key_super, key_control], "l", lazy.layout.shuffle_right().when(layout="monad")), - Key([key_super, key_control], "j", lazy.layout.shuffle_down().when(layout="monad")), - Key([key_super, key_control], "k", lazy.layout.shuffle_up().when(layout="monad")), - Key([key_super, key_control], "space", lazy.layout.toggle_split().when(layout="monad")), - - # Stack - Key([key_super], "h", lazy.layout.previous().when(layout='stack')), - Key([key_super], "l", lazy.layout.next().when(layout='stack')), - Key([key_super], "j", lazy.layout.up().when(layout='stack')), - Key([key_super], "k", lazy.layout.down().when(layout='stack')), - Key([key_super, key_control], "j", lazy.layout.shuffle_up().when(layout='stack')), - Key([key_super, key_control], "k", lazy.layout.shuffle_down().when(layout='stack')), - Key([key_super, key_control], "h", lazy.layout.client_to_previous().when(layout='stack')), - Key([key_super, key_control], "l", lazy.layout.client_to_next().when(layout='stack')), - - # Columns - Key([key_super], "h", lazy.layout.left().when(layout="columns")), - Key([key_super], "l", lazy.layout.right().when(layout="columns")), - Key([key_super], "j", lazy.layout.next().when(layout="columns")), - Key([key_super], "k", lazy.layout.previous().when(layout="columns")), - Key([key_super, key_control], "j", lazy.layout.shuffle_down().when(layout="columns")), - Key([key_super, key_control], "k", lazy.layout.shuffle_up().when(layout="columns")), - Key([key_super, key_control], "h", lazy.layout.shuffle_left().when(layout="columns")), - Key([key_super, key_control], "l", lazy.layout.shuffle_right().when(layout="columns")), - Key([key_super, key_control], "space", lazy.layout.toggle_split().when(layout="columns")), - - # Max - Key([key_super], "j", lazy.layout.down().when(layout="max")), - Key([key_super], "k", lazy.layout.up().when(layout="max")), - - # TODO: these are required to make the 'columns' layout work, but why? - Key([key_super], "j", lazy.layout.next()), - Key([key_super], "k", lazy.layout.previous()), - - # Multimedia Keys - Key([], "XF86AudioPlay", lazy.spawn("${pkgs.playerctl}/bin/playerctl play-pause")), - Key([], "XF86AudioPrev", lazy.spawn("${pkgs.playerctl}/bin/playerctl previous")), - Key([], "XF86AudioNext", lazy.spawn("${pkgs.playerctl}/bin/playerctl next")), - # TODO: the next two don't work yet - Key([], "XF86AudioRewind", lazy.spawn("${pkgs.playerctl}/bin/playerctl offset 10-")), - Key([], "XF86BackForward", lazy.spawn("${pkgs.playerctl}/bin/playerctl offset 10+")), - Key([], "XF86AudioMute", lazy.spawn("${audio} mute")), - Key([], "XF86AudioLowerVolume", lazy.spawn("${audio} lower")), - Key([], "XF86AudioRaiseVolume", lazy.spawn("${audio} raise")), - Key([], "Print", lazy.spawn("${pkgs.flameshot}/bin/flameshot gui")), -] -groups = [Group(i) for i in "1234567890"] - -for i in groups: - # super + letter of group = switch to group - keys.append( - Key([key_super], i.name, lazy.group[i.name].toscreen()) + handler = logging.handlers.RotatingFileHandler( + os.path.join(os.getenv('TEMPDIR', default="/tmp"), '.qtilelog'), maxBytes=10240000, + backupCount=7 ) + handler.setLevel(logging.WARN) + logger.addHandler(handler) - # super + shift + letter of group = switch to & move focused window to group - keys.append( - Key([key_super, key_control], i.name, lazy.window.togroup(i.name)) - ) + key_super = "mod4" + key_alt = "mod1" + key_control = "control" -layouts = [ - layout.Columns(num_columns=3, border_focus='#00ff00', border_width=2), - layout.Max(), - # layout.Stack(num_stacks=3, border_focus='#00ff00', border_width=2, autosplit=True, previous_on_rm=True), - # layout.Wmii(border_focus='#00ff00'), - # layout.MonadTall(ratio=0.6, border_focus='#00ff00'), -] + keys = [ + # https://github.com/qtile/qtile/blob/master/libqtile/backend/x11/xkeysyms.py + Key([key_super], "Return", lazy.spawn("${terminalCommand}")), + Key([key_super], "r", lazy.spawncmd()), + Key([key_super], "w", lazy.window.kill()), -widget_defaults = dict( - font='Arial', - fontsize=16, - padding=3, -) + Key([key_alt, key_super], "l", lazy.spawn('${pkgs.bash}/bin/sh -c "loginctl lock-session $XDG_SESSION_ID"')), + Key([key_alt, key_super], "s", lazy.spawn("${pkgs.systemd}/bin/systemctl suspend")), -screens_count = 4 -screens = [] -for i in range(0, screens_count+1): - j = i+1 - widgets = [ - widget.TextBox("Screen %i" % j, name="Screen %i" % j), - widget.GroupBox(), - widget.WindowName(), - widget.Prompt(), - widget.CPUGraph(), - widget.ThermalSensor(), - widget.Memory(), - widget.Net(interface='eth0'), - widget.Net(interface='wlan0'), - widget.Clock(format='%Y-%m-%d %a %I:%M %p'), + Key([key_super, key_control], "r", lazy.spawn("${initScreen}")), + Key([key_super, key_control], "q", lazy.shutdown()), + + # Toggle between different layouts as defined below + Key([key_super], "Tab", lazy.next_layout()), + + # this is usefull when floating windows get buried + Key([key_super], "Escape", lazy.window.bring_to_front()), + + # common to all layouts + Key([key_control, key_alt], "h", lazy.layout.grow_left()), + Key([key_control, key_alt], "j", lazy.layout.grow_down()), + Key([key_control, key_alt], "k", lazy.layout.grow_up()), + Key([key_control, key_alt], "l", lazy.layout.grow_right()), + Key([key_super], "n", lazy.layout.normalize()), + Key([key_super], "o", lazy.layout.maximize()), + + # MonadTall keybindings + Key([key_super], "h", lazy.layout.left().when(layout="monad")), + Key([key_super], "l", lazy.layout.right().when(layout="monad")), + Key([key_super], "j", lazy.layout.down().when(layout="monad")), + Key([key_super], "k", lazy.layout.up().when(layout="monad")), + Key([key_super, key_control], "h", lazy.layout.shuffle_left().when(layout="monad")), + Key([key_super, key_control], "l", lazy.layout.shuffle_right().when(layout="monad")), + Key([key_super, key_control], "j", lazy.layout.shuffle_down().when(layout="monad")), + Key([key_super, key_control], "k", lazy.layout.shuffle_up().when(layout="monad")), + Key([key_super, key_control], "space", lazy.layout.toggle_split().when(layout="monad")), + + # Stack + Key([key_super], "h", lazy.layout.previous().when(layout='stack')), + Key([key_super], "l", lazy.layout.next().when(layout='stack')), + Key([key_super], "j", lazy.layout.up().when(layout='stack')), + Key([key_super], "k", lazy.layout.down().when(layout='stack')), + Key([key_super, key_control], "j", lazy.layout.shuffle_up().when(layout='stack')), + Key([key_super, key_control], "k", lazy.layout.shuffle_down().when(layout='stack')), + Key([key_super, key_control], "h", lazy.layout.client_to_previous().when(layout='stack')), + Key([key_super, key_control], "l", lazy.layout.client_to_next().when(layout='stack')), + + # Columns + Key([key_super], "h", lazy.layout.left().when(layout="columns")), + Key([key_super], "l", lazy.layout.right().when(layout="columns")), + Key([key_super], "j", lazy.layout.next().when(layout="columns")), + Key([key_super], "k", lazy.layout.previous().when(layout="columns")), + Key([key_super, key_control], "j", lazy.layout.shuffle_down().when(layout="columns")), + Key([key_super, key_control], "k", lazy.layout.shuffle_up().when(layout="columns")), + Key([key_super, key_control], "h", lazy.layout.shuffle_left().when(layout="columns")), + Key([key_super, key_control], "l", lazy.layout.shuffle_right().when(layout="columns")), + Key([key_super, key_control], "space", lazy.layout.toggle_split().when(layout="columns")), + + # Max + Key([key_super], "j", lazy.layout.down().when(layout="max")), + Key([key_super], "k", lazy.layout.up().when(layout="max")), + + # TODO: these are required to make the 'columns' layout work, but why? + Key([key_super], "j", lazy.layout.next()), + Key([key_super], "k", lazy.layout.previous()), + + # Multimedia Keys + Key([], "XF86AudioPlay", lazy.spawn("${pkgs.playerctl}/bin/playerctl play-pause")), + Key([], "XF86AudioPrev", lazy.spawn("${pkgs.playerctl}/bin/playerctl previous")), + Key([], "XF86AudioNext", lazy.spawn("${pkgs.playerctl}/bin/playerctl next")), + # TODO: the next two don't work yet + Key([], "XF86AudioRewind", lazy.spawn("${pkgs.playerctl}/bin/playerctl offset 10-")), + Key([], "XF86BackForward", lazy.spawn("${pkgs.playerctl}/bin/playerctl offset 10+")), + Key([], "XF86AudioMute", lazy.spawn("${audio} mute")), + Key([], "XF86AudioLowerVolume", lazy.spawn("${audio} lower")), + Key([], "XF86AudioRaiseVolume", lazy.spawn("${audio} raise")), + Key([], "Print", lazy.spawn("${pkgs.flameshot}/bin/flameshot gui")), ] - if i is 0: - widgets.insert(-1, widget.Systray()) + groups = [Group(i) for i in "1234567890"] - screens.append(Screen(bottom=bar.Bar(widgets, 30))) + for i in groups: + # super + letter of group = switch to group + keys.append( + Key([key_super], i.name, lazy.group[i.name].toscreen()) + ) - keys.append(Key([key_super, "shift"], "%i" % (i+1), lazy.to_screen(i))) + # super + shift + letter of group = switch to & move focused window to group + keys.append( + Key([key_super, key_control], i.name, lazy.window.togroup(i.name)) + ) -dgroups_key_binder = None -dgroups_app_rules = [] -follow_mouse_focus = False -bring_front_click = False -cursor_warp = False -auto_fullscreen = True -auto_minimize = False -# focus_on_window_activation = "urgent" + layouts = [ + layout.Columns(num_columns=3, border_focus='#00ff00', border_width=2), + layout.Max(), + # layout.Stack(num_stacks=3, border_focus='#00ff00', border_width=2, autosplit=True, previous_on_rm=True), + # layout.Wmii(border_focus='#00ff00'), + # layout.MonadTall(ratio=0.6, border_focus='#00ff00'), + ] + + widget_defaults = dict( + font='Arial', + fontsize=16, + padding=3, + ) + + screens_count = 4 + screens = [] + for i in range(0, screens_count+1): + j = i+1 + widgets = [ + widget.TextBox("Screen %i" % j, name="Screen %i" % j), + widget.GroupBox(), + widget.WindowName(), + widget.Prompt(), + widget.CPUGraph(), + widget.ThermalSensor(), + widget.Memory(), + widget.Net(interface='eth0'), + widget.Net(interface='wlan0'), + widget.Clock(format='%Y-%m-%d %a %I:%M %p'), + ] + if i is 0: + widgets.insert(-1, widget.Systray()) + + screens.append(Screen(bottom=bar.Bar(widgets, 30))) + + keys.append(Key([key_super, "shift"], "%i" % (i+1), lazy.to_screen(i))) + + dgroups_key_binder = None + dgroups_app_rules = [] + follow_mouse_focus = False + bring_front_click = False + cursor_warp = False + auto_fullscreen = True + auto_minimize = False + # focus_on_window_activation = "urgent" -# Drag floating layouts. -mouse = [ - # Drag([key_super,key_control], "Button1", lazy.window.set_position_floating(), start=lazy.window.get_position()), - # Drag([key_super,key_control], "Button2", lazy.window.set_size_floating(), start=lazy.window.get_size()), - Click([key_super,key_control], "Button3", lazy.window.disable_floating()) -] + # Drag floating layouts. + mouse = [ + # Drag([key_super,key_control], "Button1", lazy.window.set_position_floating(), start=lazy.window.get_position()), + # Drag([key_super,key_control], "Button2", lazy.window.set_size_floating(), start=lazy.window.get_size()), + Click([key_super,key_control], "Button3", lazy.window.disable_floating()) + ] -# disable any floating -@hook.subscribe.client_new -def disable_floating_for_all_new_windows(window): - window.floating = False + # disable any floating + @hook.subscribe.client_new + def disable_floating_for_all_new_windows(window): + window.floating = False -@hook.subscribe.client_new -def print_new_window(window): - print("new window: ", window) -''; + @hook.subscribe.client_new + def print_new_window(window): + print("new window: ", window) + ''; in { systemd.user = { startServices = true; - services = { - }; + services = { }; }; services = { @@ -306,50 +298,46 @@ in { enable = true; settings = { matches = let - playerctl = ''${pkgs.coreutils}/bin/env DBUS_SESSION_BUS_ADDRESS="unix:path=/run/user/$(${pkgs.coreutils}/bin/id -u)/bus" ${pkgs.playerctl}/bin/playerctl''; + playerctl = '' + ${pkgs.coreutils}/bin/env DBUS_SESSION_BUS_ADDRESS="unix:path=/run/user/$(${pkgs.coreutils}/bin/id -u)/bus" ${pkgs.playerctl}/bin/playerctl''; in [ { trigger = ":vpos"; replace = "{{output}}"; - vars = [ - { - name = "output"; - type = "script"; - params = { - args = [ - (pkgs.writeScript "espanso" '' - #! ${pkgs.python3}/bin/python - import subprocess, os, math, datetime + vars = [{ + name = "output"; + type = "script"; + params = { + args = [ + (pkgs.writeScript "espanso" '' + #! ${pkgs.python3}/bin/python + import subprocess, os, math, datetime - id=str(os.getuid()) - result=subprocess.run(args=["${pkgs.playerctl}/bin/playerctl", "position"], env={"DBUS_SESSION_BUS_ADDRESS": "unix:path=/run/user/"+id+"/bus"},capture_output=True) - result.check_returncode() + id=str(os.getuid()) + result=subprocess.run(args=["${pkgs.playerctl}/bin/playerctl", "position"], env={"DBUS_SESSION_BUS_ADDRESS": "unix:path=/run/user/"+id+"/bus"},capture_output=True) + result.check_returncode() - position_secs = math.trunc(float(result.stdout)) - position_human = datetime.timedelta(seconds=position_secs) - print("%s - %s" % (position_human, position_secs)) - '') - ]; - }; - } - ]; + position_secs = math.trunc(float(result.stdout)) + position_human = datetime.timedelta(seconds=position_secs) + print("%s - %s" % (position_human, position_secs)) + '') + ]; + }; + }]; } { trigger = ":vtit"; replace = "{{output}}"; - vars = [ - { - name = "output"; - type = "script"; - params = { - args = [ - (pkgs.writeShellScript "espanso" '' - ${playerctl} metadata title'' - ) - ]; - }; - } - ]; + vars = [{ + name = "output"; + type = "script"; + params = { + args = [ + (pkgs.writeShellScript "espanso" + "${playerctl} metadata title") + ]; + }; + }]; } { trigger = ":dunno"; diff --git a/nix/home-manager/programs/chromium.nix b/nix/home-manager/programs/chromium.nix index 35cda6b..d9caecf 100644 --- a/nix/home-manager/programs/chromium.nix +++ b/nix/home-manager/programs/chromium.nix @@ -1,15 +1,9 @@ -{ -... -}: +{ ... }: { - programs.chromium = { - enable = true; - }; + programs.chromium = { enable = true; }; - programs.brave = { - enable = true; - }; + programs.brave = { enable = true; }; nixpkgs.config = { chromium = { @@ -18,11 +12,6 @@ }; }; - programs.browserpass = { - browsers = [ - "chromium" - "brave" - ]; - }; + programs.browserpass = { browsers = [ "chromium" "brave" ]; }; } diff --git a/nix/home-manager/programs/emacs.nix b/nix/home-manager/programs/emacs.nix index 2b606a9..5dce7f8 100644 --- a/nix/home-manager/programs/emacs.nix +++ b/nix/home-manager/programs/emacs.nix @@ -1,24 +1,22 @@ -{ pkgs, -... -}: +{ pkgs, ... }: { programs.emacs = { enable = true; - extraPackages = epkgs: (with epkgs; [ - nix-mode - magit # ; Integrate git - zerodark-theme # ; Nicolas' theme - undo-tree # ; to show the undo tree - # zoom-frm # ; increase/decrease font size for all buffers %lt;C-x C-+> - ]) ++ (with epkgs.melpaPackages; [ - evil - ]) ++ (with epkgs.elpaPackages; [ - auctex # ; LaTeX mode - beacon # ; highlight my cursor when scrolling - nameless # ; hide current package name everywhere in elisp code - ]) ++ (with pkgs; [ - pkgs.notmuch # From main packages set - ]); + extraPackages = epkgs: + (with epkgs; [ + nix-mode + magit # ; Integrate git + zerodark-theme # ; Nicolas' theme + undo-tree # ; to show the undo tree + # zoom-frm # ; increase/decrease font size for all buffers %lt;C-x C-+> + ]) ++ (with epkgs.melpaPackages; [ evil ]) ++ (with epkgs.elpaPackages; [ + auctex # ; LaTeX mode + beacon # ; highlight my cursor when scrolling + nameless # ; hide current package name everywhere in elisp code + ]) ++ (with pkgs; + [ + pkgs.notmuch # From main packages set + ]); }; } diff --git a/nix/home-manager/programs/firefox.nix b/nix/home-manager/programs/firefox.nix index aaf12a7..e8531c6 100644 --- a/nix/home-manager/programs/firefox.nix +++ b/nix/home-manager/programs/firefox.nix @@ -1,19 +1,14 @@ -{ pkgs -, ... -}: +{ pkgs, ... }: { - programs.firefox = { - enable = true; - }; + programs.firefox = { enable = true; }; programs.browserpass = { enable = true; - browsers = [ - "firefox" - ]; + browsers = [ "firefox" ]; }; - home.file.".mozilla/native-messaging-hosts/passff.json".source = "${pkgs.passff-host}/share/passff-host/passff.json"; + home.file.".mozilla/native-messaging-hosts/passff.json".source = + "${pkgs.passff-host}/share/passff-host/passff.json"; } diff --git a/nix/home-manager/programs/holochain-launcher.nix b/nix/home-manager/programs/holochain-launcher.nix index 619547d..14ba625 100644 --- a/nix/home-manager/programs/holochain-launcher.nix +++ b/nix/home-manager/programs/holochain-launcher.nix @@ -1,7 +1,5 @@ { pkgs, ... }: { - home.packages = [ - pkgs.holochain-launcher - ]; + home.packages = [ pkgs.holochain-launcher ]; } diff --git a/nix/home-manager/programs/homeshick.nix b/nix/home-manager/programs/homeshick.nix index dc05362..57236ae 100644 --- a/nix/home-manager/programs/homeshick.nix +++ b/nix/home-manager/programs/homeshick.nix @@ -1,38 +1,37 @@ -{ pkgs -, config -, ... -}: +{ pkgs, config, ... }: let # TODO: clean up the impurity in here in { - home.sessionVariables = { - HOMESHICK_DIR="${pkgs.homeshick}"; - }; + home.sessionVariables = { HOMESHICK_DIR = "${pkgs.homeshick}"; }; - home.activation.bootstrapRepos = config.lib.dag.entryAfter ["writeBoundary"] '' - $DRY_RUN_CMD ${pkgs.writeScript "activation-script" '' - set -e - echo home-manager path is ${config.home.path} - echo home is $HOME + home.activation.bootstrapRepos = + config.lib.dag.entryAfter [ "writeBoundary" ] '' + $DRY_RUN_CMD ${ + pkgs.writeScript "activation-script" '' + set -e + echo home-manager path is ${config.home.path} + echo home is $HOME - source ${pkgs.homeshick}/homeshick.sh - type homeshick - - # echo Updating homeshick - # ln -sfT ${pkgs.homeshick} "$HOMESICK_REPOS"/.homeshick - # mv -Tf "$HOMESICK_REPOS"/{.,}homeshick - ''}; - ''; + source ${pkgs.homeshick}/homeshick.sh + type homeshick + + # echo Updating homeshick + # ln -sfT ${pkgs.homeshick} "$HOMESICK_REPOS"/.homeshick + # mv -Tf "$HOMESICK_REPOS"/{.,}homeshick + '' + }; + ''; nixpkgs.config = { - packageOverrides = pkgs: with pkgs; { - homeshick = builtins.fetchGit { - url = "https://github.com/andsens/homeshick.git"; - ref = "master"; + packageOverrides = pkgs: + with pkgs; { + homeshick = builtins.fetchGit { + url = "https://github.com/andsens/homeshick.git"; + ref = "master"; + }; }; - }; }; } diff --git a/nix/home-manager/programs/libreoffice.nix b/nix/home-manager/programs/libreoffice.nix index 7edf5b9..49b166a 100644 --- a/nix/home-manager/programs/libreoffice.nix +++ b/nix/home-manager/programs/libreoffice.nix @@ -1,6 +1,4 @@ -{ pkgs, -... -}: +{ pkgs, ... }: { home.sessionVariables = { @@ -8,7 +6,5 @@ SAL_USE_VCLPLUGIN = "gtk3"; }; - home.packages = with pkgs; [ - libreoffice-fresh - ]; + home.packages = with pkgs; [ libreoffice-fresh ]; } diff --git a/nix/home-manager/programs/neovim.nix b/nix/home-manager/programs/neovim.nix index 92dfd17..c63f33d 100644 --- a/nix/home-manager/programs/neovim.nix +++ b/nix/home-manager/programs/neovim.nix @@ -1,13 +1,9 @@ -{ pkgs, -... -}: +{ pkgs, ... }: let in { - home.sessionVariables = { - EDITOR = "nvim"; - }; + home.sessionVariables = { EDITOR = "nvim"; }; programs.neovim = { enable = true; @@ -16,116 +12,117 @@ in { extraConfig = builtins.readFile ./neovim/vimrc; - plugins = with pkgs; [ - # yaml-folds - { - plugin = vimUtils.buildVimPlugin { - name = "vim-yaml-folds"; - src = fetchFromGitHub { - owner = "pedrohdz"; - repo = "vim-yaml-folds"; - rev = "890ccd8e5370808d569e96dbb06cbeca2cf5993a"; - sha256 = "018z6xcwrq58q6lj6gwhrifjaxkmrlkkg0n86s6mjjlwkbs2qa4m"; + plugins = with pkgs; + [ + # yaml-folds + { + plugin = vimUtils.buildVimPlugin { + name = "vim-yaml-folds"; + src = fetchFromGitHub { + owner = "pedrohdz"; + repo = "vim-yaml-folds"; + rev = "890ccd8e5370808d569e96dbb06cbeca2cf5993a"; + sha256 = "018z6xcwrq58q6lj6gwhrifjaxkmrlkkg0n86s6mjjlwkbs2qa4m"; + }; + buildInputs = [ zip vim ]; }; - buildInputs = [ zip vim ]; - }; - } + } - { - plugin = vimUtils.buildVimPlugin { - name = "vim-yaml"; - src = fetchFromGitHub { - owner = "stephpy"; - repo = "vim-yaml"; - rev = "e97e063b16eba4e593d620676a0a15fa98613979"; - sha256 = "0vqahbrnr43lxanpziyrmzaqqb3cmyny8ry1xvmy2xyd1larzfrk"; - }; - }; - } + { + plugin = vimUtils.buildVimPlugin { + name = "vim-yaml"; + src = fetchFromGitHub { + owner = "stephpy"; + repo = "vim-yaml"; + rev = "e97e063b16eba4e593d620676a0a15fa98613979"; + sha256 = "0vqahbrnr43lxanpziyrmzaqqb3cmyny8ry1xvmy2xyd1larzfrk"; + }; + }; + } - # broken 2021-06-08 - # { - # plugin = vimUtils.buildVimPlugin { - # name = "vim-markdown-toc"; - # src = fetchFromGitHub { - # owner = "mzlogin"; - # repo = "vim-markdown-toc"; - # rev = "b7bb6c37033d3a6c93906af48dc0e689bd948638"; - # sha256 = "026xf2gid4qivwawh7if3nfk7zja9di0flhdzdx82lvil9x48lyz"; - # }; - # }; - # } + # broken 2021-06-08 + # { + # plugin = vimUtils.buildVimPlugin { + # name = "vim-markdown-toc"; + # src = fetchFromGitHub { + # owner = "mzlogin"; + # repo = "vim-markdown-toc"; + # rev = "b7bb6c37033d3a6c93906af48dc0e689bd948638"; + # sha256 = "026xf2gid4qivwawh7if3nfk7zja9di0flhdzdx82lvil9x48lyz"; + # }; + # }; + # } - # broken 2021-06-08 - # { - # plugin = vimUtils.buildVimPlugin { - # name = "vim-perl"; - # src = fetchFromGitHub { - # owner = "vim-perl"; - # repo = "vim-perl"; - # rev = "f330b5d474c44e6cfae22ba50868093dea3e9adb"; - # sha256 = "1dy40ixgixj0536c5ggra51b4yd1lbw4j6l0j5zc3diasb7m2gvr"; - # }; - # }; - # } + # broken 2021-06-08 + # { + # plugin = vimUtils.buildVimPlugin { + # name = "vim-perl"; + # src = fetchFromGitHub { + # owner = "vim-perl"; + # repo = "vim-perl"; + # rev = "f330b5d474c44e6cfae22ba50868093dea3e9adb"; + # sha256 = "1dy40ixgixj0536c5ggra51b4yd1lbw4j6l0j5zc3diasb7m2gvr"; + # }; + # }; + # } - { - plugin = vimUtils.buildVimPlugin { - name = "git-blame"; - src = fetchFromGitHub { - "owner" = "zivyangll"; - "repo" = "git-blame.vim"; - "rev" = "9d144b7bed5d8f1c9259551768b7f3b3d1294917"; - "sha256" = "06zb5xcc59k25rpwl46j82fcqckiznmj97v6i0mwlb8jhqqrhy9j"; - }; - }; - } - ] - ++ (with pkgs.vimPlugins; [ - delimitMate - vim-airline - vim-airline-themes - ctrlp - vim-css-color - rainbow_parentheses - vim-colorschemes - vim-colorstepper - vim-signify - fugitive - vim-indent-guides - UltiSnips - fzfWrapper + { + plugin = vimUtils.buildVimPlugin { + name = "git-blame"; + src = fetchFromGitHub { + "owner" = "zivyangll"; + "repo" = "git-blame.vim"; + "rev" = "9d144b7bed5d8f1c9259551768b7f3b3d1294917"; + "sha256" = "06zb5xcc59k25rpwl46j82fcqckiznmj97v6i0mwlb8jhqqrhy9j"; + }; + }; + } + ] ++ (with pkgs.vimPlugins; [ + delimitMate + vim-airline + vim-airline-themes + ctrlp + vim-css-color + rainbow_parentheses + vim-colorschemes + vim-colorstepper + vim-signify + fugitive + vim-indent-guides + UltiSnips + fzfWrapper - ncm2 - ncm2-bufword - ncm2-path - ncm2-tmux - ncm2-ultisnips - nvim-yarp + ncm2 + ncm2-bufword + ncm2-path + ncm2-tmux + ncm2-ultisnips + nvim-yarp - LanguageClient-neovim + LanguageClient-neovim - Improved-AnsiEsc - tabular + Improved-AnsiEsc + tabular - # Nix - vim-addon-nix tlib - vim-addon-vim2nix + # Nix + vim-addon-nix + tlib + vim-addon-vim2nix - # LaTeX - vim-latex-live-preview - vimtex + # LaTeX + vim-latex-live-preview + vimtex - # YAML - vim-yaml + # YAML + vim-yaml - # markdown - vim-markdown - vim-markdown-toc + # markdown + vim-markdown + vim-markdown-toc - # misc syntax support - vim-bazel maktaba - ]) - ; + # misc syntax support + vim-bazel + maktaba + ]); }; } diff --git a/nix/home-manager/programs/pass.nix b/nix/home-manager/programs/pass.nix index ea6f4ce..a952454 100644 --- a/nix/home-manager/programs/pass.nix +++ b/nix/home-manager/programs/pass.nix @@ -1,23 +1,15 @@ -{ pkgs -, ... -}: +{ pkgs, ... }: { home.sessionVariables = { # required by pass-otp - PASSWORD_STORE_EXTENSIONS_DIR = "$HOME/.nix-profile/lib/password-store/extensions"; + PASSWORD_STORE_EXTENSIONS_DIR = + "$HOME/.nix-profile/lib/password-store/extensions"; PASSWORD_STORE_ENABLE_EXTENSIONS = "true"; }; - - programs.browserpass = { - enable = true; - }; - home.packages = with pkgs; [ - pass - qtpass - rofi-pass - gnupg - ]; + programs.browserpass = { enable = true; }; + + home.packages = with pkgs; [ pass qtpass rofi-pass gnupg ]; } diff --git a/nix/home-manager/programs/podman.nix b/nix/home-manager/programs/podman.nix index ec8e86a..0a24db3 100644 --- a/nix/home-manager/programs/podman.nix +++ b/nix/home-manager/programs/podman.nix @@ -1,50 +1,48 @@ -{ pkgs -, ... -}: +{ pkgs, ... }: let cniConfigDir = let - loopback = pkgs.writeText "00-loopback.conf" '' - { - "cniVersion": "0.3.0", - "type": "loopback" - } - ''; - - podman-bridge = pkgs.writeText "87-podman-bridge.conflist" '' - { - "cniVersion": "0.3.0", - "name": "podman", - "plugins": [ - { - "type": "bridge", - "bridge": "cni0", - "isGateway": true, - "ipMasq": true, - "ipam": { - "type": "host-local", - "subnet": "10.88.0.0/16", - "routes": [ - { "dst": "0.0.0.0/0" } - ] - } - }, - { - "type": "portmap", - "capabilities": { - "portMappings": true - } - } - ] - } - ''; - in pkgs.runCommand "cniConfig" {} '' - set -x - mkdir $out; - ln -s ${loopback} $out/${loopback.name} - ln -s ${podman-bridge} $out/${podman-bridge.name} + loopback = pkgs.writeText "00-loopback.conf" '' + { + "cniVersion": "0.3.0", + "type": "loopback" + } ''; + podman-bridge = pkgs.writeText "87-podman-bridge.conflist" '' + { + "cniVersion": "0.3.0", + "name": "podman", + "plugins": [ + { + "type": "bridge", + "bridge": "cni0", + "isGateway": true, + "ipMasq": true, + "ipam": { + "type": "host-local", + "subnet": "10.88.0.0/16", + "routes": [ + { "dst": "0.0.0.0/0" } + ] + } + }, + { + "type": "portmap", + "capabilities": { + "portMappings": true + } + } + ] + } + ''; + in pkgs.runCommand "cniConfig" { } '' + set -x + mkdir $out; + ln -s ${loopback} $out/${loopback.name} + ln -s ${podman-bridge} $out/${podman-bridge.name} + ''; + containersConf = pkgs.writeText "containers.conf" '' # containers.conf is the default configuration file for all tools using libpod to # manage containers @@ -107,9 +105,7 @@ let default_network = "podman" ''; in { - home.packages = with pkgs; [ - podman - ]; + home.packages = with pkgs; [ podman ]; home.file.".config/containers/containers.conf".source = containersConf; diff --git a/nix/home-manager/programs/vscode/default.nix b/nix/home-manager/programs/vscode/default.nix index 7bcd984..8d79042 100644 --- a/nix/home-manager/programs/vscode/default.nix +++ b/nix/home-manager/programs/vscode/default.nix @@ -462,20 +462,16 @@ let sha256 = "1jmmbz3i0hxq5ka4rsk07mynxh3pkh5g736d9ryv1czhnrb06lwf"; } ]; -in -{ +in { programs.vscode = { enable = true; - extensions = [] - ++ packagedExtensions - # ++ marketPlaceExtensions - ; + extensions = [ ] ++ packagedExtensions + # ++ marketPlaceExtensions + ; }; - home.packages = [ - pkgs.nixpkgs-fmt - ]; + home.packages = [ pkgs.nixpkgs-fmt ]; } # TODO: automate diff --git a/nix/home-manager/programs/zsh.nix b/nix/home-manager/programs/zsh.nix index f5475aa..0fa0f33 100644 --- a/nix/home-manager/programs/zsh.nix +++ b/nix/home-manager/programs/zsh.nix @@ -3,37 +3,36 @@ { ... }: let - just-plugin = - let - plugin_file = pkgs.writeText "_just" '' - #compdef just - #autload + just-plugin = let + plugin_file = pkgs.writeText "_just" '' + #compdef just + #autload - alias justl="\just --list" - alias juste="\just --evaluate" + alias justl="\just --list" + alias juste="\just --evaluate" - local subcmds=() + local subcmds=() - while read -r line ; do - if [[ ! $line == Available* ]] ; - then - subcmds+=(''${line/[[:space:]]*\#/:}) - fi - done < <(just --list) + while read -r line ; do + if [[ ! $line == Available* ]] ; + then + subcmds+=(''${line/[[:space:]]*\#/:}) + fi + done < <(just --list) - _describe 'command' subcmds - ''; + _describe 'command' subcmds + ''; - in pkgs.stdenv.mkDerivation { - name = "just-completions"; - version = "0.1.0"; - phases = "installPhase"; - installPhase = '' - PLUGIN_PATH=$out/share/oh-my-zsh/plugins/just - mkdir -p $PLUGIN_PATH - cp ${plugin_file} $PLUGIN_PATH/_just - chmod --recursive a-w $out - ''; + in pkgs.stdenv.mkDerivation { + name = "just-completions"; + version = "0.1.0"; + phases = "installPhase"; + installPhase = '' + PLUGIN_PATH=$out/share/oh-my-zsh/plugins/just + mkdir -p $PLUGIN_PATH + cp ${plugin_file} $PLUGIN_PATH/_just + chmod --recursive a-w $out + ''; }; in { @@ -43,8 +42,7 @@ in { # will be called again by oh-my-zsh enableCompletion = false; enableAutosuggestions = true; - initExtra = let - inNixShell = ''$([[ -n "$IN_NIX_SHELL" ]] && printf " 🐚")''; + initExtra = let inNixShell = ''$([[ -n "$IN_NIX_SHELL" ]] && printf " 🐚")''; in '' PROMPT='%F{%(!.red.green)}%n%f@%m %(?.%F{green}✓%f.%F{red}✗ ($?%))%f %F{blue}%~%f${inNixShell}%F{magenta}$(git_prompt_info)%f$prompt_newline%_%F{%(!.red.green)}$(prompt_char)%f ' RPROMPT="" @@ -59,8 +57,8 @@ in { ${if builtins.hasAttr "homeshick" pkgs then '' source ${pkgs.homeshick}/homeshick.sh fpath=(${pkgs.homeshick}/completions $fpath) - '' else '' - ''} + '' else + ""} # Disable intercepting of ctrl-s and ctrl-q as flow control. stty stop ''' -ixoff -ixon @@ -117,10 +115,7 @@ in { oh-my-zsh = { enable = true; theme = "tjkirch"; - plugins = [ - "git" - "sudo" - ]; + plugins = [ "git" "sudo" ]; }; }; } diff --git a/nix/ops/nano/configuration.nix b/nix/ops/nano/configuration.nix index afc3626..9c10eaf 100644 --- a/nix/ops/nano/configuration.nix +++ b/nix/ops/nano/configuration.nix @@ -5,10 +5,9 @@ { n, pkgs, ... }: { - imports = - [ # Include the results of the hardware scan. - ./hardware-configuration.nix - ]; + imports = [ # Include the results of the hardware scan. + ./hardware-configuration.nix + ]; # Use the GRUB 2 boot loader. boot.loader.grub.enable = true; diff --git a/nix/ops/nano/hardware-configuration.nix b/nix/ops/nano/hardware-configuration.nix index 501306c..d23eb0f 100644 --- a/nix/ops/nano/hardware-configuration.nix +++ b/nix/ops/nano/hardware-configuration.nix @@ -4,18 +4,17 @@ { config, lib, pkgs, ... }: { - imports = - [ - ]; + imports = [ ]; - boot.initrd.availableKernelModules = [ "xhci_pci" "ehci_pci" "ahci" "usb_storage" "usbhid" "sd_mod" ]; + boot.initrd.availableKernelModules = + [ "xhci_pci" "ehci_pci" "ahci" "usb_storage" "usbhid" "sd_mod" ]; boot.kernelModules = [ "kvm-intel" ]; boot.extraModulePackages = [ ]; - fileSystems."/" = - { device = "/dev/disk/by-uuid/e02a410e-5044-440f-90e9-b573e51f1315"; - fsType = "ext4"; - }; + fileSystems."/" = { + device = "/dev/disk/by-uuid/e02a410e-5044-440f-90e9-b573e51f1315"; + fsType = "ext4"; + }; swapDevices = [ ]; diff --git a/nix/ops/nanos@kn.nix b/nix/ops/nanos@kn.nix index d2003da..028b8ac 100644 --- a/nix/ops/nanos@kn.nix +++ b/nix/ops/nanos@kn.nix @@ -1,26 +1,25 @@ -{ nixpkgs ? import {} -, nrNanos ? 1 # Number of nanos +{ nixpkgs ? import { }, nrNanos ? 1 # Number of nanos }: -let +let pkgs = nixpkgs; - webserver = { services.httpd.enable = true; - services.httpd.adminAddr = "mail@stefanjunker.de"; - services.httpd.documentRoot = "${pkgs.nixops}/share/doc/nixops/"; - networking.firewall.allowedTCPPorts = [ 80 ]; + webserver = { + services.httpd.enable = true; + services.httpd.adminAddr = "mail@stefanjunker.de"; + services.httpd.documentRoot = "${pkgs.nixops}/share/doc/nixops/"; + networking.firewall.allowedTCPPorts = [ 80 ]; }; mkNano = { n }: { - imports = [ - (import ./nano/configuration.nix {inherit pkgs n;}) - ../configuration/common/user/root.nix - ]; - deployment.targetEnv = "none"; - deployment.targetHost = "nano${toString n}"; + imports = [ + (import ./nano/configuration.nix { inherit pkgs n; }) + ../configuration/common/user/root.nix + ]; + deployment.targetEnv = "none"; + deployment.targetHost = "nano${toString n}"; }; - mkNanos = n: nixpkgs.lib.nameValuePair "nano${toString n}" ( - mkNano { inherit n; } - ); + mkNanos = n: + nixpkgs.lib.nameValuePair "nano${toString n}" (mkNano { inherit n; }); in nixpkgs.lib.listToAttrs (map mkNanos (nixpkgs.lib.range 0 (nrNanos - 1))) diff --git a/nix/os/containers/backup-target.nix b/nix/os/containers/backup-target.nix index 8f396f5..3db6823 100644 --- a/nix/os/containers/backup-target.nix +++ b/nix/os/containers/backup-target.nix @@ -1,20 +1,15 @@ -{ hostAddress -, localAddress -, containerBackupCfg -, sshPort ? containerBackupCfg.portInt -}: { +{ hostAddress, localAddress, containerBackupCfg +, sshPort ? containerBackupCfg.portInt }: { config = { config, pkgs, lib, ... }: { system.stateVersion = "21.11"; # Did you read the comment? - imports = [ - ../profiles/containers/configuration.nix - ]; + imports = [ ../profiles/containers/configuration.nix ]; networking.firewall.enable = false; services.ddclientovh = { - enable = true; - domain = containerBackupCfg.addr; + enable = true; + domain = containerBackupCfg.addr; }; services.openssh.enable = true; @@ -28,26 +23,34 @@ "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQDNI3H0BRSYOZ/MbTs9J80doJwSd1HymFOP5quNt0J48vxZ5FPVrT2FHpQiNrCcYbCKRsU4X8AiGUHiXC0PapQQ3JDkqp6WZoqBNDx6BI7RadyH1TqVQPlou3pQmCAogzfBInruR53YTDmQqXiPwfM0okPOXgiBNjDfZXOX4+CyUfkmZZwASoicTInqWGkn1sFnh4tyXIkgWflg0njlVmfkVvH71+evvKLYHtoNpVXazkQ0SXbyuW5f3mSta7TNkpC3HbBm+4n+WxYGySrlRLWQhTo+aoWUKk9h5zvECDNpwRtbqzt+bA9nKrdg180ceu8hruwvWNiC6PPA2GW9Z1+VKROviGu1C3dliE/pPCBtK+ZoRVv2CGE+pmAuQsB9Nif9tk5tY6HJhuLNxKYiMfQkiLsDYv6KdZXUIVK/4BIDkZuQNnjhdOQBLnea0ANOhutA9gnjxnsd3UT6ovfazg5gud7n3u4yBtzjTkRrqWZ63eM1NmUVOgMWHQ715pV+hJfOFGqzRBEe3g/p3bWNgpROBYJbG1H8l9DN7emG4FGWsb1HeNFwQ5lS0Zsezb7qzahr4vSmHNugVw7w8ONt5dPbPI9wQnWvkkuHH76P/NYy6OC6lHrN1rXyA1okqdPr06YAZnCot+Pqdgn/ijxgp06J3dtkhin+Q7PoQbGff3ERIw== bkp" ]; - packages = with pkgs; [ - btrfsProgs - # btrbk - ]; + packages = with pkgs; + [ + btrfsProgs + # btrbk + ]; isSystemUser = true; }; security.sudo = { enable = true; - extraRules = [ - { - users = [ "bkp" ]; - commands = [ - { command = "/etc/profiles/per-user/bkp/bin/btrfs"; options = [ "NOPASSWD" ]; } - { command = "/run/current-system/sw/bin/readlink"; options = [ "NOPASSWD" ]; } - { command = "/run/current-system/sw/bin/test"; options = [ "NOPASSWD" ]; } - ]; - } - ]; + extraRules = [{ + users = [ "bkp" ]; + commands = [ + { + command = "/etc/profiles/per-user/bkp/bin/btrfs"; + options = [ "NOPASSWD" ]; + } + { + command = "/run/current-system/sw/bin/readlink"; + options = [ "NOPASSWD" ]; + } + { + command = "/run/current-system/sw/bin/test"; + options = [ "NOPASSWD" ]; + } + ]; + }]; }; }; @@ -61,14 +64,12 @@ }; privateNetwork = true; - forwardPorts = [ - { - # ssh - containerPort = 22; - hostPort = sshPort; - protocol = "tcp"; - } - ]; + forwardPorts = [{ + # ssh + containerPort = 22; + hostPort = sshPort; + protocol = "tcp"; + }]; inherit hostAddress localAddress; } diff --git a/nix/os/containers/backup.nix b/nix/os/containers/backup.nix index fa6455b..f83bef9 100644 --- a/nix/os/containers/backup.nix +++ b/nix/os/containers/backup.nix @@ -1,9 +1,4 @@ -{ config -, hostAddress -, localAddress -, subvolumes -, targetPathSuffix ? "" -}: +{ config, hostAddress, localAddress, subvolumes, targetPathSuffix ? "" }: let passwords = import ../../variables/passwords.crypt.nix; @@ -13,14 +8,9 @@ in { config = { pkgs, ... }: { system.stateVersion = "20.03"; # Did you read the comment? - imports = [ - ../profiles/containers/configuration.nix - ]; + imports = [ ../profiles/containers/configuration.nix ]; - environment.systemPackages = with pkgs; [ - btrfs-progs - btrbk - ]; + environment.systemPackages = with pkgs; [ btrfs-progs btrbk ]; networking.firewall.enable = true; @@ -28,17 +18,11 @@ in { enable = true; description = "bkp-sync service"; - serviceConfig = { - Type = "oneshot"; - }; + serviceConfig = { Type = "oneshot"; }; - after = [ - "bkp-run.service" - ]; + after = [ "bkp-run.service" ]; - requires = [ - "bkp-run.service" - ]; + requires = [ "bkp-run.service" ]; path = with pkgs; [ utillinux ]; script = '' @@ -51,17 +35,13 @@ in { enable = true; description = "bkp-run"; - serviceConfig = { - Type = "oneshot"; - }; + serviceConfig = { Type = "oneshot"; }; - partOf = [ - "bkp-sync.service" - ]; + partOf = [ "bkp-sync.service" ]; path = with pkgs; [ btrfs-progs btrbk coreutils ]; - script = let + script = let btrbkConf = pkgs.writeText "cfg" '' timestamp_format long ssh_identity ${passwords.storage.backupTarget.keyPath} @@ -78,7 +58,8 @@ in { volume ${subvolumeParentDir} target ${passwords.storage.backupTarget.target}/container-volumes/${targetPathSuffix} - ${builtins.foldl' (sum: elem: sum + " subvolume " + elem + "\n") "" subvolumes} + ${builtins.foldl' (sum: elem: sum + " subvolume " + elem + "\n") "" + subvolumes} ''; in '' #! ${pkgs.bash}/bin/bash @@ -95,10 +76,10 @@ in { timerConfig = { # Obtained using `systemd-analyze calendar "Wed 23:00"` # OnCalendar = "Wed *-*-* 23:00:00"; - OnStartupSec="1m"; + OnStartupSec = "1m"; Unit = "bkp-sync.service"; - OnUnitInactiveSec="2h"; - Persistent="true"; + OnUnitInactiveSec = "2h"; + Persistent = "true"; }; }; }; @@ -122,13 +103,13 @@ in { }; }; - allowedDevices = [ - { node = "/dev/fuse"; modifier = "rw"; } - ]; + allowedDevices = [{ + node = "/dev/fuse"; + modifier = "rw"; + }]; privateNetwork = true; - forwardPorts = [ - ]; + forwardPorts = [ ]; inherit hostAddress localAddress; } diff --git a/nix/os/containers/mailserver.nix b/nix/os/containers/mailserver.nix index 3ac361f..6494094 100644 --- a/nix/os/containers/mailserver.nix +++ b/nix/os/containers/mailserver.nix @@ -1,28 +1,20 @@ -{ hostAddress -, localAddress -, imapsPort ? 993 -, sievePort ? 4190 -}: +{ hostAddress, localAddress, imapsPort ? 993, sievePort ? 4190 }: -let - passwords = import ../../variables/passwords.crypt.nix; +let passwords = import ../../variables/passwords.crypt.nix; -in -{ +in { config = { pkgs, ... }: { system.stateVersion = "21.11"; # Did you read the comment? - imports = [ - ../profiles/containers/configuration.nix - ../profiles/common/user.nix - ]; + imports = + [ ../profiles/containers/configuration.nix ../profiles/common/user.nix ]; networking.firewall.enable = false; services.ddclientovh = { - enable = true; - domain = "mailserver.svc.stefanjunker.de"; + enable = true; + domain = "mailserver.svc.stefanjunker.de"; }; services.dovecot2 = { @@ -43,7 +35,7 @@ in extraConfig = '' auth_mechanisms = cram-md5 digest-md5 auth_verbose = yes - + passdb { driver = passwd-file args = scheme=CRYPT username_format=%u /etc/dovecot/users @@ -75,26 +67,26 @@ in description = "Getmail service"; path = [ pkgs.getmail6 ]; script = let - rc = pkgs.writeText "mailATstefanjunker.de.getmail.rc" '' - [options] - verbose = 1 - read_all = 0 - delete_after = 30 + rc = pkgs.writeText "mailATstefanjunker.de.getmail.rc" '' + [options] + verbose = 1 + read_all = 0 + delete_after = 30 - [retriever] - type = SimpleIMAPSSLRetriever - server = ssl0.ovh.net - port = 993 - username = mail@stefanjunker.de - password = ${passwords.email.mailStefanjunkerDe} - mailboxes = ('INBOX',) + [retriever] + type = SimpleIMAPSSLRetriever + server = ssl0.ovh.net + port = 993 + username = mail@stefanjunker.de + password = ${passwords.email.mailStefanjunkerDe} + mailboxes = ('INBOX',) - [destination] - type = MDA_external - path = ${pkgs.dovecot}/libexec/dovecot/dovecot-lda - ''; - in '' - getmail --rcfile=${rc} --idle=INBOX + [destination] + type = MDA_external + path = ${pkgs.dovecot}/libexec/dovecot/dovecot-lda + ''; + in '' + getmail --rcfile=${rc} --idle=INBOX ''; }; @@ -108,45 +100,45 @@ in serviceConfig.RestartSec = 1000; serviceConfig.Restart = "always"; script = let - rc = pkgs.writeText "schtifATweb.de.getmail.rc" '' - [options] - verbose = 1 - read_all = 0 - delete_after = 30 + rc = pkgs.writeText "schtifATweb.de.getmail.rc" '' + [options] + verbose = 1 + read_all = 0 + delete_after = 30 - [retriever] - type = SimpleIMAPSSLRetriever - server = imap.web.de - port = 993 - username = schtif - password = ${passwords.email.schtifATwebDe} - mailboxes = ('INBOX',) + [retriever] + type = SimpleIMAPSSLRetriever + server = imap.web.de + port = 993 + username = schtif + password = ${passwords.email.schtifATwebDe} + mailboxes = ('INBOX',) - [destination] - type = Maildir - path = ~/.maildir/ - ''; - in '' - getmail --rcfile=${rc} + [destination] + type = Maildir + path = ~/.maildir/ + ''; + in '' + getmail --rcfile=${rc} ''; - }; }; + }; autoStart = true; bindMounts = { - "/etc/secrets/" = { + "/etc/secrets/" = { hostPath = "/var/lib/container-volumes/mailserver/etc-secrets"; isReadOnly = false; }; - "/home" = { + "/home" = { hostPath = "/var/lib/container-volumes/mailserver/home"; isReadOnly = false; }; }; - privateNetwork = true ; + privateNetwork = true; forwardPorts = [ { # imaps diff --git a/nix/os/containers/syncthing.nix b/nix/os/containers/syncthing.nix index 65a4238..c36bfac 100644 --- a/nix/os/containers/syncthing.nix +++ b/nix/os/containers/syncthing.nix @@ -1,17 +1,12 @@ -{ hostAddress -, localAddress -, syncthingPort ? 22000 -, syncthingLocalAnnouncePort ? 21027 -}: +{ hostAddress, localAddress, syncthingPort ? 22000 +, syncthingLocalAnnouncePort ? 21027 }: { config = { config, pkgs, ... }: { system.stateVersion = "20.05"; # Did you read the comment? - imports = [ - ../profiles/containers/configuration.nix - ]; + imports = [ ../profiles/containers/configuration.nix ]; networking.firewall.enable = true; networking.firewall.allowedTCPPorts = [ diff --git a/nix/os/containers/webserver.nix b/nix/os/containers/webserver.nix index b875d02..e606a96 100644 --- a/nix/os/containers/webserver.nix +++ b/nix/os/containers/webserver.nix @@ -1,25 +1,17 @@ -{ hostAddress -, localAddress -, httpPort ? 80 -, httpsPort ? 443 -}: +{ hostAddress, localAddress, httpPort ? 80, httpsPort ? 443 }: -let - passwords = import ../../variables/passwords.crypt.nix; -in -{ +let passwords = import ../../variables/passwords.crypt.nix; +in { config = { config, pkgs, lib, ... }: { system.stateVersion = "22.05"; # Did you read the comment? - imports = [ - ../profiles/containers/configuration.nix - ]; + imports = [ ../profiles/containers/configuration.nix ]; networking.firewall.enable = false; services.ddclientovh = { - enable = true; - domain = "www.stefanjunker.de"; + enable = true; + domain = "www.stefanjunker.de"; }; security.acme = { @@ -58,20 +50,16 @@ in # sslCertificate = "/etc/secrets/stefanjunker.de/nginx/nginx.crt"; # sslCertificateKey = "/etc/secrets/stefanjunker.de/nginx/nginx.key"; - locations."/fi" = { - index = "index.php"; - }; + locations."/fi" = { index = "index.php"; }; - locations."~ ^(.+\.php)(.*)$".extraConfig = '' + locations."~ ^(.+.php)(.*)$".extraConfig = '' fastcgi_split_path_info ^(.+\.php)(.*)$; fastcgi_pass unix:${config.services.phpfpm.pools.mypool.socket}; fastcgi_index index.php; ''; - locations."/hedgedoc/" = { - proxyPass = "http://127.0.0.1:3000/"; - }; + locations."/hedgedoc/" = { proxyPass = "http://127.0.0.1:3000/"; }; locations."/hedgedoc/socket.io/" = { proxyPass = "http://127.0.0.1:3000/socket.io/"; @@ -92,15 +80,14 @@ in "pm.max_spare_servers" = 3; "pm.max_requests" = 500; - "php_admin_value[error_reporting]" = "E_ALL & ~E_NOTICE & ~E_WARNING & ~E_STRICT & ~E_DEPRECATED"; + "php_admin_value[error_reporting]" = + "E_ALL & ~E_NOTICE & ~E_WARNING & ~E_STRICT & ~E_DEPRECATED"; }; }; # the custom php5 we're using here has no fpm-systemd, so the default `Type = "notify"` won't work systemd.services."phpfpm-mypool" = { - serviceConfig = { - Type = lib.mkForce "simple"; - }; + serviceConfig = { Type = lib.mkForce "simple"; }; }; services.mysql = { diff --git a/nix/os/devices/167.233.1.14/boot.nix b/nix/os/devices/167.233.1.14/boot.nix index 18fcc13..8a093b9 100644 --- a/nix/os/devices/167.233.1.14/boot.nix +++ b/nix/os/devices/167.233.1.14/boot.nix @@ -1,6 +1,4 @@ -{ lib -, ... -}: +{ lib, ... }: { boot.loader.grub.efiSupport = lib.mkForce false; diff --git a/nix/os/devices/167.233.1.14/configuration.nix b/nix/os/devices/167.233.1.14/configuration.nix index 626c5f1..e76498f 100644 --- a/nix/os/devices/167.233.1.14/configuration.nix +++ b/nix/os/devices/167.233.1.14/configuration.nix @@ -1,8 +1,7 @@ { ... }: { - disabledModules = [ - ]; + disabledModules = [ ]; imports = [ ../../profiles/common/configuration.nix diff --git a/nix/os/devices/167.233.1.14/hw.nix b/nix/os/devices/167.233.1.14/hw.nix index aff1de3..ae957f6 100644 --- a/nix/os/devices/167.233.1.14/hw.nix +++ b/nix/os/devices/167.233.1.14/hw.nix @@ -1,7 +1,7 @@ { ... }: let - stage1Modules = [ + stage1Modules = [ "virtio_balloon" "virtio_scsi" "virtio_net" @@ -18,8 +18,7 @@ let "ata_generic" ]; -in -{ +in { fileSystems."/boot" = { device = "/dev/disk/by-uuid/354fb107-2f4a-42ad-80dd-9dddb61bfd02"; fsType = "ext4"; @@ -39,14 +38,12 @@ in neededForBoot = true; }; - swapDevices = [ { device = "/dev/disk/by-uuid/d16b5f4a-f38c-41c6-8aae-1625be815f9d"; } ]; + swapDevices = + [{ device = "/dev/disk/by-uuid/d16b5f4a-f38c-41c6-8aae-1625be815f9d"; }]; - boot.loader.grub = { - device = "/dev/vda"; - }; + boot.loader.grub = { device = "/dev/vda"; }; boot.initrd.availableKernelModules = stage1Modules; boot.initrd.kernelModules = stage1Modules; - boot.extraModprobeConfig = '' - ''; + boot.extraModprobeConfig = ""; } diff --git a/nix/os/devices/167.233.1.14/pkg.nix b/nix/os/devices/167.233.1.14/pkg.nix index bad7478..b41fb5d 100644 --- a/nix/os/devices/167.233.1.14/pkg.nix +++ b/nix/os/devices/167.233.1.14/pkg.nix @@ -1,30 +1,29 @@ -{ config -, pkgs -, lib -, ... -}: +{ config, pkgs, lib, ... }: { - nixpkgs.config.packageOverrides = pkgs: with pkgs; { - nixPath = (import ../../../default.nix { versionsPath = ./versions.nix; }).nixPath; - }; - home-manager.users.steveej = import ../../../home-manager/configuration/text-minimal.nix { - inherit pkgs; - extraPackages = [ - # required by vscode's remote-ssh plugin - pkgs.nodejs + nixpkgs.config.packageOverrides = pkgs: + with pkgs; { + nixPath = (import ../../../default.nix { + versionsPath = ./versions.nix; + }).nixPath; + }; + home-manager.users.steveej = + import ../../../home-manager/configuration/text-minimal.nix { + inherit pkgs; + extraPackages = [ + # required by vscode's remote-ssh plugin + pkgs.nodejs - # allow clipboard exchanges - pkgs.xsel - pkgs.xclip - ]; - }; + # allow clipboard exchanges + pkgs.xsel + pkgs.xclip + ]; + }; - nix.buildMachines = [ - { hostName = "localhost"; - system = "x86_64-linux"; - supportedFeatures = ["kvm" "nixos-test" "big-parallel" "benchmark"]; - maxJobs = 4; - } - ]; + nix.buildMachines = [{ + hostName = "localhost"; + system = "x86_64-linux"; + supportedFeatures = [ "kvm" "nixos-test" "big-parallel" "benchmark" ]; + maxJobs = 4; + }]; } diff --git a/nix/os/devices/167.233.1.14/system.nix b/nix/os/devices/167.233.1.14/system.nix index 16dd027..48ff5b1 100644 --- a/nix/os/devices/167.233.1.14/system.nix +++ b/nix/os/devices/167.233.1.14/system.nix @@ -1,15 +1,9 @@ -{ pkgs -, lib -, config -, ... }: +{ pkgs, lib, config, ... }: -let - keys = import ../../../variables/keys.nix; +let keys = import ../../../variables/keys.nix; in { - nix.binaryCaches = [ - "https://cache.holo.host" - ]; + nix.binaryCaches = [ "https://cache.holo.host" ]; nix.binaryCachePublicKeys = [ "cache.holo.host-1:lNXIXtJgS9Iuw4Cu6X0HINLu9sTfcjEntnrgwMQIMcE=" @@ -32,11 +26,11 @@ in { networking.interfaces.eth0 = { mtu = 1400; useDHCP = false; - ipv4.addresses = [ - { "address" = "167.233.1.14"; "prefixLength" = 29; } - ]; - ipv6.addresses = [ - ]; + ipv4.addresses = [{ + "address" = "167.233.1.14"; + "prefixLength" = 29; + }]; + ipv6.addresses = [ ]; }; networking.defaultGateway = { @@ -49,9 +43,7 @@ in { interface = "eth0"; }; - networking.nameservers = [ - "1.1.1.1" - ]; + networking.nameservers = [ "1.1.1.1" ]; networking.nat = { enable = true; @@ -63,9 +55,7 @@ in { # services.kubernetes.roles = ["master" "node"]; # virtualization - virtualisation = { - docker.enable = true; - }; + virtualisation = { docker.enable = true; }; services.spice-vdagentd.enable = true; services.qemuGuest.enable = true; @@ -79,25 +69,21 @@ in { ''; }; - systemd.services.sshd.serviceConfig = { - TasksMax = 32; - }; + systemd.services.sshd.serviceConfig = { TasksMax = 32; }; systemd.timers."sshd-status" = { description = "Timer to trigger sshd-status periodically"; enable = true; wantedBy = [ "timer.target" "multi-user.target" ]; timerConfig = { - OnActiveSec="360s"; - OnUnitActiveSec="360s"; - AccuracySec="1s"; + OnActiveSec = "360s"; + OnUnitActiveSec = "360s"; + AccuracySec = "1s"; Unit = "sshd-status.service"; }; }; - nix.gc = { - automatic = true; - }; + nix.gc = { automatic = true; }; networking.useHostResolvConf = true; diff --git a/nix/os/devices/167.233.1.14/versions.nix b/nix/os/devices/167.233.1.14/versions.nix index ef51563..29e6ef6 100644 --- a/nix/os/devices/167.233.1.14/versions.nix +++ b/nix/os/devices/167.233.1.14/versions.nix @@ -4,9 +4,8 @@ let ref = "nixos-21.11"; rev = "e34c5379866833f41e2a36f309912fa675d687c7"; }; -in -{ +in { inherit nixpkgs; "channels-nixos-stable" = nixpkgs; "channels-nixos-21.05" = { diff --git a/nix/os/devices/167.233.1.14/versions.tmpl.nix b/nix/os/devices/167.233.1.14/versions.tmpl.nix index 2ad257f..6c25db6 100644 --- a/nix/os/devices/167.233.1.14/versions.tmpl.nix +++ b/nix/os/devices/167.233.1.14/versions.tmpl.nix @@ -2,46 +2,61 @@ let nixpkgs = { url = "https://github.com/NixOS/nixpkgs/"; ref = "nixos-21.11"; - rev = "<% git ls-remote https://github.com/nixos/nixpkgs nixos-21.11 | awk '{ print $1 }' | tr -d '\n' -%>"; + rev = '' + <% git ls-remote https://github.com/nixos/nixpkgs nixos-21.11 | awk '{ print $1 }' | tr -d ' + ' -%>''; }; -in -{ +in { inherit nixpkgs; "channels-nixos-stable" = nixpkgs; "channels-nixos-21.05" = { url = "https://github.com/NixOS/nixpkgs/"; ref = "nixos-21.05"; - rev = "<% git ls-remote https://github.com/nixos/nixpkgs nixos-20.05 | awk '{ print $1 }' | tr -d '\n' -%>"; + rev = '' + <% git ls-remote https://github.com/nixos/nixpkgs nixos-20.05 | awk '{ print $1 }' | tr -d ' + ' -%>''; }; "channels-nixos-20.09" = { url = "https://github.com/NixOS/nixpkgs/"; ref = "nixos-20.09"; - rev = "<% git ls-remote https://github.com/nixos/nixpkgs nixos-20.09 | awk '{ print $1 }' | tr -d '\n' -%>"; + rev = '' + <% git ls-remote https://github.com/nixos/nixpkgs nixos-20.09 | awk '{ print $1 }' | tr -d ' + ' -%>''; }; "channels-nixos-20.03" = { url = "https://github.com/NixOS/nixpkgs/"; ref = "nixos-20.03"; - rev = "<% git ls-remote https://github.com/nixos/nixpkgs nixos-20.03 | awk '{ print $1 }' | tr -d '\n' -%>"; + rev = '' + <% git ls-remote https://github.com/nixos/nixpkgs nixos-20.03 | awk '{ print $1 }' | tr -d ' + ' -%>''; }; "channels-nixos-19.09" = { url = "https://github.com/NixOS/nixpkgs/"; ref = "nixos-19.09"; - rev = "<% git ls-remote https://github.com/nixos/nixpkgs nixos-19.09 | awk '{ print $1 }' | tr -d '\n' -%>"; + rev = '' + <% git ls-remote https://github.com/nixos/nixpkgs nixos-19.09 | awk '{ print $1 }' | tr -d ' + ' -%>''; }; "channels-nixos-unstable" = { url = "https://github.com/NixOS/nixpkgs/"; ref = "nixos-unstable"; - rev = "<% git ls-remote https://github.com/nixos/nixpkgs nixos-unstable | awk '{ print $1 }' | tr -d '\n' -%>"; + rev = '' + <% git ls-remote https://github.com/nixos/nixpkgs nixos-unstable | awk '{ print $1 }' | tr -d ' + ' -%>''; }; "nixpkgs-master" = { url = "https://github.com/NixOS/nixpkgs/"; ref = "master"; - rev = "<% git ls-remote https://github.com/NixOS/nixpkgs.git master | head -n1 | awk '{ print $1 }' | tr -d '\n' -%>"; + rev = '' + <% git ls-remote https://github.com/NixOS/nixpkgs.git master | head -n1 | awk '{ print $1 }' | tr -d ' + ' -%>''; }; "home-manager-module" = { url = "https://github.com/nix-community/home-manager"; ref = "release-21.05"; - rev = "<% git ls-remote https://github.com/nix-community/home-manager.git release-21.05 | awk '{ print $1 }' | tr -d '\n' -%>"; + rev = '' + <% git ls-remote https://github.com/nix-community/home-manager.git release-21.05 | awk '{ print $1 }' | tr -d ' + ' -%>''; }; } diff --git a/nix/os/devices/default.nix b/nix/os/devices/default.nix index 64ec60c..3016aa2 100644 --- a/nix/os/devices/default.nix +++ b/nix/os/devices/default.nix @@ -1,45 +1,35 @@ -{ dir -, pkgs ? import {} -, ownLib ? import ../lib/default.nix { } -, gitRoot ? "$(git rev-parse --show-toplevel)" +{ dir, pkgs ? import { } +, ownLib ? import ../lib/default.nix { }, gitRoot ? + "$(git rev-parse --show-toplevel)" -# FIXME: why do these need explicit mentioning? -, moreargs ? "" -, rebuildarg ? "" -, ... -} @ args : + # FIXME: why do these need explicit mentioning? +, moreargs ? "", rebuildarg ? "", ... }@args: let rebuildargsSudo = [ "switch" "boot" ]; - rebuild = { - gitRoot - , rebuildarg ? "dry-activate" - , moreargs ? "" + rebuild = { gitRoot, rebuildarg ? "dry-activate", moreargs ? "" - , ... - }: pkgs.writeScript "script" '' - #!/usr/bin/env bash - set -xe + , ... }: + pkgs.writeScript "script" '' + #!/usr/bin/env bash + set -xe - pushd ${gitRoot}/${dir} - export NIXOS_CONFIG="$PWD"/configuration.nix + pushd ${gitRoot}/${dir} + export NIXOS_CONFIG="$PWD"/configuration.nix - [[ -e "''${NIXOS_CONFIG}" ]] + [[ -e "''${NIXOS_CONFIG}" ]] - if test -L result; then - rm result - fi + if test -L result; then + rm result + fi - ${if (builtins.elem rebuildarg rebuildargsSudo) - && (builtins.match ".*--target-host.*" moreargs) == null - then + ${if (builtins.elem rebuildarg rebuildargsSudo) + && (builtins.match ".*--target-host.*" moreargs) == null then "sudo -E \\" else - "" - } - nixos-rebuild --show-trace -I nixos-config=''${NIXOS_CONFIG} ${rebuildarg} ${moreargs} - ''; - + ""} + nixos-rebuild --show-trace -I nixos-config=''${NIXOS_CONFIG} ${rebuildarg} ${moreargs} + ''; in { recipes = { @@ -48,9 +38,8 @@ in { inherit moreargs; inherit rebuildarg; } - # // pkgs.lib.attrsets.optionalAttrs (moreargs != "") { inherit moreargs; } - # // pkgs.lib.attrsets.optionalAttrs (rebuildarg != "") { inherit rebuildarg; } - ; - } // (import ./disk.nix (args // { inherit pkgs ownLib gitRoot; })) - ; + # // pkgs.lib.attrsets.optionalAttrs (moreargs != "") { inherit moreargs; } + # // pkgs.lib.attrsets.optionalAttrs (rebuildarg != "") { inherit rebuildarg; } + ; + } // (import ./disk.nix (args // { inherit pkgs ownLib gitRoot; })); } diff --git a/nix/os/devices/disk.nix b/nix/os/devices/disk.nix index 3928f6a..3df0be9 100644 --- a/nix/os/devices/disk.nix +++ b/nix/os/devices/disk.nix @@ -1,16 +1,12 @@ -{ pkgs -, ownLib -, dir -, gitRoot -, diskId ? (import ((builtins.getEnv "PWD")+"/${dir}/hw.nix") {}).hardware.opinionatedDisk.diskId -, encrypted ? (import ((builtins.getEnv "PWD")+"/${dir}/hw.nix") {}).hardware.opinionatedDisk.encrypted -, previousDiskId ? "" +{ pkgs, ownLib, dir, gitRoot, diskId ? + (import ((builtins.getEnv "PWD") + "/${dir}/hw.nix") + { }).hardware.opinionatedDisk.diskId, encrypted ? + (import ((builtins.getEnv "PWD") + "/${dir}/hw.nix") + { }).hardware.opinionatedDisk.encrypted, previousDiskId ? "" -, ... -}: +, ... }: -let - mntRootVol="/mnt/${diskId}-root"; +let mntRootVol = "/mnt/${diskId}-root"; in rec { diskMount = pkgs.writeScript "script" '' @@ -18,14 +14,18 @@ in rec { set -xe echo Mounting ${diskId} ${pkgs.lib.strings.optionalString encrypted '' - sudo cryptsetup luksOpen ${ownLib.disk.bootLuksDevice diskId} ${ownLib.disk.luksName diskId} + sudo cryptsetup luksOpen ${ownLib.disk.bootLuksDevice diskId} ${ + ownLib.disk.luksName diskId + } ''} sleep 1 sudo vgchange -ay ${ownLib.disk.volumeGroup diskId} sudo mkdir -p /mnt sudo mkdir ${mntRootVol} sudo mount ${ownLib.disk.rootFsDevice diskId} ${mntRootVol} - sudo mount ${ownLib.disk.rootFsDevice diskId} ${mntRootVol}/nixos/home -o subvol=home + sudo mount ${ + ownLib.disk.rootFsDevice diskId + } ${mntRootVol}/nixos/home -o subvol=home sudo mount ${ownLib.disk.bootFsDevice diskId} ${mntRootVol}/nixos/boot ''; @@ -62,7 +62,9 @@ in rec { #!/usr/bin/env bash set -xe - read -p "Continue to format ${ownLib.disk.bootGrubDevice diskId} (YES/n)? " choice + read -p "Continue to format ${ + ownLib.disk.bootGrubDevice diskId + } (YES/n)? " choice case "$choice" in YES ) echo "Continuing in 3 seconds..."; sleep 3;; n|N ) echo "Exiting..."; exit 0;; @@ -76,16 +78,16 @@ in rec { g n 1 - + +1M n 2 - + +512M n 3 - - + + t 1 4 @@ -109,11 +111,15 @@ in rec { ${pkgs.lib.strings.optionalString encrypted '' # Encrypt sudo cryptsetup luksFormat ${ownLib.disk.bootLuksDevice diskId} - - sudo cryptsetup luksOpen ${ownLib.disk.bootLuksDevice diskId} ${ownLib.disk.luksName diskId} + sudo cryptsetup luksOpen ${ownLib.disk.bootLuksDevice diskId} ${ + ownLib.disk.luksName diskId + } ''} # LVM - sudo vgcreate ${ownLib.disk.volumeGroup diskId} ${ownLib.disk.lvmPv diskId encrypted} + sudo vgcreate ${ownLib.disk.volumeGroup diskId} ${ + ownLib.disk.lvmPv diskId encrypted + } sudo lvcreate ${ownLib.disk.volumeGroup diskId} -L 2G -n swap sudo lvcreate ${ownLib.disk.volumeGroup diskId} -l 100%FREE -n root @@ -137,7 +143,9 @@ in rec { #!/usr/bin/env bash set -xe - read -p "Continue to relabel ${ownLib.disk.bootGrubDevice diskId} (YES/n)?" choice + read -p "Continue to relabel ${ + ownLib.disk.bootGrubDevice diskId + } (YES/n)?" choice case "$choice" in YES ) echo "Continuing in 3 seconds..."; sleep 3;; n|N ) echo "Exiting..."; exit 0;; @@ -168,9 +176,13 @@ in rec { if test "${previousDiskId}"; then - ${pkgs.lib.strings.optionalString encrypted '' - sudo cryptsetup luksOpen ${ownLib.disk.bootLuksDevice diskId} ${ownLib.disk.luksName diskId} - ''} + ${ + pkgs.lib.strings.optionalString encrypted '' + sudo cryptsetup luksOpen ${ownLib.disk.bootLuksDevice diskId} ${ + ownLib.disk.luksName diskId + } + '' + } sync sleep 1 if sudo vgs ${previousDiskId}; then diff --git a/nix/os/devices/elias-e525/boot.nix b/nix/os/devices/elias-e525/boot.nix index 2f5f8ea..a7eeb2c 100644 --- a/nix/os/devices/elias-e525/boot.nix +++ b/nix/os/devices/elias-e525/boot.nix @@ -1,8 +1,6 @@ -{ lib -, ... -}: +{ lib, ... }: { boot.loader.grub.efiInstallAsRemovable = lib.mkForce true; - boot.loader.efi.canTouchEfiVariables = lib.mkForce false; + boot.loader.efi.canTouchEfiVariables = lib.mkForce false; } diff --git a/nix/os/devices/elias-e525/hw.nix b/nix/os/devices/elias-e525/hw.nix index b47e571..fe78fa5 100644 --- a/nix/os/devices/elias-e525/hw.nix +++ b/nix/os/devices/elias-e525/hw.nix @@ -9,6 +9,5 @@ }; # boot.initrd.availableKernelModules = stage1Modules; - boot.extraModprobeConfig = '' - ''; + boot.extraModprobeConfig = ""; } diff --git a/nix/os/devices/elias-e525/pkg.nix b/nix/os/devices/elias-e525/pkg.nix index 4e31d4d..c4619b9 100644 --- a/nix/os/devices/elias-e525/pkg.nix +++ b/nix/os/devices/elias-e525/pkg.nix @@ -1,45 +1,41 @@ -{ pkgs -, lib -, ... -}: +{ pkgs, lib, ... }: let - homeEnv = keyboard: - { - imports = [ - (import ../../../home-manager/configuration/graphical-gnome3.nix { inherit pkgs; }) - ]; + homeEnv = keyboard: { + imports = [ + (import ../../../home-manager/configuration/graphical-gnome3.nix { + inherit pkgs; + }) + ]; - home.keyboard = keyboard; + home.keyboard = keyboard; - home.packages = with pkgs; [ - rhythmbox - lollypop - dia - kotatogram-desktop - jitsi - ]; - }; -in - -{ - nixpkgs.config.packageOverrides = pkgs: with pkgs; { - nixPath = (import ../../../default.nix { versionsPath = ./versions.nix; }).nixPath; + home.packages = with pkgs; [ + rhythmbox + lollypop + dia + kotatogram-desktop + jitsi + ]; }; - services.gnome = - builtins.mapAttrs - (attr: value: lib.mkForce value) - { - games.enable = true; - gnome-remote-desktop.enable = true; - gnome-user-share.enable = true; - rygel.enable = true; - sushi.enable = true; - tracker.enable = true; - tracker-miners.enable = true; - } - ; +in { + nixpkgs.config.packageOverrides = pkgs: + with pkgs; { + nixPath = (import ../../../default.nix { + versionsPath = ./versions.nix; + }).nixPath; + }; + + services.gnome = builtins.mapAttrs (attr: value: lib.mkForce value) { + games.enable = true; + gnome-remote-desktop.enable = true; + gnome-user-share.enable = true; + rygel.enable = true; + sushi.enable = true; + tracker.enable = true; + tracker-miners.enable = true; + }; home-manager.users.steveej = homeEnv { layout = "en"; @@ -49,17 +45,16 @@ in home-manager.users.elias = homeEnv { layout = "de"; - options = []; + options = [ ]; variant = ""; }; home-manager.users.justyna = homeEnv { layout = "de"; - options = []; + options = [ ]; variant = ""; }; - services.teamviewer.enable = true; system.stateVersion = "21.11"; } diff --git a/nix/os/devices/elias-e525/system.nix b/nix/os/devices/elias-e525/system.nix index 10c8e15..4535a60 100644 --- a/nix/os/devices/elias-e525/system.nix +++ b/nix/os/devices/elias-e525/system.nix @@ -1,13 +1,8 @@ -{ pkgs -, lib -, config -, ... }: - +{ pkgs, lib, config, ... }: let -in -{ +in { # TASK: new device networking.hostName = "elias-e525"; # Define your hostname. @@ -22,10 +17,7 @@ in services.printing = { enable = true; - drivers = with pkgs; [ - mfcl3770cdw.driver - mfcl3770cdw.cupswrapper - ]; + drivers = with pkgs; [ mfcl3770cdw.driver mfcl3770cdw.cupswrapper ]; }; services.fprintd.enable = true; @@ -49,9 +41,8 @@ in # udev.packages = [ pkgs.gnome3.gnome-settings-daemon ]; }; - security.pki.certificateFiles = [ - "${pkgs.cacert}/etc/ssl/certs/ca-bundle.crt" - ]; + security.pki.certificateFiles = + [ "${pkgs.cacert}/etc/ssl/certs/ca-bundle.crt" ]; services.xserver.videoDrivers = [ "modesetting" ]; diff --git a/nix/os/devices/elias-e525/user.nix b/nix/os/devices/elias-e525/user.nix index 5ef546d..df45914 100644 --- a/nix/os/devices/elias-e525/user.nix +++ b/nix/os/devices/elias-e525/user.nix @@ -1,6 +1,4 @@ -{ config -, pkgs -, ... }: +{ config, pkgs, ... }: let passwords = import ../../../variables/passwords.crypt.nix; diff --git a/nix/os/devices/elias-e525/versions.nix b/nix/os/devices/elias-e525/versions.nix index 90ba115..6a35f50 100644 --- a/nix/os/devices/elias-e525/versions.nix +++ b/nix/os/devices/elias-e525/versions.nix @@ -4,13 +4,10 @@ let ref = "nixos-21.11"; rev = "386234e2a61e1e8acf94dfa3a3d3ca19a6776efb"; }; -in -{ +in { inherit nixpkgs; - nixos = nixpkgs // { - suffix = "/nixos"; - }; + nixos = nixpkgs // { suffix = "/nixos"; }; "channels-nixos-stable" = nixpkgs; "channels-nixos-unstable" = { url = "https://github.com/NixOS/nixpkgs/"; diff --git a/nix/os/devices/elias-e525/versions.tmpl.nix b/nix/os/devices/elias-e525/versions.tmpl.nix index f90cf31..6a5f864 100644 --- a/nix/os/devices/elias-e525/versions.tmpl.nix +++ b/nix/os/devices/elias-e525/versions.tmpl.nix @@ -2,29 +2,34 @@ let nixpkgs = { url = "https://github.com/NixOS/nixpkgs/"; ref = "nixos-21.11"; - rev = "<% git ls-remote https://github.com/nixos/nixpkgs nixos-21.11 | awk '{ print $1 }' | tr -d '\n' -%>"; + rev = '' + <% git ls-remote https://github.com/nixos/nixpkgs nixos-21.11 | awk '{ print $1 }' | tr -d ' + ' -%>''; }; -in -{ +in { inherit nixpkgs; - nixos = nixpkgs // { - suffix = "/nixos"; - }; + nixos = nixpkgs // { suffix = "/nixos"; }; "channels-nixos-stable" = nixpkgs; "channels-nixos-unstable" = { url = "https://github.com/NixOS/nixpkgs/"; ref = "nixos-unstable"; - rev = "<% git ls-remote https://github.com/nixos/nixpkgs nixos-unstable | awk '{ print $1 }' | tr -d '\n' -%>"; + rev = '' + <% git ls-remote https://github.com/nixos/nixpkgs nixos-unstable | awk '{ print $1 }' | tr -d ' + ' -%>''; }; "nixpkgs-master" = { url = "https://github.com/NixOS/nixpkgs/"; ref = "master"; - rev = "<% git ls-remote https://github.com/NixOS/nixpkgs.git master | head -n1 | awk '{ print $1 }' | tr -d '\n' -%>"; + rev = '' + <% git ls-remote https://github.com/NixOS/nixpkgs.git master | head -n1 | awk '{ print $1 }' | tr -d ' + ' -%>''; }; "home-manager-module" = { url = "https://github.com/nix-community/home-manager"; ref = "release-21.11"; - rev = "<% git ls-remote https://github.com/nix-community/home-manager.git release-21.11 | awk '{ print $1 }' | tr -d '\n' -%>"; + rev = '' + <% git ls-remote https://github.com/nix-community/home-manager.git release-21.11 | awk '{ print $1 }' | tr -d ' + ' -%>''; }; } diff --git a/nix/os/devices/fwhost1/boot.nix b/nix/os/devices/fwhost1/boot.nix index 2f5f8ea..a7eeb2c 100644 --- a/nix/os/devices/fwhost1/boot.nix +++ b/nix/os/devices/fwhost1/boot.nix @@ -1,8 +1,6 @@ -{ lib -, ... -}: +{ lib, ... }: { boot.loader.grub.efiInstallAsRemovable = lib.mkForce true; - boot.loader.efi.canTouchEfiVariables = lib.mkForce false; + boot.loader.efi.canTouchEfiVariables = lib.mkForce false; } diff --git a/nix/os/devices/fwhost1/hw.nix b/nix/os/devices/fwhost1/hw.nix index c590682..90d54ab 100644 --- a/nix/os/devices/fwhost1/hw.nix +++ b/nix/os/devices/fwhost1/hw.nix @@ -2,8 +2,7 @@ let -in -{ +in { # TASK: new device hardware.opinionatedDisk = { enable = true; @@ -12,6 +11,5 @@ in }; hardware.enableRedistributableFirmware = true; - boot.extraModprobeConfig = '' - ''; + boot.extraModprobeConfig = ""; } diff --git a/nix/os/devices/fwhost1/pkg.nix b/nix/os/devices/fwhost1/pkg.nix index 8f3b69f..049c046 100644 --- a/nix/os/devices/fwhost1/pkg.nix +++ b/nix/os/devices/fwhost1/pkg.nix @@ -1,18 +1,18 @@ -{ pkgs -, ... -}: +{ pkgs, ... }: { - nixpkgs.config.packageOverrides = pkgs: with pkgs; { - nixPath = (import ../../../default.nix { versionsPath = ./versions.nix; }).nixPath; - }; - home-manager.users.steveej = import ../../../home-manager/configuration/text-minimal.nix { inherit pkgs; }; + nixpkgs.config.packageOverrides = pkgs: + with pkgs; { + nixPath = (import ../../../default.nix { + versionsPath = ./versions.nix; + }).nixPath; + }; + home-manager.users.steveej = + import ../../../home-manager/configuration/text-minimal.nix { + inherit pkgs; + }; - - environment.systemPackages = with pkgs; [ - iw - wirelesstools - ]; + environment.systemPackages = with pkgs; [ iw wirelesstools ]; system.stateVersion = "21.11"; } diff --git a/nix/os/devices/fwhost1/system.nix b/nix/os/devices/fwhost1/system.nix index 75a5355..d1ef0b2 100644 --- a/nix/os/devices/fwhost1/system.nix +++ b/nix/os/devices/fwhost1/system.nix @@ -1,7 +1,4 @@ -{ pkgs -, lib -, config -, ... }: +{ pkgs, lib, config, ... }: let keys = import ../../../variables/keys.nix; @@ -31,16 +28,25 @@ in { # WAN interfaces, currently unused because the OPNsense guest acts as a router. networking.vlans.wan1.id = 3; networking.vlans.wan1.interface = "breth"; - networking.interfaces.wan1.ipv4.addresses = [{ address = "192.168.0.15"; prefixLength = 24; } ]; + networking.interfaces.wan1.ipv4.addresses = [{ + address = "192.168.0.15"; + prefixLength = 24; + }]; networking.vlans.wan2.id = 4; networking.vlans.wan2.interface = "breth"; - networking.interfaces.wan2.ipv4.addresses = [{ address = "172.16.0.15"; prefixLength = 12; } ]; + networking.interfaces.wan2.ipv4.addresses = [{ + address = "172.16.0.15"; + prefixLength = 12; + }]; # Local interfaces, all accessed via VLAN tags on the main bridge networking.vlans.lan.id = 1; networking.vlans.lan.interface = "breth"; - networking.interfaces.lan.ipv4.addresses = [{ address = "172.172.171.15"; prefixLength = 24; } ]; + networking.interfaces.lan.ipv4.addresses = [{ + address = "172.172.171.15"; + prefixLength = 24; + }]; networking.vlans.dmz.id = 5; networking.vlans.dmz.interface = "breth"; diff --git a/nix/os/devices/fwhost1/user.nix b/nix/os/devices/fwhost1/user.nix index ab7656d..de3779b 100644 --- a/nix/os/devices/fwhost1/user.nix +++ b/nix/os/devices/fwhost1/user.nix @@ -1,11 +1,8 @@ -{ config -, pkgs -, ... }: +{ config, pkgs, ... }: let passwords = import ../../../variables/passwords.crypt.nix; keys = import ../../../variables/keys.nix; inherit (import ../../lib/default.nix { }) mkUser; -in { -} +in { } diff --git a/nix/os/devices/fwhost1/versions.nix b/nix/os/devices/fwhost1/versions.nix index 87ae77c..ef4ba9d 100644 --- a/nix/os/devices/fwhost1/versions.nix +++ b/nix/os/devices/fwhost1/versions.nix @@ -4,13 +4,10 @@ let ref = "nixos-21.11"; rev = "386234e2a61e1e8acf94dfa3a3d3ca19a6776efb"; }; -in -{ +in { inherit nixpkgs; - nixos = nixpkgs // { - suffix = "/nixos"; - }; + nixos = nixpkgs // { suffix = "/nixos"; }; "channels-nixos-stable" = nixpkgs; "channels-nixos-unstable" = { diff --git a/nix/os/devices/fwhost1/versions.tmpl.nix b/nix/os/devices/fwhost1/versions.tmpl.nix index 37c2853..63dae61 100644 --- a/nix/os/devices/fwhost1/versions.tmpl.nix +++ b/nix/os/devices/fwhost1/versions.tmpl.nix @@ -2,30 +2,35 @@ let nixpkgs = { url = "https://github.com/NixOS/nixpkgs/"; ref = "nixos-21.11"; - rev = "<% git ls-remote https://github.com/nixos/nixpkgs nixos-21.11 | awk '{ print $1 }' | tr -d '\n' -%>"; + rev = '' + <% git ls-remote https://github.com/nixos/nixpkgs nixos-21.11 | awk '{ print $1 }' | tr -d ' + ' -%>''; }; -in -{ +in { inherit nixpkgs; - nixos = nixpkgs // { - suffix = "/nixos"; - }; + nixos = nixpkgs // { suffix = "/nixos"; }; "channels-nixos-stable" = nixpkgs; "channels-nixos-unstable" = { url = "https://github.com/NixOS/nixpkgs/"; ref = "nixos-unstable"; - rev = "<% git ls-remote https://github.com/nixos/nixpkgs nixos-unstable | awk '{ print $1 }' | tr -d '\n' -%>"; + rev = '' + <% git ls-remote https://github.com/nixos/nixpkgs nixos-unstable | awk '{ print $1 }' | tr -d ' + ' -%>''; }; "nixpkgs-master" = { url = "https://github.com/NixOS/nixpkgs/"; ref = "master"; - rev = "<% git ls-remote https://github.com/NixOS/nixpkgs.git master | head -n1 | awk '{ print $1 }' | tr -d '\n' -%>"; + rev = '' + <% git ls-remote https://github.com/NixOS/nixpkgs.git master | head -n1 | awk '{ print $1 }' | tr -d ' + ' -%>''; }; "home-manager-module" = { url = "https://github.com/nix-community/home-manager"; ref = "release-21.11"; - rev = "<% git ls-remote https://github.com/nix-community/home-manager.git release-21.11 | awk '{ print $1 }' | tr -d '\n' -%>"; + rev = '' + <% git ls-remote https://github.com/nix-community/home-manager.git release-21.11 | awk '{ print $1 }' | tr -d ' + ' -%>''; }; } diff --git a/nix/os/devices/fwhost2/boot.nix b/nix/os/devices/fwhost2/boot.nix index 2f5f8ea..a7eeb2c 100644 --- a/nix/os/devices/fwhost2/boot.nix +++ b/nix/os/devices/fwhost2/boot.nix @@ -1,8 +1,6 @@ -{ lib -, ... -}: +{ lib, ... }: { boot.loader.grub.efiInstallAsRemovable = lib.mkForce true; - boot.loader.efi.canTouchEfiVariables = lib.mkForce false; + boot.loader.efi.canTouchEfiVariables = lib.mkForce false; } diff --git a/nix/os/devices/fwhost2/hw.nix b/nix/os/devices/fwhost2/hw.nix index 95959b4..0aee8f0 100644 --- a/nix/os/devices/fwhost2/hw.nix +++ b/nix/os/devices/fwhost2/hw.nix @@ -2,8 +2,7 @@ let -in -{ +in { # TASK: new device hardware.opinionatedDisk = { enable = true; @@ -12,6 +11,5 @@ in }; hardware.enableRedistributableFirmware = true; - boot.extraModprobeConfig = '' - ''; + boot.extraModprobeConfig = ""; } diff --git a/nix/os/devices/fwhost2/pkg.nix b/nix/os/devices/fwhost2/pkg.nix index 8f3b69f..049c046 100644 --- a/nix/os/devices/fwhost2/pkg.nix +++ b/nix/os/devices/fwhost2/pkg.nix @@ -1,18 +1,18 @@ -{ pkgs -, ... -}: +{ pkgs, ... }: { - nixpkgs.config.packageOverrides = pkgs: with pkgs; { - nixPath = (import ../../../default.nix { versionsPath = ./versions.nix; }).nixPath; - }; - home-manager.users.steveej = import ../../../home-manager/configuration/text-minimal.nix { inherit pkgs; }; + nixpkgs.config.packageOverrides = pkgs: + with pkgs; { + nixPath = (import ../../../default.nix { + versionsPath = ./versions.nix; + }).nixPath; + }; + home-manager.users.steveej = + import ../../../home-manager/configuration/text-minimal.nix { + inherit pkgs; + }; - - environment.systemPackages = with pkgs; [ - iw - wirelesstools - ]; + environment.systemPackages = with pkgs; [ iw wirelesstools ]; system.stateVersion = "21.11"; } diff --git a/nix/os/devices/fwhost2/system.nix b/nix/os/devices/fwhost2/system.nix index 7cee7c4..ac12837 100644 --- a/nix/os/devices/fwhost2/system.nix +++ b/nix/os/devices/fwhost2/system.nix @@ -1,8 +1,4 @@ -{ pkgs -, lib -, config -, utils -, ... }: +{ pkgs, lib, config, utils, ... }: let keys = import ../../../variables/keys.nix; @@ -32,16 +28,25 @@ in { # WAN interfaces, currently unused because the OPNsense guest acts as a router. networking.vlans.wan1.id = 3; networking.vlans.wan1.interface = "breth"; - networking.interfaces.wan1.ipv4.addresses = [{ address = "192.168.0.16"; prefixLength = 24; } ]; + networking.interfaces.wan1.ipv4.addresses = [{ + address = "192.168.0.16"; + prefixLength = 24; + }]; networking.vlans.wan2.id = 4; networking.vlans.wan2.interface = "breth"; - networking.interfaces.wan2.ipv4.addresses = [{ address = "172.16.0.16"; prefixLength = 12; } ]; + networking.interfaces.wan2.ipv4.addresses = [{ + address = "172.16.0.16"; + prefixLength = 12; + }]; # Local interfaces, all accessed via VLAN tags on the main bridge networking.vlans.lan.id = 1; networking.vlans.lan.interface = "breth"; - networking.interfaces.lan.ipv4.addresses = [{ address = "172.172.171.16"; prefixLength = 24; } ]; + networking.interfaces.lan.ipv4.addresses = [{ + address = "172.172.171.16"; + prefixLength = 24; + }]; networking.vlans.dmz.id = 5; networking.vlans.dmz.interface = "breth"; diff --git a/nix/os/devices/fwhost2/user.nix b/nix/os/devices/fwhost2/user.nix index 1c33f83..2e63acd 100644 --- a/nix/os/devices/fwhost2/user.nix +++ b/nix/os/devices/fwhost2/user.nix @@ -1,6 +1,4 @@ -{ config -, pkgs -, ... }: +{ config, pkgs, ... }: let passwords = import ../../../variables/passwords.crypt.nix; diff --git a/nix/os/devices/fwhost2/versions.nix b/nix/os/devices/fwhost2/versions.nix index 87ae77c..ef4ba9d 100644 --- a/nix/os/devices/fwhost2/versions.nix +++ b/nix/os/devices/fwhost2/versions.nix @@ -4,13 +4,10 @@ let ref = "nixos-21.11"; rev = "386234e2a61e1e8acf94dfa3a3d3ca19a6776efb"; }; -in -{ +in { inherit nixpkgs; - nixos = nixpkgs // { - suffix = "/nixos"; - }; + nixos = nixpkgs // { suffix = "/nixos"; }; "channels-nixos-stable" = nixpkgs; "channels-nixos-unstable" = { diff --git a/nix/os/devices/fwhost2/versions.tmpl.nix b/nix/os/devices/fwhost2/versions.tmpl.nix index 37c2853..63dae61 100644 --- a/nix/os/devices/fwhost2/versions.tmpl.nix +++ b/nix/os/devices/fwhost2/versions.tmpl.nix @@ -2,30 +2,35 @@ let nixpkgs = { url = "https://github.com/NixOS/nixpkgs/"; ref = "nixos-21.11"; - rev = "<% git ls-remote https://github.com/nixos/nixpkgs nixos-21.11 | awk '{ print $1 }' | tr -d '\n' -%>"; + rev = '' + <% git ls-remote https://github.com/nixos/nixpkgs nixos-21.11 | awk '{ print $1 }' | tr -d ' + ' -%>''; }; -in -{ +in { inherit nixpkgs; - nixos = nixpkgs // { - suffix = "/nixos"; - }; + nixos = nixpkgs // { suffix = "/nixos"; }; "channels-nixos-stable" = nixpkgs; "channels-nixos-unstable" = { url = "https://github.com/NixOS/nixpkgs/"; ref = "nixos-unstable"; - rev = "<% git ls-remote https://github.com/nixos/nixpkgs nixos-unstable | awk '{ print $1 }' | tr -d '\n' -%>"; + rev = '' + <% git ls-remote https://github.com/nixos/nixpkgs nixos-unstable | awk '{ print $1 }' | tr -d ' + ' -%>''; }; "nixpkgs-master" = { url = "https://github.com/NixOS/nixpkgs/"; ref = "master"; - rev = "<% git ls-remote https://github.com/NixOS/nixpkgs.git master | head -n1 | awk '{ print $1 }' | tr -d '\n' -%>"; + rev = '' + <% git ls-remote https://github.com/NixOS/nixpkgs.git master | head -n1 | awk '{ print $1 }' | tr -d ' + ' -%>''; }; "home-manager-module" = { url = "https://github.com/nix-community/home-manager"; ref = "release-21.11"; - rev = "<% git ls-remote https://github.com/nix-community/home-manager.git release-21.11 | awk '{ print $1 }' | tr -d '\n' -%>"; + rev = '' + <% git ls-remote https://github.com/nix-community/home-manager.git release-21.11 | awk '{ print $1 }' | tr -d ' + ' -%>''; }; } diff --git a/nix/os/devices/srv0.home-ch.stefanjunker.de/boot.nix b/nix/os/devices/srv0.home-ch.stefanjunker.de/boot.nix index cd4c05f..fb03c06 100644 --- a/nix/os/devices/srv0.home-ch.stefanjunker.de/boot.nix +++ b/nix/os/devices/srv0.home-ch.stefanjunker.de/boot.nix @@ -1,6 +1,4 @@ -{ lib -, ... -}: +{ lib, ... }: { boot.loader.grub.efiSupport = true; diff --git a/nix/os/devices/srv0.home-ch.stefanjunker.de/configuration.nix b/nix/os/devices/srv0.home-ch.stefanjunker.de/configuration.nix index b681c06..5dfb10f 100644 --- a/nix/os/devices/srv0.home-ch.stefanjunker.de/configuration.nix +++ b/nix/os/devices/srv0.home-ch.stefanjunker.de/configuration.nix @@ -1,8 +1,7 @@ { ... }: { - disabledModules = [ - ]; + disabledModules = [ ]; imports = [ ../../profiles/common/configuration.nix ../../modules/opinionatedDisk.nix diff --git a/nix/os/devices/srv0.home-ch.stefanjunker.de/hw.nix b/nix/os/devices/srv0.home-ch.stefanjunker.de/hw.nix index c711971..f6d866a 100644 --- a/nix/os/devices/srv0.home-ch.stefanjunker.de/hw.nix +++ b/nix/os/devices/srv0.home-ch.stefanjunker.de/hw.nix @@ -1,7 +1,7 @@ { ... }: let - stage1Modules = [ + stage1Modules = [ "aesni_intel" "kvm-intel" @@ -20,8 +20,7 @@ let "xhci_pci" ]; -in -{ +in { # TASK: new device hardware.opinionatedDisk = { enable = true; @@ -31,6 +30,5 @@ in boot.initrd.availableKernelModules = stage1Modules; boot.initrd.kernelModules = stage1Modules; - boot.extraModprobeConfig = '' - ''; + boot.extraModprobeConfig = ""; } diff --git a/nix/os/devices/srv0.home-ch.stefanjunker.de/pkg.nix b/nix/os/devices/srv0.home-ch.stefanjunker.de/pkg.nix index 68784f6..34ccdce 100644 --- a/nix/os/devices/srv0.home-ch.stefanjunker.de/pkg.nix +++ b/nix/os/devices/srv0.home-ch.stefanjunker.de/pkg.nix @@ -1,22 +1,23 @@ -{ config -, pkgs -, lib -, ... -}: +{ config, pkgs, lib, ... }: { - nixpkgs.config.packageOverrides = pkgs: with pkgs; { - nixPath = (import ../../../default.nix { versionsPath = ./versions.nix; }).nixPath; - }; - home-manager.users.steveej = import ../../../home-manager/configuration/text-minimal.nix { inherit pkgs; }; + nixpkgs.config.packageOverrides = pkgs: + with pkgs; { + nixPath = (import ../../../default.nix { + versionsPath = ./versions.nix; + }).nixPath; + }; + home-manager.users.steveej = + import ../../../home-manager/configuration/text-minimal.nix { + inherit pkgs; + }; - nix.buildMachines = [ - { hostName = "localhost"; - system = "x86_64-linux"; - supportedFeatures = ["kvm" "nixos-test" "big-parallel" "benchmark"]; - maxJobs = 4; - } - ]; + nix.buildMachines = [{ + hostName = "localhost"; + system = "x86_64-linux"; + supportedFeatures = [ "kvm" "nixos-test" "big-parallel" "benchmark" ]; + maxJobs = 4; + }]; # services.hydra = { # enable = false; diff --git a/nix/os/devices/srv0.home-ch.stefanjunker.de/system.nix b/nix/os/devices/srv0.home-ch.stefanjunker.de/system.nix index 7cb7fc1..78afcd6 100644 --- a/nix/os/devices/srv0.home-ch.stefanjunker.de/system.nix +++ b/nix/os/devices/srv0.home-ch.stefanjunker.de/system.nix @@ -1,10 +1,6 @@ -{ pkgs -, lib -, config -, ... }: +{ pkgs, lib, config, ... }: -let - keys = import ../../../variables/keys.nix; +let keys = import ../../../variables/keys.nix; in { # TASK: new device @@ -46,18 +42,12 @@ in { # services.kubernetes.roles = ["master" "node"]; # virtualization - virtualisation = { - docker.enable = true; - }; + virtualisation = { docker.enable = true; }; - nix.gc = { - automatic = true; - }; + nix.gc = { automatic = true; }; networking.useHostResolvConf = false; - services.resolved = { - enable = true; - }; + services.resolved = { enable = true; }; containers = { mailserver = import ../../containers/mailserver.nix { @@ -87,12 +77,7 @@ in { inherit config; hostAddress = "192.168.100.16"; localAddress = "192.168.100.17"; - subvolumes = [ - "mailserver" - "webserver" - "backup" - "syncthing" - ]; + subvolumes = [ "mailserver" "webserver" "backup" "syncthing" ]; }; }; diff --git a/nix/os/devices/srv0.home-ch.stefanjunker.de/versions.nix b/nix/os/devices/srv0.home-ch.stefanjunker.de/versions.nix index 0bc0789..3d90d33 100644 --- a/nix/os/devices/srv0.home-ch.stefanjunker.de/versions.nix +++ b/nix/os/devices/srv0.home-ch.stefanjunker.de/versions.nix @@ -4,9 +4,8 @@ let ref = "nixos-22.05"; rev = "040c6d8374d090f46ab0e99f1f7c27a4529ecffd"; }; -in -{ +in { inherit nixpkgs; "channels-nixos-stable" = nixpkgs; "nixpkgs-master" = { diff --git a/nix/os/devices/srv0.home-ch.stefanjunker.de/versions.tmpl.nix b/nix/os/devices/srv0.home-ch.stefanjunker.de/versions.tmpl.nix index d11219c..623673e 100644 --- a/nix/os/devices/srv0.home-ch.stefanjunker.de/versions.tmpl.nix +++ b/nix/os/devices/srv0.home-ch.stefanjunker.de/versions.tmpl.nix @@ -2,21 +2,26 @@ let nixpkgs = { url = "https://github.com/NixOS/nixpkgs/"; ref = "nixos-22.05"; - rev = "<% git ls-remote https://github.com/nixos/nixpkgs nixos-22.05 | awk '{ print $1 }' | tr -d '\n' -%>"; + rev = '' + <% git ls-remote https://github.com/nixos/nixpkgs nixos-22.05 | awk '{ print $1 }' | tr -d ' + ' -%>''; }; -in -{ +in { inherit nixpkgs; "channels-nixos-stable" = nixpkgs; "nixpkgs-master" = { url = "https://github.com/NixOS/nixpkgs/"; ref = "master"; - rev = "<% git ls-remote https://github.com/NixOS/nixpkgs.git master | head -n1 | awk '{ print $1 }' | tr -d '\n' -%>"; + rev = '' + <% git ls-remote https://github.com/NixOS/nixpkgs.git master | head -n1 | awk '{ print $1 }' | tr -d ' + ' -%>''; }; "home-manager-module" = { url = "https://github.com/nix-community/home-manager"; ref = "release-22.05"; - rev = "<% git ls-remote https://github.com/nix-community/home-manager.git release-22.05 | awk '{ print $1 }' | tr -d '\n' -%>"; + rev = '' + <% git ls-remote https://github.com/nix-community/home-manager.git release-22.05 | awk '{ print $1 }' | tr -d ' + ' -%>''; }; } diff --git a/nix/os/devices/steveej-nuc7pjyh-work/system.nix b/nix/os/devices/steveej-nuc7pjyh-work/system.nix index 8d673ba..65bb989 100644 --- a/nix/os/devices/steveej-nuc7pjyh-work/system.nix +++ b/nix/os/devices/steveej-nuc7pjyh-work/system.nix @@ -3,7 +3,7 @@ let in { services.udev.extraRules = ''SUBSYSTEM=="sgx", MODE="0660", GROUP="sgx"''; - users.groups.sgx = {}; + users.groups.sgx = { }; networking.hostName = "steveej-nuc7pjyh-work"; # Define your hostname. boot.kernelPackages = lib.mkForce pkgs.linuxPackages_sgx_latest; } diff --git a/nix/os/devices/steveej-nuc7pjyh-work/user.nix b/nix/os/devices/steveej-nuc7pjyh-work/user.nix index 05a9670..e112591 100644 --- a/nix/os/devices/steveej-nuc7pjyh-work/user.nix +++ b/nix/os/devices/steveej-nuc7pjyh-work/user.nix @@ -1,6 +1,4 @@ -{ config -, pkgs -, ... }: +{ config, pkgs, ... }: let passwords = import ../../../variables/passwords.crypt.nix; @@ -11,10 +9,19 @@ in { users.extraUsers.sjunker = mkUser { uid = 1001; openssh.authorizedKeys.keys = keys.users.steveej.openssh; - shell = pkgs.posh { image = "quay.io/enarx/fedora"; run_args = "-v /dev/sgx:/dev/sgx"; }; + shell = pkgs.posh { + image = "quay.io/enarx/fedora"; + run_args = "-v /dev/sgx:/dev/sgx"; + }; extraGroups = [ "sgx" ]; - subUidRanges = [{ startUid = 100000; count = 65536; }]; - subGidRanges = [{ startGid = 100000; count = 65536; }]; + subUidRanges = [{ + startUid = 100000; + count = 65536; + }]; + subGidRanges = [{ + startGid = 100000; + count = 65536; + }]; }; } diff --git a/nix/os/devices/steveej-pa600/boot.nix b/nix/os/devices/steveej-pa600/boot.nix index 2f5f8ea..a7eeb2c 100644 --- a/nix/os/devices/steveej-pa600/boot.nix +++ b/nix/os/devices/steveej-pa600/boot.nix @@ -1,8 +1,6 @@ -{ lib -, ... -}: +{ lib, ... }: { boot.loader.grub.efiInstallAsRemovable = lib.mkForce true; - boot.loader.efi.canTouchEfiVariables = lib.mkForce false; + boot.loader.efi.canTouchEfiVariables = lib.mkForce false; } diff --git a/nix/os/devices/steveej-pa600/hw.nix b/nix/os/devices/steveej-pa600/hw.nix index 53d8f19..da9e319 100644 --- a/nix/os/devices/steveej-pa600/hw.nix +++ b/nix/os/devices/steveej-pa600/hw.nix @@ -1,7 +1,7 @@ { ... }: let - stage1Modules = [ + stage1Modules = [ "aesni_intel" "kvm-intel" "aes_x86_64" @@ -10,8 +10,7 @@ let "hxci_hcd" ]; -in -{ +in { # TASK: new device hardware.opinionatedDisk = { enable = true; @@ -21,6 +20,5 @@ in # boot.initrd.availableKernelModules = stage1Modules; boot.initrd.kernelModules = stage1Modules; - boot.extraModprobeConfig = '' - ''; + boot.extraModprobeConfig = ""; } diff --git a/nix/os/devices/steveej-pa600/pkg.nix b/nix/os/devices/steveej-pa600/pkg.nix index 01b4cba..7d68b41 100644 --- a/nix/os/devices/steveej-pa600/pkg.nix +++ b/nix/os/devices/steveej-pa600/pkg.nix @@ -1,12 +1,16 @@ -{ pkgs -, ... -}: +{ pkgs, ... }: { - nixpkgs.config.packageOverrides = pkgs: with pkgs; { - nixPath = (import ../../../default.nix { versionsPath = ./versions.nix; }).nixPath; - }; - home-manager.users.steveej = import ../../../home-manager/configuration/graphical-fullblown.nix { inherit pkgs; }; + nixpkgs.config.packageOverrides = pkgs: + with pkgs; { + nixPath = (import ../../../default.nix { + versionsPath = ./versions.nix; + }).nixPath; + }; + home-manager.users.steveej = + import ../../../home-manager/configuration/graphical-fullblown.nix { + inherit pkgs; + }; services.teamviewer.enable = true; system.stateVersion = "20.09"; } diff --git a/nix/os/devices/steveej-pa600/system.nix b/nix/os/devices/steveej-pa600/system.nix index e2c9cfd..45cb6c9 100644 --- a/nix/os/devices/steveej-pa600/system.nix +++ b/nix/os/devices/steveej-pa600/system.nix @@ -1,10 +1,6 @@ -{ pkgs -, lib -, config -, ... }: +{ pkgs, lib, config, ... }: -let - keys = import ../../../variables/keys.nix; +let keys = import ../../../variables/keys.nix; in { # TASK: new device @@ -21,11 +17,7 @@ in { services.printing = { enable = true; - drivers = with pkgs; [ - hplip - mfcl3770cdw.driver - mfcl3770cdw.cupswrapper - ]; + drivers = with pkgs; [ hplip mfcl3770cdw.driver mfcl3770cdw.cupswrapper ]; }; services.fprintd.enable = true; @@ -34,9 +26,8 @@ in { sudo.fprintAuth = true; }; - security.pki.certificateFiles = [ - "${pkgs.cacert}/etc/ssl/certs/ca-bundle.crt" - ]; + security.pki.certificateFiles = + [ "${pkgs.cacert}/etc/ssl/certs/ca-bundle.crt" ]; services.xserver.videoDrivers = [ "modesetting" ]; services.xserver.serverFlagsSection = '' diff --git a/nix/os/devices/steveej-pa600/user.nix b/nix/os/devices/steveej-pa600/user.nix index f07b2ac..fd906b1 100644 --- a/nix/os/devices/steveej-pa600/user.nix +++ b/nix/os/devices/steveej-pa600/user.nix @@ -1,6 +1,4 @@ -{ config -, pkgs -, ... }: +{ config, pkgs, ... }: let passwords = import ../../../variables/passwords.crypt.nix; diff --git a/nix/os/devices/steveej-pa600/versions.nix b/nix/os/devices/steveej-pa600/versions.nix index 6f983f2..a88fb19 100644 --- a/nix/os/devices/steveej-pa600/versions.nix +++ b/nix/os/devices/steveej-pa600/versions.nix @@ -4,13 +4,10 @@ let ref = "nixos-20.09"; rev = "e065200fc90175a8f6e50e76ef10a48786126e1c"; }; -in -{ +in { inherit nixpkgs; - nixos = nixpkgs // { - suffix = "/nixos"; - }; + nixos = nixpkgs // { suffix = "/nixos"; }; "channels-nixos-stable" = nixpkgs; "channels-nixos-unstable" = { url = "https://github.com/NixOS/nixpkgs/"; diff --git a/nix/os/devices/steveej-pa600/versions.tmpl.nix b/nix/os/devices/steveej-pa600/versions.tmpl.nix index 09f95fd..562ad1a 100644 --- a/nix/os/devices/steveej-pa600/versions.tmpl.nix +++ b/nix/os/devices/steveej-pa600/versions.tmpl.nix @@ -2,29 +2,34 @@ let nixpkgs = { url = "https://github.com/NixOS/nixpkgs/"; ref = "nixos-20.09"; - rev = "<% git ls-remote https://github.com/nixos/nixpkgs nixos-20.09 | awk '{ print $1 }' | tr -d '\n' -%>"; + rev = '' + <% git ls-remote https://github.com/nixos/nixpkgs nixos-20.09 | awk '{ print $1 }' | tr -d ' + ' -%>''; }; -in -{ +in { inherit nixpkgs; - nixos = nixpkgs // { - suffix = "/nixos"; - }; + nixos = nixpkgs // { suffix = "/nixos"; }; "channels-nixos-stable" = nixpkgs; "channels-nixos-unstable" = { url = "https://github.com/NixOS/nixpkgs/"; ref = "nixos-unstable"; - rev = "<% git ls-remote https://github.com/nixos/nixpkgs nixos-unstable | awk '{ print $1 }' | tr -d '\n' -%>"; + rev = '' + <% git ls-remote https://github.com/nixos/nixpkgs nixos-unstable | awk '{ print $1 }' | tr -d ' + ' -%>''; }; "nixpkgs-master" = { url = "https://github.com/NixOS/nixpkgs/"; ref = "master"; - rev = "<% git ls-remote https://github.com/NixOS/nixpkgs.git master | head -n1 | awk '{ print $1 }' | tr -d '\n' -%>"; + rev = '' + <% git ls-remote https://github.com/NixOS/nixpkgs.git master | head -n1 | awk '{ print $1 }' | tr -d ' + ' -%>''; }; "home-manager-module" = { url = "https://github.com/nix-community/home-manager"; ref = "release-20.09"; - rev = "<% git ls-remote https://github.com/nix-community/home-manager.git release-20.09 | awk '{ print $1 }' | tr -d '\n' -%>"; + rev = '' + <% git ls-remote https://github.com/nix-community/home-manager.git release-20.09 | awk '{ print $1 }' | tr -d ' + ' -%>''; }; } diff --git a/nix/os/devices/steveej-rmvbl-mmc-SL32G_0x259093f6/system.nix b/nix/os/devices/steveej-rmvbl-mmc-SL32G_0x259093f6/system.nix index 4ac0ac9..7c34733 100644 --- a/nix/os/devices/steveej-rmvbl-mmc-SL32G_0x259093f6/system.nix +++ b/nix/os/devices/steveej-rmvbl-mmc-SL32G_0x259093f6/system.nix @@ -1,5 +1,6 @@ { ... }: { - networking.hostName = "steveej-rmvbl-mmc-SL32G_0x259093f6"; # Define your hostname. + networking.hostName = + "steveej-rmvbl-mmc-SL32G_0x259093f6"; # Define your hostname. } diff --git a/nix/os/devices/steveej-rmvbl-sdep0/configuration.nix b/nix/os/devices/steveej-rmvbl-sdep0/configuration.nix index 860f09f..2c067e6 100644 --- a/nix/os/devices/steveej-rmvbl-sdep0/configuration.nix +++ b/nix/os/devices/steveej-rmvbl-sdep0/configuration.nix @@ -1,9 +1,12 @@ { ... }: { - nixpkgs.config.packageOverrides = pkgs: with pkgs; { - nixPath = (import ../../../default.nix { versionsPath = ./versions.nix; }).nixPath; - }; + nixpkgs.config.packageOverrides = pkgs: + with pkgs; { + nixPath = (import ../../../default.nix { + versionsPath = ./versions.nix; + }).nixPath; + }; imports = [ ../../profiles/common/configuration.nix diff --git a/nix/os/devices/steveej-rmvbl-sdep0/versions.nix b/nix/os/devices/steveej-rmvbl-sdep0/versions.nix index 9ce5db2..4477d98 100644 --- a/nix/os/devices/steveej-rmvbl-sdep0/versions.nix +++ b/nix/os/devices/steveej-rmvbl-sdep0/versions.nix @@ -4,20 +4,17 @@ let ref = "nixos-21.11"; rev = "386234e2a61e1e8acf94dfa3a3d3ca19a6776efb"; }; -in -{ +in { inherit nixpkgs; - nixos = nixpkgs // { - suffix = "/nixos"; - }; + nixos = nixpkgs // { suffix = "/nixos"; }; "channels-nixos-stable" = nixpkgs; -# "channels-nixos-21.05" = { -# url = "https://github.com/NixOS/nixpkgs/"; -# ref = "nixos-21.05"; -# rev = "df123677560db3b0db7c19d71981b11091fbeaf6"; -# }; + # "channels-nixos-21.05" = { + # url = "https://github.com/NixOS/nixpkgs/"; + # ref = "nixos-21.05"; + # rev = "df123677560db3b0db7c19d71981b11091fbeaf6"; + # }; "channels-nixos-unstable" = { url = "https://github.com/NixOS/nixpkgs/"; ref = "nixos-unstable"; diff --git a/nix/os/devices/steveej-t14/boot.nix b/nix/os/devices/steveej-t14/boot.nix index 645f6ca..9936b30 100644 --- a/nix/os/devices/steveej-t14/boot.nix +++ b/nix/os/devices/steveej-t14/boot.nix @@ -1,10 +1,7 @@ -{ lib -, pkgs -, ... -}: +{ lib, pkgs, ... }: { boot.loader.grub.efiInstallAsRemovable = lib.mkForce true; - boot.loader.efi.canTouchEfiVariables = lib.mkForce false; + boot.loader.efi.canTouchEfiVariables = lib.mkForce false; boot.kernelPackages = lib.mkForce pkgs.linuxPackages_latest; } diff --git a/nix/os/devices/steveej-t14/hw.nix b/nix/os/devices/steveej-t14/hw.nix index 3ba31ce..f78f9c0 100644 --- a/nix/os/devices/steveej-t14/hw.nix +++ b/nix/os/devices/steveej-t14/hw.nix @@ -1,7 +1,7 @@ { ... }: let - stage1Modules = [ + stage1Modules = [ "aesni_intel" "kvm_amd" "nvme" @@ -11,8 +11,7 @@ let "e1000e" ]; -in -{ +in { # TASK: new device hardware.opinionatedDisk = { enable = true; diff --git a/nix/os/devices/steveej-t14/pkg.nix b/nix/os/devices/steveej-t14/pkg.nix index 01b4cba..7d68b41 100644 --- a/nix/os/devices/steveej-t14/pkg.nix +++ b/nix/os/devices/steveej-t14/pkg.nix @@ -1,12 +1,16 @@ -{ pkgs -, ... -}: +{ pkgs, ... }: { - nixpkgs.config.packageOverrides = pkgs: with pkgs; { - nixPath = (import ../../../default.nix { versionsPath = ./versions.nix; }).nixPath; - }; - home-manager.users.steveej = import ../../../home-manager/configuration/graphical-fullblown.nix { inherit pkgs; }; + nixpkgs.config.packageOverrides = pkgs: + with pkgs; { + nixPath = (import ../../../default.nix { + versionsPath = ./versions.nix; + }).nixPath; + }; + home-manager.users.steveej = + import ../../../home-manager/configuration/graphical-fullblown.nix { + inherit pkgs; + }; services.teamviewer.enable = true; system.stateVersion = "20.09"; } diff --git a/nix/os/devices/steveej-t14/system.nix b/nix/os/devices/steveej-t14/system.nix index b8bceb0..b414df9 100644 --- a/nix/os/devices/steveej-t14/system.nix +++ b/nix/os/devices/steveej-t14/system.nix @@ -1,16 +1,10 @@ -{ pkgs -, lib -, config -, ... }: +{ pkgs, lib, config, ... }: -let - keys = import ../../../variables/keys.nix; +let keys = import ../../../variables/keys.nix; in { nix = { - binaryCaches = [ - "https://holochain-ci.cachix.org" - "https://cache.holo.host/" - ]; + binaryCaches = + [ "https://holochain-ci.cachix.org" "https://cache.holo.host/" ]; binaryCachePublicKeys = [ "holochain-ci.cachix.org-1:5IUSkZc0aoRS53rfkvH9Kid40NpyjwCMCzwRTXy+QN8=" "cache.holo.host-1:lNXIXtJgS9Iuw4Cu6X0HINLu9sTfcjEntnrgwMQIMcE=" @@ -21,10 +15,11 @@ in { # TASK: new device networking.hostName = "steveej-t14"; # Define your hostname. - networking.bridges."virbr1".interfaces = []; - networking.interfaces."virbr1".ipv4.addresses = [ - { address = "10.254.254.254"; prefixLength = 24; } - ]; + networking.bridges."virbr1".interfaces = [ ]; + networking.interfaces."virbr1".ipv4.addresses = [{ + address = "10.254.254.254"; + prefixLength = 24; + }]; networking.firewall.enable = true; networking.firewall.allowedTCPPorts = [ @@ -40,11 +35,7 @@ in { services.printing = { enable = true; - drivers = with pkgs; [ - hplip - mfcl3770cdw.driver - mfcl3770cdw.cupswrapper - ]; + drivers = with pkgs; [ hplip mfcl3770cdw.driver mfcl3770cdw.cupswrapper ]; }; services.fprintd.enable = true; @@ -55,12 +46,10 @@ in { # virtualization virtualisation = { - libvirtd = { - enable = true; - }; + libvirtd = { enable = true; }; virtualbox.host = { - enable = false ; + enable = false; addNetworkInterface = false; }; @@ -74,14 +63,10 @@ in { # client min protocol = NT1 ''; + security.pki.certificateFiles = + [ "${pkgs.cacert}/etc/ssl/certs/ca-bundle.crt" ]; - security.pki.certificateFiles = [ - "${pkgs.cacert}/etc/ssl/certs/ca-bundle.crt" - ]; - - services.xserver.videoDrivers = lib.mkForce [ - "amdgpu" - ]; + services.xserver.videoDrivers = lib.mkForce [ "amdgpu" ]; services.xserver.serverFlagsSection = '' Option "BlankTime" "0" Option "StandbyTime" "0" diff --git a/nix/os/devices/steveej-t14/user.nix b/nix/os/devices/steveej-t14/user.nix index f07b2ac..fd906b1 100644 --- a/nix/os/devices/steveej-t14/user.nix +++ b/nix/os/devices/steveej-t14/user.nix @@ -1,6 +1,4 @@ -{ config -, pkgs -, ... }: +{ config, pkgs, ... }: let passwords = import ../../../variables/passwords.crypt.nix; diff --git a/nix/os/devices/steveej-t14/versions.nix b/nix/os/devices/steveej-t14/versions.nix index f50e1f0..c8f4832 100644 --- a/nix/os/devices/steveej-t14/versions.nix +++ b/nix/os/devices/steveej-t14/versions.nix @@ -4,13 +4,10 @@ let ref = "nixos-22.05"; rev = "6107f97012a0c134c5848125b5aa1b149b76d2c9"; }; -in -{ +in { inherit nixpkgs; - nixos = nixpkgs // { - suffix = "/nixos"; - }; + nixos = nixpkgs // { suffix = "/nixos"; }; "channels-nixos-stable" = nixpkgs; "channels-nixos-unstable" = { url = "https://github.com/NixOS/nixpkgs/"; diff --git a/nix/os/devices/steveej-t14/versions.tmpl.nix b/nix/os/devices/steveej-t14/versions.tmpl.nix index 7d71726..9d173c2 100644 --- a/nix/os/devices/steveej-t14/versions.tmpl.nix +++ b/nix/os/devices/steveej-t14/versions.tmpl.nix @@ -2,34 +2,41 @@ let nixpkgs = { url = "https://github.com/NixOS/nixpkgs/"; ref = "nixos-22.05"; - rev = "<% git ls-remote https://github.com/nixos/nixpkgs nixos-22.05 | awk '{ print $1 }' | tr -d '\n' -%>"; + rev = '' + <% git ls-remote https://github.com/nixos/nixpkgs nixos-22.05 | awk '{ print $1 }' | tr -d ' + ' -%>''; }; -in -{ +in { inherit nixpkgs; - nixos = nixpkgs // { - suffix = "/nixos"; - }; + nixos = nixpkgs // { suffix = "/nixos"; }; "channels-nixos-stable" = nixpkgs; "channels-nixos-unstable" = { url = "https://github.com/NixOS/nixpkgs/"; ref = "nixos-unstable"; - rev = "<% git ls-remote https://github.com/nixos/nixpkgs nixos-unstable | awk '{ print $1 }' | tr -d '\n' -%>"; + rev = '' + <% git ls-remote https://github.com/nixos/nixpkgs nixos-unstable | awk '{ print $1 }' | tr -d ' + ' -%>''; }; "channels-nixos-unstable-small" = { url = "https://github.com/NixOS/nixpkgs/"; ref = "nixos-unstable-small"; - rev = "<% git ls-remote https://github.com/nixos/nixpkgs nixos-unstable-small | awk '{ print $1 }' | tr -d '\n' -%>"; + rev = '' + <% git ls-remote https://github.com/nixos/nixpkgs nixos-unstable-small | awk '{ print $1 }' | tr -d ' + ' -%>''; }; "nixpkgs-master" = { url = "https://github.com/NixOS/nixpkgs/"; ref = "master"; - rev = "<% git ls-remote https://github.com/NixOS/nixpkgs.git master | head -n1 | awk '{ print $1 }' | tr -d '\n' -%>"; + rev = '' + <% git ls-remote https://github.com/NixOS/nixpkgs.git master | head -n1 | awk '{ print $1 }' | tr -d ' + ' -%>''; }; "home-manager-module" = { url = "https://github.com/nix-community/home-manager"; ref = "release-22.05"; - rev = "<% git ls-remote https://github.com/nix-community/home-manager.git release-22.05 | awk '{ print $1 }' | tr -d '\n' -%>"; + rev = '' + <% git ls-remote https://github.com/nix-community/home-manager.git release-22.05 | awk '{ print $1 }' | tr -d ' + ' -%>''; }; } diff --git a/nix/os/devices/steveej-t480s-work/configuration.nix b/nix/os/devices/steveej-t480s-work/configuration.nix index 3830116..46b105a 100644 --- a/nix/os/devices/steveej-t480s-work/configuration.nix +++ b/nix/os/devices/steveej-t480s-work/configuration.nix @@ -1,9 +1,7 @@ { ... }: { - disabledModules = [ - "system/boot/initrd-network.nix" - ]; + disabledModules = [ "system/boot/initrd-network.nix" ]; imports = [ ../../modules/initrd-network.nix diff --git a/nix/os/devices/steveej-t480s-work/hw.nix b/nix/os/devices/steveej-t480s-work/hw.nix index 43a91a7..673323e 100644 --- a/nix/os/devices/steveej-t480s-work/hw.nix +++ b/nix/os/devices/steveej-t480s-work/hw.nix @@ -1,7 +1,7 @@ { ... }: let - stage1Modules = [ + stage1Modules = [ "aesni_intel" "kvm-intel" "aes_x86_64" @@ -15,8 +15,7 @@ let "hxci_hcd" ]; -in -{ +in { # TASK: new device hardware.encryptedDisk = { enable = true; diff --git a/nix/os/devices/steveej-t480s-work/pkg.nix b/nix/os/devices/steveej-t480s-work/pkg.nix index aa7035f..9c304d3 100644 --- a/nix/os/devices/steveej-t480s-work/pkg.nix +++ b/nix/os/devices/steveej-t480s-work/pkg.nix @@ -1,12 +1,16 @@ -{ pkgs -, ... -}: +{ pkgs, ... }: { - nixpkgs.config.packageOverrides = pkgs: with pkgs; { - nixPath = (import ../../../default.nix { versionsPath = ./versions.nix; }).nixPath; - }; - home-manager.users.steveej = import ../../../home-manager/configuration/graphical-fullblown.nix { inherit pkgs; }; + nixpkgs.config.packageOverrides = pkgs: + with pkgs; { + nixPath = (import ../../../default.nix { + versionsPath = ./versions.nix; + }).nixPath; + }; + home-manager.users.steveej = + import ../../../home-manager/configuration/graphical-fullblown.nix { + inherit pkgs; + }; services.teamviewer.enable = true; system.stateVersion = "19.09"; } diff --git a/nix/os/devices/steveej-t480s-work/system.nix b/nix/os/devices/steveej-t480s-work/system.nix index 8f17b3c..85fe73d 100644 --- a/nix/os/devices/steveej-t480s-work/system.nix +++ b/nix/os/devices/steveej-t480s-work/system.nix @@ -1,40 +1,32 @@ -{ pkgs -, lib -, config -, ... }: +{ pkgs, lib, config, ... }: -let - keys = import ../../../variables/keys.nix; +let keys = import ../../../variables/keys.nix; in { # TASK: new device networking.hostName = "steveej-t480s-work"; # Define your hostname. # Used for testing local Openshift clusters - environment.etc."NetworkManager/dnsmasq.d/openshift.conf".text = - let - openshiftClusterName = "openshift-steveej"; - openshiftDomain = "openshift.testing"; - openshiftSubnetBase = "192.168.126"; - in '' - server=/${openshiftDomain}/${openshiftSubnetBase}.1 - address=/.apps.${openshiftClusterName}.${openshiftDomain}/${openshiftSubnetBase}.51 + environment.etc."NetworkManager/dnsmasq.d/openshift.conf".text = let + openshiftClusterName = "openshift-steveej"; + openshiftDomain = "openshift.testing"; + openshiftSubnetBase = "192.168.126"; + in '' + server=/${openshiftDomain}/${openshiftSubnetBase}.1 + address=/.apps.${openshiftClusterName}.${openshiftDomain}/${openshiftSubnetBase}.51 ''; networking.firewall.enable = lib.mkForce false; networking.firewall.checkReversePath = false; - networking.bridges."virbr1".interfaces = []; - networking.interfaces."virbr1".ipv4.addresses = [ - { address = "10.254.254.254"; prefixLength = 24; } - ]; + networking.bridges."virbr1".interfaces = [ ]; + networking.interfaces."virbr1".ipv4.addresses = [{ + address = "10.254.254.254"; + prefixLength = 24; + }]; services.printing = { enable = true; - drivers = with pkgs; [ - hplip - mfcl3770cdw.driver - mfcl3770cdw.cupswrapper - ]; + drivers = with pkgs; [ hplip mfcl3770cdw.driver mfcl3770cdw.cupswrapper ]; }; services.fprintd.enable = true; @@ -48,12 +40,10 @@ in { # virtualization virtualisation = { - libvirtd = { - enable = true; - }; + libvirtd = { enable = true; }; virtualbox.host = { - enable = false ; + enable = false; addNetworkInterface = false; }; @@ -63,7 +53,6 @@ in { }; }; - boot.initrd.network = { enable = true; useDHCP = true; @@ -133,7 +122,7 @@ in { auth_to_local = RULE:[1:$1@$0](.*@REDHAT\.COM)s/@.*// auth_to_local = DEFAULT } - ''; + ''; }; hardware.ledger.enable = true; diff --git a/nix/os/devices/steveej-t480s-work/user.nix b/nix/os/devices/steveej-t480s-work/user.nix index b5f1244..899efcd 100644 --- a/nix/os/devices/steveej-t480s-work/user.nix +++ b/nix/os/devices/steveej-t480s-work/user.nix @@ -1,6 +1,4 @@ -{ config -, pkgs -, ... }: +{ config, pkgs, ... }: let passwords = import ../../../variables/passwords.crypt.nix; diff --git a/nix/os/devices/steveej-t480s-work/versions.nix b/nix/os/devices/steveej-t480s-work/versions.nix index e9664e2..b7b90a8 100644 --- a/nix/os/devices/steveej-t480s-work/versions.nix +++ b/nix/os/devices/steveej-t480s-work/versions.nix @@ -4,13 +4,10 @@ let ref = "nixos-20.09"; rev = "b94726217f7cdc02ddf277b65553762d520da196"; }; -in -{ +in { inherit nixpkgs; - nixos = nixpkgs // { - suffix = "/nixos"; - }; + nixos = nixpkgs // { suffix = "/nixos"; }; "channels-nixos-stable" = nixpkgs; "channels-nixos-unstable" = { url = "https://github.com/NixOS/nixpkgs/"; diff --git a/nix/os/devices/steveej-t480s-work/versions.tmpl.nix b/nix/os/devices/steveej-t480s-work/versions.tmpl.nix index 09f95fd..562ad1a 100644 --- a/nix/os/devices/steveej-t480s-work/versions.tmpl.nix +++ b/nix/os/devices/steveej-t480s-work/versions.tmpl.nix @@ -2,29 +2,34 @@ let nixpkgs = { url = "https://github.com/NixOS/nixpkgs/"; ref = "nixos-20.09"; - rev = "<% git ls-remote https://github.com/nixos/nixpkgs nixos-20.09 | awk '{ print $1 }' | tr -d '\n' -%>"; + rev = '' + <% git ls-remote https://github.com/nixos/nixpkgs nixos-20.09 | awk '{ print $1 }' | tr -d ' + ' -%>''; }; -in -{ +in { inherit nixpkgs; - nixos = nixpkgs // { - suffix = "/nixos"; - }; + nixos = nixpkgs // { suffix = "/nixos"; }; "channels-nixos-stable" = nixpkgs; "channels-nixos-unstable" = { url = "https://github.com/NixOS/nixpkgs/"; ref = "nixos-unstable"; - rev = "<% git ls-remote https://github.com/nixos/nixpkgs nixos-unstable | awk '{ print $1 }' | tr -d '\n' -%>"; + rev = '' + <% git ls-remote https://github.com/nixos/nixpkgs nixos-unstable | awk '{ print $1 }' | tr -d ' + ' -%>''; }; "nixpkgs-master" = { url = "https://github.com/NixOS/nixpkgs/"; ref = "master"; - rev = "<% git ls-remote https://github.com/NixOS/nixpkgs.git master | head -n1 | awk '{ print $1 }' | tr -d '\n' -%>"; + rev = '' + <% git ls-remote https://github.com/NixOS/nixpkgs.git master | head -n1 | awk '{ print $1 }' | tr -d ' + ' -%>''; }; "home-manager-module" = { url = "https://github.com/nix-community/home-manager"; ref = "release-20.09"; - rev = "<% git ls-remote https://github.com/nix-community/home-manager.git release-20.09 | awk '{ print $1 }' | tr -d '\n' -%>"; + rev = '' + <% git ls-remote https://github.com/nix-community/home-manager.git release-20.09 | awk '{ print $1 }' | tr -d ' + ' -%>''; }; } diff --git a/nix/os/devices/steveej-utilitepro/configuration.nix b/nix/os/devices/steveej-utilitepro/configuration.nix index 721d3c6..e342904 100644 --- a/nix/os/devices/steveej-utilitepro/configuration.nix +++ b/nix/os/devices/steveej-utilitepro/configuration.nix @@ -4,224 +4,227 @@ { config, pkgs, ... }: -let - passwords = import ../common/passwords.crypt.nix; -in -{ +let passwords = import ../common/passwords.crypt.nix; +in { # The NixOS release to be compatible with for stateful data such as databases. system.stateVersion = "16.03"; - nix.maxJobs = 4; - nix.buildCores = 4; + nix.maxJobs = 4; + nix.buildCores = 4; - nix.extraOptions = '' + nix.extraOptions = '' gc-keep-outputs = true gc-keep-derivations = true - ''; + ''; + + nixpkgs.config = { + + packageOverrides = super: + let self = super.pkgs; + in { + linux_4_1 = super.linux_4_1.override { + kernelPatches = super.linux_4_1.kernelPatches ++ [ + { + patch = ./patches/utilitepro-kernel-dts.patch; + name = "utilitepro-dts"; + } + { + patch = ./patches/utilitepro-kernel-dts-Makefile.patch; + name = "utilitepro-dts-Makefile"; + } + ]; + # add "CONFIG_PPP_FILTER y" option to the set of kernel options + extraConfig = '' + BTRFS_FS y + BTRFS_FS_POSIX_ACL y + FUSE_FS y + OVERLAY_FS y + + BLK_DEV_DM y + DM_THIN_PROVISIONING y + + NAMESPACES y + NET_NS y + PID_NS y + IPC_NS y + UTS_NS y + DEVPTS_MULTIPLE_INSTANCES y + CGROUPS y + CGROUP_CPUACCT y + CGROUP_DEVICE y + CGROUP_FREEZER y + CGROUP_SCHED y + CPUSETS y + MEMCG y + POSIX_MQUEUE y + + MACVLAN m + VETH m + BRIDGE m + + NF_TABLES m + NETFILTER y + NETFILTER_ADVANCED y + NF_NAT_IPV4 m + IP_NF_FILTER m + IP_NF_TARGET_MASQUERADE m + NETFILTER_XT_MATCH_ADDRTYPE m + NETFILTER_XT_MATCH_CONNTRACK m + NF_NAT m + NF_NAT_NEEDED m + BRIDGE_NETFILTER m + NETFILTER_INGRESS y + NETFILTER_NETLINK m + NETFILTER_NETLINK_ACCT m + NETFILTER_NETLINK_QUEUE m + NETFILTER_NETLINK_LOG m + NETFILTER_SYNPROXY m + NETFILTER_XTABLES m + NETFILTER_XT_MARK m + NETFILTER_XT_CONNMARK m + NETFILTER_XT_SET m + NETFILTER_XT_TARGET_AUDIT m + NETFILTER_XT_TARGET_CHECKSUM m + NETFILTER_XT_TARGET_CLASSIFY m + NETFILTER_XT_TARGET_CONNMARK m + NETFILTER_XT_TARGET_CONNSECMARK m + NETFILTER_XT_TARGET_CT m + NETFILTER_XT_TARGET_DSCP m + NETFILTER_XT_TARGET_HL m + NETFILTER_XT_TARGET_HMARK m + NETFILTER_XT_TARGET_IDLETIMER m + NETFILTER_XT_TARGET_LED m + NETFILTER_XT_TARGET_LOG m + NETFILTER_XT_TARGET_MARK m + NETFILTER_XT_NAT m + NETFILTER_XT_TARGET_NETMAP m + NETFILTER_XT_TARGET_NFLOG m + NETFILTER_XT_TARGET_NFQUEUE m + NETFILTER_XT_TARGET_NOTRACK m + NETFILTER_XT_TARGET_RATEEST m + NETFILTER_XT_TARGET_REDIRECT m + NETFILTER_XT_TARGET_TEE m + NETFILTER_XT_TARGET_TPROXY m + NETFILTER_XT_TARGET_TRACE m + NETFILTER_XT_TARGET_SECMARK m + NETFILTER_XT_TARGET_TCPMSS m + NETFILTER_XT_TARGET_TCPOPTSTRIP m + NETFILTER_XT_MATCH_ADDRTYPE m + NETFILTER_XT_MATCH_BPF m + NETFILTER_XT_MATCH_CGROUP m + NETFILTER_XT_MATCH_CLUSTER m + NETFILTER_XT_MATCH_COMMENT m + NETFILTER_XT_MATCH_CONNBYTES m + NETFILTER_XT_MATCH_CONNLABEL m + NETFILTER_XT_MATCH_CONNLIMIT m + NETFILTER_XT_MATCH_CONNMARK m + NETFILTER_XT_MATCH_CONNTRACK m + NETFILTER_XT_MATCH_CPU m + NETFILTER_XT_MATCH_DCCP m + NETFILTER_XT_MATCH_DEVGROUP m + NETFILTER_XT_MATCH_DSCP m + NETFILTER_XT_MATCH_ECN m + NETFILTER_XT_MATCH_ESP m + NETFILTER_XT_MATCH_HASHLIMIT m + NETFILTER_XT_MATCH_HELPER m + NETFILTER_XT_MATCH_HL m + NETFILTER_XT_MATCH_IPCOMP m + NETFILTER_XT_MATCH_IPRANGE m + NETFILTER_XT_MATCH_IPVS m + NETFILTER_XT_MATCH_L2TP m + NETFILTER_XT_MATCH_LENGTH m + NETFILTER_XT_MATCH_LIMIT m + NETFILTER_XT_MATCH_MAC m + NETFILTER_XT_MATCH_MARK m + NETFILTER_XT_MATCH_MULTIPORT m + NETFILTER_XT_MATCH_NFACCT m + NETFILTER_XT_MATCH_OSF m + NETFILTER_XT_MATCH_OWNER m + NETFILTER_XT_MATCH_POLICY m + NETFILTER_XT_MATCH_PHYSDEV m + NETFILTER_XT_MATCH_PKTTYPE m + NETFILTER_XT_MATCH_QUOTA m + NETFILTER_XT_MATCH_RATEEST m + NETFILTER_XT_MATCH_REALM m + NETFILTER_XT_MATCH_RECENT m + NETFILTER_XT_MATCH_SCTP m + NETFILTER_XT_MATCH_SOCKET m + NETFILTER_XT_MATCH_STATE m + NETFILTER_XT_MATCH_STATISTIC m + NETFILTER_XT_MATCH_STRING m + NETFILTER_XT_MATCH_TCPMSS m + NETFILTER_XT_MATCH_TIME m + NETFILTER_XT_MATCH_U32 m - nixpkgs.config = { + MEMCG_KMEM y + MEMCG_SWAP y + MEMCG_SWAP_ENABLED y + BLK_CGROUP y + IOSCHED_CFQ y + BLK_DEV_THROTTLING y + CGROUP_PERF y + CGROUP_HUGETLB y + NET_CLS_CGROUP y + CGROUP_NET_PRIO y + CFS_BANDWIDTH y + FAIR_GROUP_SCHED y + RT_GROUP_SCHED y + EXT3_FS y + EXT3_FS_XATTR y + EXT3_FS_POSIX_ACL y + EXT3_FS_SECURITY y - packageOverrides = super: let self = super.pkgs; in { - linux_4_1 = super.linux_4_1.override { - kernelPatches = super.linux_4_1.kernelPatches ++ [ - { patch = ./patches/utilitepro-kernel-dts.patch; name = "utilitepro-dts"; } - { patch = ./patches/utilitepro-kernel-dts-Makefile.patch; name = "utilitepro-dts-Makefile"; } - ]; - # add "CONFIG_PPP_FILTER y" option to the set of kernel options - extraConfig = '' - BTRFS_FS y - BTRFS_FS_POSIX_ACL y - FUSE_FS y - OVERLAY_FS y + PPP_FILTER y + HAVE_IMX_ANATOP y + HAVE_IMX_GPC y + HAVE_IMX_MMDC y + HAVE_IMX_SRC y + SOC_IMX6 y + SOC_IMX6Q y + SOC_IMX6SL y + PCI_IMX6 y + ARM_IMX6Q_CPUFREQ y + IMX_WEIM y + AHCI_IMX y + SERIAL_IMX y + SERIAL_IMX_CONSOLE y + I2C_IMX y + SPI_IMX y + PINCTRL_IMX y + PINCTRL_IMX6Q y + PINCTRL_IMX6SL y + POWER_RESET_IMX y + IMX_THERMAL y + IMX2_WDT y + IMX_IPUV3_CORE y + DRM_IMX y + DRM_IMX_FB_HELPER y + DRM_IMX_PARALLEL_DISPLAY y + DRM_IMX_TVE y + DRM_IMX_LDB y + DRM_IMX_IPUV3 y + DRM_IMX_HDMI y + MMC_SDHCI_ESDHC_IMX y + IMX_SDMA y + PWM_IMX y + DEBUG_IMX6Q_UART y - BLK_DEV_DM y - DM_THIN_PROVISIONING y - - NAMESPACES y - NET_NS y - PID_NS y - IPC_NS y - UTS_NS y - DEVPTS_MULTIPLE_INSTANCES y - CGROUPS y - CGROUP_CPUACCT y - CGROUP_DEVICE y - CGROUP_FREEZER y - CGROUP_SCHED y - CPUSETS y - MEMCG y - POSIX_MQUEUE y - - MACVLAN m - VETH m - BRIDGE m - - NF_TABLES m - NETFILTER y - NETFILTER_ADVANCED y - NF_NAT_IPV4 m - IP_NF_FILTER m - IP_NF_TARGET_MASQUERADE m - NETFILTER_XT_MATCH_ADDRTYPE m - NETFILTER_XT_MATCH_CONNTRACK m - NF_NAT m - NF_NAT_NEEDED m - BRIDGE_NETFILTER m - NETFILTER_INGRESS y - NETFILTER_NETLINK m - NETFILTER_NETLINK_ACCT m - NETFILTER_NETLINK_QUEUE m - NETFILTER_NETLINK_LOG m - NETFILTER_SYNPROXY m - NETFILTER_XTABLES m - NETFILTER_XT_MARK m - NETFILTER_XT_CONNMARK m - NETFILTER_XT_SET m - NETFILTER_XT_TARGET_AUDIT m - NETFILTER_XT_TARGET_CHECKSUM m - NETFILTER_XT_TARGET_CLASSIFY m - NETFILTER_XT_TARGET_CONNMARK m - NETFILTER_XT_TARGET_CONNSECMARK m - NETFILTER_XT_TARGET_CT m - NETFILTER_XT_TARGET_DSCP m - NETFILTER_XT_TARGET_HL m - NETFILTER_XT_TARGET_HMARK m - NETFILTER_XT_TARGET_IDLETIMER m - NETFILTER_XT_TARGET_LED m - NETFILTER_XT_TARGET_LOG m - NETFILTER_XT_TARGET_MARK m - NETFILTER_XT_NAT m - NETFILTER_XT_TARGET_NETMAP m - NETFILTER_XT_TARGET_NFLOG m - NETFILTER_XT_TARGET_NFQUEUE m - NETFILTER_XT_TARGET_NOTRACK m - NETFILTER_XT_TARGET_RATEEST m - NETFILTER_XT_TARGET_REDIRECT m - NETFILTER_XT_TARGET_TEE m - NETFILTER_XT_TARGET_TPROXY m - NETFILTER_XT_TARGET_TRACE m - NETFILTER_XT_TARGET_SECMARK m - NETFILTER_XT_TARGET_TCPMSS m - NETFILTER_XT_TARGET_TCPOPTSTRIP m - NETFILTER_XT_MATCH_ADDRTYPE m - NETFILTER_XT_MATCH_BPF m - NETFILTER_XT_MATCH_CGROUP m - NETFILTER_XT_MATCH_CLUSTER m - NETFILTER_XT_MATCH_COMMENT m - NETFILTER_XT_MATCH_CONNBYTES m - NETFILTER_XT_MATCH_CONNLABEL m - NETFILTER_XT_MATCH_CONNLIMIT m - NETFILTER_XT_MATCH_CONNMARK m - NETFILTER_XT_MATCH_CONNTRACK m - NETFILTER_XT_MATCH_CPU m - NETFILTER_XT_MATCH_DCCP m - NETFILTER_XT_MATCH_DEVGROUP m - NETFILTER_XT_MATCH_DSCP m - NETFILTER_XT_MATCH_ECN m - NETFILTER_XT_MATCH_ESP m - NETFILTER_XT_MATCH_HASHLIMIT m - NETFILTER_XT_MATCH_HELPER m - NETFILTER_XT_MATCH_HL m - NETFILTER_XT_MATCH_IPCOMP m - NETFILTER_XT_MATCH_IPRANGE m - NETFILTER_XT_MATCH_IPVS m - NETFILTER_XT_MATCH_L2TP m - NETFILTER_XT_MATCH_LENGTH m - NETFILTER_XT_MATCH_LIMIT m - NETFILTER_XT_MATCH_MAC m - NETFILTER_XT_MATCH_MARK m - NETFILTER_XT_MATCH_MULTIPORT m - NETFILTER_XT_MATCH_NFACCT m - NETFILTER_XT_MATCH_OSF m - NETFILTER_XT_MATCH_OWNER m - NETFILTER_XT_MATCH_POLICY m - NETFILTER_XT_MATCH_PHYSDEV m - NETFILTER_XT_MATCH_PKTTYPE m - NETFILTER_XT_MATCH_QUOTA m - NETFILTER_XT_MATCH_RATEEST m - NETFILTER_XT_MATCH_REALM m - NETFILTER_XT_MATCH_RECENT m - NETFILTER_XT_MATCH_SCTP m - NETFILTER_XT_MATCH_SOCKET m - NETFILTER_XT_MATCH_STATE m - NETFILTER_XT_MATCH_STATISTIC m - NETFILTER_XT_MATCH_STRING m - NETFILTER_XT_MATCH_TCPMSS m - NETFILTER_XT_MATCH_TIME m - NETFILTER_XT_MATCH_U32 m - - - - MEMCG_KMEM y - MEMCG_SWAP y - MEMCG_SWAP_ENABLED y - BLK_CGROUP y - IOSCHED_CFQ y - BLK_DEV_THROTTLING y - CGROUP_PERF y - CGROUP_HUGETLB y - NET_CLS_CGROUP y - CGROUP_NET_PRIO y - CFS_BANDWIDTH y - FAIR_GROUP_SCHED y - RT_GROUP_SCHED y - EXT3_FS y - EXT3_FS_XATTR y - EXT3_FS_POSIX_ACL y - EXT3_FS_SECURITY y - - PPP_FILTER y - HAVE_IMX_ANATOP y - HAVE_IMX_GPC y - HAVE_IMX_MMDC y - HAVE_IMX_SRC y - SOC_IMX6 y - SOC_IMX6Q y - SOC_IMX6SL y - PCI_IMX6 y - ARM_IMX6Q_CPUFREQ y - IMX_WEIM y - AHCI_IMX y - SERIAL_IMX y - SERIAL_IMX_CONSOLE y - I2C_IMX y - SPI_IMX y - PINCTRL_IMX y - PINCTRL_IMX6Q y - PINCTRL_IMX6SL y - POWER_RESET_IMX y - IMX_THERMAL y - IMX2_WDT y - IMX_IPUV3_CORE y - DRM_IMX y - DRM_IMX_FB_HELPER y - DRM_IMX_PARALLEL_DISPLAY y - DRM_IMX_TVE y - DRM_IMX_LDB y - DRM_IMX_IPUV3 y - DRM_IMX_HDMI y - MMC_SDHCI_ESDHC_IMX y - IMX_SDMA y - PWM_IMX y - DEBUG_IMX6Q_UART y - - ''; + ''; + }; + # pkgs.linux_4_2 = "/nix/store/jc1h6mcc6sq420q2i572qba4b0xzw4gm-linux-4.3-armv7l-unknown-linux-gnueabi"; }; -# pkgs.linux_4_2 = "/nix/store/jc1h6mcc6sq420q2i572qba4b0xzw4gm-linux-4.3-armv7l-unknown-linux-gnueabi"; - }; - allowUnfree = true; - }; + allowUnfree = true; + }; - imports = - [ # Include the results of the hardware scan. - ./hardware-configuration.nix - ]; + imports = [ # Include the results of the hardware scan. + ./hardware-configuration.nix + ]; networking.hostName = "steveej-utilitepro"; # Define your hostname. -#networking.wireless.enable = true; # Enables wireless support viawpa_supplicant. + #networking.wireless.enable = true; # Enables wireless support viawpa_supplicant. - boot.kernelPackages = pkgs.linuxPackages_4_1; + boot.kernelPackages = pkgs.linuxPackages_4_1; boot.extraKernelParams = [ "cm_fx6_v4l_msize=128M" "vmalloc=256M" @@ -263,7 +266,9 @@ in users.mutableUsers = false; users.extraUsers.root = { hashedPassword = passwords.users.root; - openssh.authorizedKeys.keys = ["ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQD3niN5KcIYikRhXTYZCSehI1ZQs+vvG/dZ7KxNVHslfsS+p1yTycXcZFtDDn5vtG2fAo3yksxCk+G10/AWQ+NMOcFKuAi5qTOYSLbEcHVlZ4ko8sDUe3fF79vrCqY7IWbKKjZ4DH77Qs6SXk5GIlNaIzxut8Dpv8qHnkPiPuFgrJC4oGk60ZKmCPvOEpgg9twcdI6ykIxD4Fg+hHgG1p07uSEcm9EADli8RsU3UJ1UBhXMohMC6HrKVBkBX9wTo+zY+xqXxxem6xGNnkNiZLACfhCnjXv39zh85pgFuNv7R8SzVZQ9iRoCmax/w3JtWdDjqoTGgLfJyhMMjNdjVHOx steveej@steveej-laptop"]; + openssh.authorizedKeys.keys = [ + "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQD3niN5KcIYikRhXTYZCSehI1ZQs+vvG/dZ7KxNVHslfsS+p1yTycXcZFtDDn5vtG2fAo3yksxCk+G10/AWQ+NMOcFKuAi5qTOYSLbEcHVlZ4ko8sDUe3fF79vrCqY7IWbKKjZ4DH77Qs6SXk5GIlNaIzxut8Dpv8qHnkPiPuFgrJC4oGk60ZKmCPvOEpgg9twcdI6ykIxD4Fg+hHgG1p07uSEcm9EADli8RsU3UJ1UBhXMohMC6HrKVBkBX9wTo+zY+xqXxxem6xGNnkNiZLACfhCnjXv39zh85pgFuNv7R8SzVZQ9iRoCmax/w3JtWdDjqoTGgLfJyhMMjNdjVHOx steveej@steveej-laptop" + ]; }; users.extraUsers.steveej = { uid = 1000; @@ -271,9 +276,11 @@ in home = "/home/steveej"; extraGroups = [ "wheel" "libvirtd" ]; hashedPassword = passwords.users.steveej; - openssh.authorizedKeys.keys = ["ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQD3niN5KcIYikRhXTYZCSehI1ZQs+vvG/dZ7KxNVHslfsS+p1yTycXcZFtDDn5vtG2fAo3yksxCk+G10/AWQ+NMOcFKuAi5qTOYSLbEcHVlZ4ko8sDUe3fF79vrCqY7IWbKKjZ4DH77Qs6SXk5GIlNaIzxut8Dpv8qHnkPiPuFgrJC4oGk60ZKmCPvOEpgg9twcdI6ykIxD4Fg+hHgG1p07uSEcm9EADli8RsU3UJ1UBhXMohMC6HrKVBkBX9wTo+zY+xqXxxem6xGNnkNiZLACfhCnjXv39zh85pgFuNv7R8SzVZQ9iRoCmax/w3JtWdDjqoTGgLfJyhMMjNdjVHOx steveej@steveej-laptop"]; - }; + openssh.authorizedKeys.keys = [ + "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQD3niN5KcIYikRhXTYZCSehI1ZQs+vvG/dZ7KxNVHslfsS+p1yTycXcZFtDDn5vtG2fAo3yksxCk+G10/AWQ+NMOcFKuAi5qTOYSLbEcHVlZ4ko8sDUe3fF79vrCqY7IWbKKjZ4DH77Qs6SXk5GIlNaIzxut8Dpv8qHnkPiPuFgrJC4oGk60ZKmCPvOEpgg9twcdI6ykIxD4Fg+hHgG1p07uSEcm9EADli8RsU3UJ1UBhXMohMC6HrKVBkBX9wTo+zY+xqXxxem6xGNnkNiZLACfhCnjXv39zh85pgFuNv7R8SzVZQ9iRoCmax/w3JtWdDjqoTGgLfJyhMMjNdjVHOx steveej@steveej-laptop" + ]; + }; networking.firewall.enable = false; - networking.useNetworkd = true; + networking.useNetworkd = true; } diff --git a/nix/os/devices/steveej-utilitepro/hardware-configuration.nix b/nix/os/devices/steveej-utilitepro/hardware-configuration.nix index e5eecc9..c6ce2e6 100644 --- a/nix/os/devices/steveej-utilitepro/hardware-configuration.nix +++ b/nix/os/devices/steveej-utilitepro/hardware-configuration.nix @@ -4,9 +4,7 @@ { config, lib, pkgs, ... }: { - imports = - [ - ]; + imports = [ ]; boot.initrd.availableKernelModules = [ ]; boot.kernelModules = [ ]; @@ -14,14 +12,14 @@ hardware.enableAllFirmware = true; - fileSystems."/" = - { device = "/dev/disk/by-uuid/09d1e4a2-d57b-4de8-a42b-671c4c188367"; - fsType = "btrfs"; - options = "subvol=nixos"; - }; - fileSystems."/boot" = - { device = "/dev/disk/by-uuid/f1e7e913-93a0-4258-88f9-f65041d91d66"; - }; + fileSystems."/" = { + device = "/dev/disk/by-uuid/09d1e4a2-d57b-4de8-a42b-671c4c188367"; + fsType = "btrfs"; + options = "subvol=nixos"; + }; + fileSystems."/boot" = { + device = "/dev/disk/by-uuid/f1e7e913-93a0-4258-88f9-f65041d91d66"; + }; swapDevices = [ ]; } diff --git a/nix/os/devices/vmd32387.contaboserver.net/boot.nix b/nix/os/devices/vmd32387.contaboserver.net/boot.nix index 18fcc13..8a093b9 100644 --- a/nix/os/devices/vmd32387.contaboserver.net/boot.nix +++ b/nix/os/devices/vmd32387.contaboserver.net/boot.nix @@ -1,6 +1,4 @@ -{ lib -, ... -}: +{ lib, ... }: { boot.loader.grub.efiSupport = lib.mkForce false; diff --git a/nix/os/devices/vmd32387.contaboserver.net/configuration.nix b/nix/os/devices/vmd32387.contaboserver.net/configuration.nix index b681c06..5dfb10f 100644 --- a/nix/os/devices/vmd32387.contaboserver.net/configuration.nix +++ b/nix/os/devices/vmd32387.contaboserver.net/configuration.nix @@ -1,8 +1,7 @@ { ... }: { - disabledModules = [ - ]; + disabledModules = [ ]; imports = [ ../../profiles/common/configuration.nix ../../modules/opinionatedDisk.nix diff --git a/nix/os/devices/vmd32387.contaboserver.net/hw.nix b/nix/os/devices/vmd32387.contaboserver.net/hw.nix index 6ab2dec..35beaa2 100644 --- a/nix/os/devices/vmd32387.contaboserver.net/hw.nix +++ b/nix/os/devices/vmd32387.contaboserver.net/hw.nix @@ -1,7 +1,7 @@ { ... }: let - stage1Modules = [ + stage1Modules = [ "aesni_intel" "kvm-intel" @@ -14,8 +14,7 @@ let "scsi_mod" ]; -in -{ +in { # TASK: new device hardware.opinionatedDisk = { enable = true; @@ -25,6 +24,5 @@ in boot.initrd.availableKernelModules = stage1Modules; boot.initrd.kernelModules = stage1Modules; - boot.extraModprobeConfig = '' - ''; + boot.extraModprobeConfig = ""; } diff --git a/nix/os/devices/vmd32387.contaboserver.net/pkg.nix b/nix/os/devices/vmd32387.contaboserver.net/pkg.nix index f8ee564..5b88997 100644 --- a/nix/os/devices/vmd32387.contaboserver.net/pkg.nix +++ b/nix/os/devices/vmd32387.contaboserver.net/pkg.nix @@ -1,29 +1,31 @@ -{ config -, pkgs -, lib -, ... -}: +{ config, pkgs, lib, ... }: { - nixpkgs.config.packageOverrides = pkgs: with pkgs; { - nixPath = (import ../../../default.nix { versionsPath = ./versions.nix; }).nixPath; - }; - home-manager.users.steveej = import ../../../home-manager/configuration/text-minimal.nix { inherit pkgs; }; + nixpkgs.config.packageOverrides = pkgs: + with pkgs; { + nixPath = (import ../../../default.nix { + versionsPath = ./versions.nix; + }).nixPath; + }; + home-manager.users.steveej = + import ../../../home-manager/configuration/text-minimal.nix { + inherit pkgs; + }; - nix.buildMachines = [ - { hostName = "localhost"; - system = "x86_64-linux"; - supportedFeatures = ["kvm" "nixos-test" "big-parallel" "benchmark"]; - maxJobs = 4; - } - ]; + nix.buildMachines = [{ + hostName = "localhost"; + system = "x86_64-linux"; + supportedFeatures = [ "kvm" "nixos-test" "big-parallel" "benchmark" ]; + maxJobs = 4; + }]; services.hydra = { enable = false; hydraURL = "http://localhost:3000"; # externally visible URL - notificationSender = "hydra@${config.networking.hostName}.stefanjunker.de"; # e-mail of hydra service + notificationSender = + "hydra@${config.networking.hostName}.stefanjunker.de"; # e-mail of hydra service # a standalone hydra will require you to unset the buildMachinesFiles list to avoid using a nonexistant /etc/nix/machines - buildMachinesFiles = []; + buildMachinesFiles = [ ]; # you will probably also want, otherwise *everything* will be built from scratch useSubstitutes = true; }; @@ -31,13 +33,7 @@ services.gitlab-runner = { enable = true; - extraPackages = with pkgs; [ - bash - gitlab-runner - nix - gitFull - git-crypt - ]; + extraPackages = with pkgs; [ bash gitlab-runner nix gitFull git-crypt ]; concurrent = 2; checkInterval = 0; @@ -45,7 +41,8 @@ nixRunner = { executor = "shell"; runUntagged = true; - registrationConfigFile = "/etc/secrets/gitlab-runner/nix-runner.registration"; + registrationConfigFile = + "/etc/secrets/gitlab-runner/nix-runner.registration"; tagList = [ "nix" ]; }; }; diff --git a/nix/os/devices/vmd32387.contaboserver.net/system.nix b/nix/os/devices/vmd32387.contaboserver.net/system.nix index a3305eb..5caa064 100644 --- a/nix/os/devices/vmd32387.contaboserver.net/system.nix +++ b/nix/os/devices/vmd32387.contaboserver.net/system.nix @@ -1,7 +1,4 @@ -{ pkgs -, lib -, config -, ... }: +{ pkgs, lib, config, ... }: let keys = import ../../../variables/keys.nix; @@ -10,7 +7,7 @@ let in { # TASK: new device networking.hostName = "vmd32387"; # Define your hostname. - networking.domain = "contaboserver.net"; + networking.domain = "contaboserver.net"; networking.firewall.enable = true; networking.firewall.allowedTCPPorts = [ @@ -27,9 +24,10 @@ in { networking.interfaces.eth0 = { useDHCP = true; - ipv6.addresses = [ - { address = "2a02:c207:3003:2387::1"; prefixLength = 64; } - ]; + ipv6.addresses = [{ + address = "2a02:c207:3003:2387::1"; + prefixLength = 64; + }]; }; networking.defaultGateway6 = { address = "fe80::1"; @@ -46,9 +44,7 @@ in { # services.kubernetes.roles = ["master" "node"]; # virtualization - virtualisation = { - docker.enable = true; - }; + virtualisation = { docker.enable = true; }; services.spice-vdagentd.enable = true; services.qemuGuest.enable = true; @@ -62,25 +58,21 @@ in { ''; }; - systemd.services.sshd.serviceConfig = { - TasksMax = 32; - }; + systemd.services.sshd.serviceConfig = { TasksMax = 32; }; systemd.timers."sshd-status" = { description = "Timer to trigger sshd-status periodically"; enable = true; wantedBy = [ "timer.target" "multi-user.target" ]; timerConfig = { - OnActiveSec="5s"; - OnUnitActiveSec="5s"; - AccuracySec="1s"; + OnActiveSec = "5s"; + OnUnitActiveSec = "5s"; + AccuracySec = "1s"; Unit = "sshd-status.service"; }; }; - nix.gc = { - automatic = true; - }; + nix.gc = { automatic = true; }; boot.initrd.network = { enable = true; diff --git a/nix/os/devices/vmd32387.contaboserver.net/versions.nix b/nix/os/devices/vmd32387.contaboserver.net/versions.nix index a9a9f70..b921921 100644 --- a/nix/os/devices/vmd32387.contaboserver.net/versions.nix +++ b/nix/os/devices/vmd32387.contaboserver.net/versions.nix @@ -4,13 +4,10 @@ let ref = "nixos-21.11"; rev = "e34c5379866833f41e2a36f309912fa675d687c7"; }; -in -{ +in { inherit nixpkgs; - nixos = nixpkgs // { - suffix = "/nixos"; - }; + nixos = nixpkgs // { suffix = "/nixos"; }; "channels-nixos-stable" = nixpkgs; "channels-nixos-21.05" = { url = "https://github.com/NixOS/nixpkgs/"; diff --git a/nix/os/devices/vmd32387.contaboserver.net/versions.tmpl.nix b/nix/os/devices/vmd32387.contaboserver.net/versions.tmpl.nix index 30642d3..866290f 100644 --- a/nix/os/devices/vmd32387.contaboserver.net/versions.tmpl.nix +++ b/nix/os/devices/vmd32387.contaboserver.net/versions.tmpl.nix @@ -2,49 +2,62 @@ let nixpkgs = { url = "https://github.com/NixOS/nixpkgs/"; ref = "nixos-21.11"; - rev = "<% git ls-remote https://github.com/nixos/nixpkgs nixos-21.11 | awk '{ print $1 }' | tr -d '\n' -%>"; + rev = '' + <% git ls-remote https://github.com/nixos/nixpkgs nixos-21.11 | awk '{ print $1 }' | tr -d ' + ' -%>''; }; -in -{ +in { inherit nixpkgs; - nixos = nixpkgs // { - suffix = "/nixos"; - }; + nixos = nixpkgs // { suffix = "/nixos"; }; "channels-nixos-stable" = nixpkgs; "channels-nixos-21.05" = { url = "https://github.com/NixOS/nixpkgs/"; ref = "nixos-21.05"; - rev = "<% git ls-remote https://github.com/nixos/nixpkgs nixos-20.05 | awk '{ print $1 }' | tr -d '\n' -%>"; + rev = '' + <% git ls-remote https://github.com/nixos/nixpkgs nixos-20.05 | awk '{ print $1 }' | tr -d ' + ' -%>''; }; "channels-nixos-20.09" = { url = "https://github.com/NixOS/nixpkgs/"; ref = "nixos-20.09"; - rev = "<% git ls-remote https://github.com/nixos/nixpkgs nixos-20.09 | awk '{ print $1 }' | tr -d '\n' -%>"; + rev = '' + <% git ls-remote https://github.com/nixos/nixpkgs nixos-20.09 | awk '{ print $1 }' | tr -d ' + ' -%>''; }; "channels-nixos-20.03" = { url = "https://github.com/NixOS/nixpkgs/"; ref = "nixos-20.03"; - rev = "<% git ls-remote https://github.com/nixos/nixpkgs nixos-20.03 | awk '{ print $1 }' | tr -d '\n' -%>"; + rev = '' + <% git ls-remote https://github.com/nixos/nixpkgs nixos-20.03 | awk '{ print $1 }' | tr -d ' + ' -%>''; }; "channels-nixos-19.09" = { url = "https://github.com/NixOS/nixpkgs/"; ref = "nixos-19.09"; - rev = "<% git ls-remote https://github.com/nixos/nixpkgs nixos-19.09 | awk '{ print $1 }' | tr -d '\n' -%>"; + rev = '' + <% git ls-remote https://github.com/nixos/nixpkgs nixos-19.09 | awk '{ print $1 }' | tr -d ' + ' -%>''; }; "channels-nixos-unstable" = { url = "https://github.com/NixOS/nixpkgs/"; ref = "nixos-unstable"; - rev = "<% git ls-remote https://github.com/nixos/nixpkgs nixos-unstable | awk '{ print $1 }' | tr -d '\n' -%>"; + rev = '' + <% git ls-remote https://github.com/nixos/nixpkgs nixos-unstable | awk '{ print $1 }' | tr -d ' + ' -%>''; }; "nixpkgs-master" = { url = "https://github.com/NixOS/nixpkgs/"; ref = "master"; - rev = "<% git ls-remote https://github.com/NixOS/nixpkgs.git master | head -n1 | awk '{ print $1 }' | tr -d '\n' -%>"; + rev = '' + <% git ls-remote https://github.com/NixOS/nixpkgs.git master | head -n1 | awk '{ print $1 }' | tr -d ' + ' -%>''; }; "home-manager-module" = { url = "https://github.com/nix-community/home-manager"; ref = "release-21.05"; - rev = "<% git ls-remote https://github.com/nix-community/home-manager.git release-21.05 | awk '{ print $1 }' | tr -d '\n' -%>"; + rev = '' + <% git ls-remote https://github.com/nix-community/home-manager.git release-21.05 | awk '{ print $1 }' | tr -d ' + ' -%>''; }; } diff --git a/nix/os/lib/default.nix b/nix/os/lib/default.nix index 503d30e..abeadd9 100644 --- a/nix/os/lib/default.nix +++ b/nix/os/lib/default.nix @@ -1,31 +1,32 @@ -{ keys ? import ../../variables/keys.nix -, passwords ? import ../../variables/passwords.crypt.nix -}: +{ keys ? import ../../variables/keys.nix +, passwords ? import ../../variables/passwords.crypt.nix }: { - mkRoot = { } @ args: { - hashedPassword = passwords.users.root; - openssh.authorizedKeys.keys = keys.users.steveej.openssh; - } // args; + mkRoot = { }@args: + { + hashedPassword = passwords.users.root; + openssh.authorizedKeys.keys = keys.users.steveej.openssh; + } // args; - mkUser = {uid, hashedPassword ? passwords.users.steveej, ... } @ args: { - inherit uid hashedPassword; - isNormalUser = true; - extraGroups = [ - "docker" - "wheel" - "libvirtd" - "networkmanager" - "vboxusers" - "users" - "input" - "audio" - "video" - "cdrom" - "adbusers" - ]; - openssh.authorizedKeys.keys = keys.users.steveej.openssh; - } // args; + mkUser = { uid, hashedPassword ? passwords.users.steveej, ... }@args: + { + inherit uid hashedPassword; + isNormalUser = true; + extraGroups = [ + "docker" + "wheel" + "libvirtd" + "networkmanager" + "vboxusers" + "users" + "input" + "audio" + "video" + "cdrom" + "adbusers" + ]; + openssh.authorizedKeys.keys = keys.users.steveej.openssh; + } // args; disk = rec { # TODO: verify the GPT PARTLABEL cap at 36 chars @@ -44,14 +45,16 @@ # Cannot use the disk ID here because might be different at install vs. runtime. # Example: MMC card which is used in the internal reader vs. USB reader - bootFsDevice = diskId: "/dev/disk/by-partlabel/" + (shortenGptPartlabel ("2-"+diskId)); - bootLuksDevice = diskId: "/dev/disk/by-partlabel/" + (shortenGptPartlabel ("3-"+diskId)); - luksName = diskId: (volumeGroup diskId)+"pv"; + bootFsDevice = diskId: + "/dev/disk/by-partlabel/" + (shortenGptPartlabel ("2-" + diskId)); + bootLuksDevice = diskId: + "/dev/disk/by-partlabel/" + (shortenGptPartlabel ("3-" + diskId)); + luksName = diskId: (volumeGroup diskId) + "pv"; luksPhysicalVolume = diskId: "/dev/mapper/" + (luksName diskId); lvmPv = diskId: encrypted: - if encrypted == true - then luksPhysicalVolume diskId - else bootLuksDevice diskId - ; + if encrypted == true then + luksPhysicalVolume diskId + else + bootLuksDevice diskId; }; } diff --git a/nix/os/modules/ddclient-ovh.nix b/nix/os/modules/ddclient-ovh.nix index 9f54b79..3dc4445 100644 --- a/nix/os/modules/ddclient-ovh.nix +++ b/nix/os/modules/ddclient-ovh.nix @@ -1,6 +1,4 @@ -{ lib -, config -, ... }: +{ lib, config, ... }: let cfg = config.services.ddclientovh; @@ -11,21 +9,20 @@ in { options.services.ddclientovh = with lib; { enable = mkEnableOption "Enable ddclient-ovh"; - domain = mkOption { - type = types.str; - }; + domain = mkOption { type = types.str; }; }; config = lib.mkIf cfg.enable { - services.ddclient = { - enable = true; - protocol = "dyndns2"; - server = "www.ovh.com"; - ssl = true; - domains = [ cfg.domain ]; - use = "web"; - inherit (passwords.dyndns.${cfg.domain}) username; - passwordFile = builtins.toFile passwords.dyndns._filename passwords.dyndns.${cfg.domain}.password; + services.ddclient = { + enable = true; + protocol = "dyndns2"; + server = "www.ovh.com"; + ssl = true; + domains = [ cfg.domain ]; + use = "web"; + inherit (passwords.dyndns.${cfg.domain}) username; + passwordFile = builtins.toFile passwords.dyndns._filename + passwords.dyndns.${cfg.domain}.password; }; }; } diff --git a/nix/os/modules/initrd-network.nix b/nix/os/modules/initrd-network.nix index 4c9da89..820eb55 100644 --- a/nix/os/modules/initrd-network.nix +++ b/nix/os/modules/initrd-network.nix @@ -6,29 +6,26 @@ let cfg = config.boot.initrd.network; - udhcpcScript = pkgs.writeScript "udhcp-script" - '' - #! /bin/sh - if [ "$1" = bound ]; then - ip address add "$ip/$mask" dev "$interface" - if [ -n "$router" ]; then - ip route add "$router" dev "$interface" # just in case if "$router" is not within "$ip/$mask" (e.g. Hetzner Cloud) - ip route add default via "$router" dev "$interface" - fi - if [ -n "$dns" ]; then - rm -f /etc/resolv.conf - for i in $dns; do - echo "nameserver $dns" >> /etc/resolv.conf - done - fi + udhcpcScript = pkgs.writeScript "udhcp-script" '' + #! /bin/sh + if [ "$1" = bound ]; then + ip address add "$ip/$mask" dev "$interface" + if [ -n "$router" ]; then + ip route add "$router" dev "$interface" # just in case if "$router" is not within "$ip/$mask" (e.g. Hetzner Cloud) + ip route add default via "$router" dev "$interface" fi - ''; + if [ -n "$dns" ]; then + rm -f /etc/resolv.conf + for i in $dns; do + echo "nameserver $dns" >> /etc/resolv.conf + done + fi + fi + ''; udhcpcArgs = toString cfg.udhcpc.extraArgs; -in - -{ +in { options = { @@ -51,7 +48,7 @@ in }; boot.initrd.network.udhcpc.extraArgs = mkOption { - default = []; + default = [ ]; type = types.listOf types.str; description = '' Additional command-line arguments passed verbatim to udhcpc if diff --git a/nix/os/modules/natrouter.nix b/nix/os/modules/natrouter.nix index a834cca..ba864b6 100644 --- a/nix/os/modules/natrouter.nix +++ b/nix/os/modules/natrouter.nix @@ -1,7 +1,5 @@ -{ lib -, config -, ... }: -with lib; +{ lib, config, ... }: +with lib; { # TODO diff --git a/nix/os/modules/opinionatedDisk.nix b/nix/os/modules/opinionatedDisk.nix index c9864ed..c51c1e5 100644 --- a/nix/os/modules/opinionatedDisk.nix +++ b/nix/os/modules/opinionatedDisk.nix @@ -1,7 +1,5 @@ -{ lib -, config -, ... }: -with lib; +{ lib, config, ... }: +with lib; let cfg = config.hardware.opinionatedDisk; @@ -9,9 +7,7 @@ let in { options.hardware.opinionatedDisk = { enable = mkEnableOption "Enable opinionated filesystem layout"; - diskId = mkOption { - type = types.str; - }; + diskId = mkOption { type = types.str; }; encrypted = mkOption { default = true; type = types.bool; @@ -36,27 +32,25 @@ in { options = [ "subvol=home" ]; }; - swapDevices = [ { device = (ownLib.disk.swapFsDevice cfg.diskId); } ]; + swapDevices = [{ device = (ownLib.disk.swapFsDevice cfg.diskId); }]; boot.loader.grub = { device = (ownLib.disk.bootGrubDevice cfg.diskId); enableCryptodisk = cfg.encrypted; }; - boot.initrd.luks.devices = lib.optionalAttrs cfg.encrypted (builtins.listToAttrs [ - { - name = - let - splitstring = builtins.split "/" (ownLib.disk.bootLuksDevice cfg.diskId); - lastelem = (builtins.length splitstring)-1; - in - builtins.elemAt splitstring lastelem; + boot.initrd.luks.devices = lib.optionalAttrs cfg.encrypted + (builtins.listToAttrs [{ + name = let + splitstring = + builtins.split "/" (ownLib.disk.bootLuksDevice cfg.diskId); + lastelem = (builtins.length splitstring) - 1; + in builtins.elemAt splitstring lastelem; value = { device = (ownLib.disk.bootLuksDevice cfg.diskId); preLVM = true; allowDiscards = true; }; - } - ]); + }]); }; } diff --git a/nix/os/profiles/common/boot.nix b/nix/os/profiles/common/boot.nix index dba7c70..01be27f 100644 --- a/nix/os/profiles/common/boot.nix +++ b/nix/os/profiles/common/boot.nix @@ -1,6 +1,4 @@ -{ pkgs -, ... -}: +{ pkgs, ... }: { boot.kernelPackages = pkgs.linuxPackages; @@ -16,9 +14,6 @@ boot.tmpOnTmpfs = true; # Workaround for nm-pptp to enforce module load - boot.kernelModules = [ - "nf_conntrack_proto_gre" - "nf_conntrack_pptp" - ]; + boot.kernelModules = [ "nf_conntrack_proto_gre" "nf_conntrack_pptp" ]; } diff --git a/nix/os/profiles/common/configuration.nix b/nix/os/profiles/common/configuration.nix index 361f538..5030ea5 100644 --- a/nix/os/profiles/common/configuration.nix +++ b/nix/os/profiles/common/configuration.nix @@ -3,11 +3,5 @@ { nixpkgs.overlays = builtins.attrValues (import ../../../overlays); - imports = [ - ./boot.nix - ./pkg.nix - ./user.nix - ./system.nix - ./hw.nix - ]; + imports = [ ./boot.nix ./pkg.nix ./user.nix ./system.nix ./hw.nix ]; } diff --git a/nix/os/profiles/common/hw.nix b/nix/os/profiles/common/hw.nix index 885663e..9e4a6a3 100644 --- a/nix/os/profiles/common/hw.nix +++ b/nix/os/profiles/common/hw.nix @@ -3,12 +3,6 @@ { hardware.trackpoint.emulateWheel = true; - boot.initrd.availableKernelModules = [ - "xhci_pci" - "ahci" - "usb_storage" - "sd_mod" - "rtsx_pci_sdmmc" - "cryptd" - ]; + boot.initrd.availableKernelModules = + [ "xhci_pci" "ahci" "usb_storage" "sd_mod" "rtsx_pci_sdmmc" "cryptd" ]; } diff --git a/nix/os/profiles/common/pkg.nix b/nix/os/profiles/common/pkg.nix index df14e0f..a6eba09 100644 --- a/nix/os/profiles/common/pkg.nix +++ b/nix/os/profiles/common/pkg.nix @@ -1,19 +1,17 @@ -{ config -, pkgs -, ... }: +{ config, pkgs, ... }: { - imports = [ - "${}/nixos" - ]; - home-manager.users.root = import ../../../home-manager/configuration/text-minimal.nix { inherit pkgs; }; + imports = [ "${}/nixos" ]; + home-manager.users.root = + import ../../../home-manager/configuration/text-minimal.nix { + inherit pkgs; + }; nixpkgs.config = { allowBroken = false; allowUnfree = true; - packageOverrides = pkgs: with pkgs; { - }; + packageOverrides = pkgs: with pkgs; { }; }; environment.systemPackages = with pkgs; [ diff --git a/nix/os/profiles/common/system.nix b/nix/os/profiles/common/system.nix index b3f81c3..35532ad 100644 --- a/nix/os/profiles/common/system.nix +++ b/nix/os/profiles/common/system.nix @@ -1,8 +1,4 @@ -{ config -, pkgs -, lib -, ... -}: +{ config, pkgs, lib, ... }: { nix.binaryCachePublicKeys = [ @@ -30,20 +26,14 @@ } ''; - environment.variables = { - NIX_PATH = lib.mkForce pkgs.nixPath; - }; + environment.variables = { NIX_PATH = lib.mkForce pkgs.nixPath; }; # Fonts, I18N, Date ... - fonts.fonts = [ - pkgs.corefonts - ]; + fonts.fonts = [ pkgs.corefonts ]; console.font = "lat9w-16"; - i18n = { - defaultLocale = "en_US.UTF-8"; - }; + i18n = { defaultLocale = "en_US.UTF-8"; }; time.timeZone = "Europe/Berlin"; services.gpm.enable = true; diff --git a/nix/os/profiles/common/user.nix b/nix/os/profiles/common/user.nix index 673bc49..180d936 100644 --- a/nix/os/profiles/common/user.nix +++ b/nix/os/profiles/common/user.nix @@ -1,6 +1,4 @@ -{ config -, pkgs -, ... }: +{ config, pkgs, ... }: let passwords = import ../../../variables/passwords.crypt.nix; @@ -9,9 +7,7 @@ in { users.mutableUsers = false; users.extraUsers.root = mkRoot { }; - users.extraUsers.steveej = mkUser { - uid = 1000; - }; + users.extraUsers.steveej = mkUser { uid = 1000; }; security.pam.u2f.enable = true; security.pam.services.steveej.u2fAuth = true; diff --git a/nix/os/profiles/containers/configuration.nix b/nix/os/profiles/containers/configuration.nix index 3424066..3c76707 100644 --- a/nix/os/profiles/containers/configuration.nix +++ b/nix/os/profiles/containers/configuration.nix @@ -4,11 +4,7 @@ nixpkgs.overlays = builtins.attrValues (import ../../../overlays); networking.useHostResolvConf = false; - services.resolved = { - enable = true; - }; + services.resolved = { enable = true; }; - imports = [ - ../../modules/ddclient-ovh.nix - ]; + imports = [ ../../modules/ddclient-ovh.nix ]; } diff --git a/nix/os/profiles/graphical/boot.nix b/nix/os/profiles/graphical/boot.nix index e4d35b0..e5d01b9 100644 --- a/nix/os/profiles/graphical/boot.nix +++ b/nix/os/profiles/graphical/boot.nix @@ -1,7 +1,3 @@ +{ lib, ... }: -{ lib -, ... -}: - -{ -} +{ } diff --git a/nix/os/profiles/graphical/configuration.nix b/nix/os/profiles/graphical/configuration.nix index 1ab66e9..82b3382 100644 --- a/nix/os/profiles/graphical/configuration.nix +++ b/nix/os/profiles/graphical/configuration.nix @@ -1,11 +1,5 @@ -{ pkgs -, ... -}: +{ pkgs, ... }: { - imports = [ - ./boot.nix - ./system.nix - ./hw.nix - ]; + imports = [ ./boot.nix ./system.nix ./hw.nix ]; } diff --git a/nix/os/profiles/graphical/hw.nix b/nix/os/profiles/graphical/hw.nix index 7cc04be..a858670 100644 --- a/nix/os/profiles/graphical/hw.nix +++ b/nix/os/profiles/graphical/hw.nix @@ -1,6 +1,4 @@ -{ -... -}: +{ ... }: { hardware.enableAllFirmware = true; diff --git a/nix/os/profiles/graphical/system.nix b/nix/os/profiles/graphical/system.nix index 5226ff4..e8365ca 100644 --- a/nix/os/profiles/graphical/system.nix +++ b/nix/os/profiles/graphical/system.nix @@ -1,6 +1,4 @@ -{ pkgs -, ... -}: +{ pkgs, ... }: { networking.networkmanager = { @@ -30,9 +28,7 @@ }; }; # required for running blueman-applet in user sessions - services.dbus.packages = with pkgs; [ - blueman - ]; + services.dbus.packages = with pkgs; [ blueman ]; services.blueman.enable = true; services.xserver = { @@ -40,7 +36,16 @@ libinput.enable = true; libinput.touchpad.naturalScrolling = true; - videoDrivers = [ "qxl" "modesetting" "ati" "cirrus" "intel" "vesa" "vmware" "modesetting" ]; + videoDrivers = [ + "qxl" + "modesetting" + "ati" + "cirrus" + "intel" + "vesa" + "vmware" + "modesetting" + ]; layout = "us"; xkbVariant = "altgr-intl"; xkbOptions = "nodeadkeys"; @@ -63,11 +68,11 @@ lightdm = { enable = true; - background = "${pkgs.nixos-artwork.wallpapers.simple-blue}/share/artwork/gnome/nix-wallpaper-simple-blue.png"; + background = + "${pkgs.nixos-artwork.wallpapers.simple-blue}/share/artwork/gnome/nix-wallpaper-simple-blue.png"; }; - sessionCommands = '' - ''; + sessionCommands = ""; }; }; @@ -97,11 +102,8 @@ }; # More Services - services.udev.packages = [ - pkgs.libu2f-host - pkgs.yubikey-personalization - pkgs.android-udev-rules - ]; + services.udev.packages = + [ pkgs.libu2f-host pkgs.yubikey-personalization pkgs.android-udev-rules ]; services.udev.extraRules = '' # OnePlusOne ATTR{idVendor}=="05c6", ATTR{idProduct}=="6764", SYMLINK+="libmtp-%k", MODE="660", GROUP="audio", ENV{ID_MTP_DEVICE}="1", ENV{ID_MEDIA_PLAYER}="1", TAG+="uaccess" @@ -116,7 +118,6 @@ SUBSYSTEM=="usb", ATTR{idVendor}=="1050", ATTR{idProduct}=="0406", ENV{ID_SECURITY_TOKEN}="1", GROUP="wheel" ''; - services.samba.enable = true; services.samba.extraConfig = '' client max protocol = SMB3 diff --git a/nix/os/profiles/install-medium/iso/iso.nix b/nix/os/profiles/install-medium/iso/iso.nix index a93f3d9..f236694 100644 --- a/nix/os/profiles/install-medium/iso/iso.nix +++ b/nix/os/profiles/install-medium/iso/iso.nix @@ -1,52 +1,63 @@ # This module defines a small NixOS installation CD. It does not # contain any graphical stuff. -{config, pkgs, lib, ...}: +{ config, pkgs, lib, ... }: -let nixos-init-script = '' - #!${pkgs.stdenv.shell} +let + nixos-init-script = '' + #!${pkgs.stdenv.shell} - export HOME=/root - export PATH=${pkgs.lib.makeBinPath [ - config.nix.package pkgs.systemd pkgs.gnugrep pkgs.gnused config.system.build.nixos-rebuild - config.system.build.nixos-install pkgs.utillinux pkgs.e2fsprogs pkgs.coreutils pkgs.hdparm - ]}:$PATH - export NIX_PATH=/nix/var/nix/profiles/per-user/root/channels/nixos:nixos-config=/etc/nixos/configuration.nix:/nix/var/nix/profiles/per-user/root/channels + export HOME=/root + export PATH=${ + pkgs.lib.makeBinPath [ + config.nix.package + pkgs.systemd + pkgs.gnugrep + pkgs.gnused + config.system.build.nixos-rebuild + config.system.build.nixos-install + pkgs.utillinux + pkgs.e2fsprogs + pkgs.coreutils + pkgs.hdparm + ] + }:$PATH + export NIX_PATH=/nix/var/nix/profiles/per-user/root/channels/nixos:nixos-config=/etc/nixos/configuration.nix:/nix/var/nix/profiles/per-user/root/channels - set -xe + set -xe - fdisk -w always -W always /dev/vda < @@ -56,15 +67,17 @@ in { # ]; - isoImage.isoName = lib.mkForce "${config.isoImage.isoBaseName}-${pkgs.stdenv.hostPlatform.system}.iso"; + isoImage.isoName = lib.mkForce + "${config.isoImage.isoBaseName}-${pkgs.stdenv.hostPlatform.system}.iso"; boot.loader.timeout = lib.mkForce 0; - boot.postBootCommands = '' - ''; + boot.postBootCommands = ""; - environment.systemPackages = []; + environment.systemPackages = [ ]; users.users.root = { - openssh.authorizedKeys.keys = [ "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC4RFtHz0sE5y0AyZZm/tH7bBBgsx55gLPt5tGsl9yZlOzih6n4qbJE/9OOdwnOY2AHRe2lrlTekbW5ewWSBBCbiBE3Vux86sLgy7LM9zoKaNC+E3hmxaoS9SExn0BTkb3kNlOcj2k6UyJhkZWEsqVMV5C21R8EWmMlLY/qm3AxptNjOyzKDwNX2zlHZ5IyjgzO4ZjIxjawmJlUrVEn7/m+M7qK3I1Tyg/ZvDSfmxVJS97sVzseYE0rVwLEWJQOnHh0wnfl27smr2McAB7Cy6sxKyPKvEGyXbNqqb8fqk4okZlRRxhq/XkKlC7IZr+uqYxlL4HN8vjkTRNlgenDUSVT cardno:000604870382" ]; + openssh.authorizedKeys.keys = [ + "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC4RFtHz0sE5y0AyZZm/tH7bBBgsx55gLPt5tGsl9yZlOzih6n4qbJE/9OOdwnOY2AHRe2lrlTekbW5ewWSBBCbiBE3Vux86sLgy7LM9zoKaNC+E3hmxaoS9SExn0BTkb3kNlOcj2k6UyJhkZWEsqVMV5C21R8EWmMlLY/qm3AxptNjOyzKDwNX2zlHZ5IyjgzO4ZjIxjawmJlUrVEn7/m+M7qK3I1Tyg/ZvDSfmxVJS97sVzseYE0rVwLEWJQOnHh0wnfl27smr2McAB7Cy6sxKyPKvEGyXbNqqb8fqk4okZlRRxhq/XkKlC7IZr+uqYxlL4HN8vjkTRNlgenDUSVT cardno:000604870382" + ]; }; services.gpm.enable = true; @@ -74,13 +87,14 @@ in { script = nixos-init-script; path = with pkgs; [ ]; - description = "Initialize /dev/vda from configuration.nix found at /dev/vdb"; + description = + "Initialize /dev/vda from configuration.nix found at /dev/vdb"; enable = true; wantedBy = [ "multi-user.target" ]; after = [ "multi-user.target" ]; requires = [ "network-online.target" ]; - + restartIfChanged = false; unitConfig.X-StopOnRemoval = false; diff --git a/nix/os/profiles/podman/configuration.nix b/nix/os/profiles/podman/configuration.nix index d15563e..bb0508b 100644 --- a/nix/os/profiles/podman/configuration.nix +++ b/nix/os/profiles/podman/configuration.nix @@ -47,10 +47,10 @@ ''; environment.etc."cni/net.d/00-loopback.conf".text = '' - { - "cniVersion": "0.3.0", - "type": "loopback" - } + { + "cniVersion": "0.3.0", + "type": "loopback" + } ''; environment.etc."cni/net.d/87-podman-bridge.conflist".text = '' @@ -176,5 +176,5 @@ runc = [ "${pkgs.runc}/bin/runc" ] -''; + ''; } diff --git a/nix/os/profiles/removable-medium/boot.nix b/nix/os/profiles/removable-medium/boot.nix index b3939cb..2796760 100644 --- a/nix/os/profiles/removable-medium/boot.nix +++ b/nix/os/profiles/removable-medium/boot.nix @@ -1,9 +1,7 @@ -{ lib -, ... -}: +{ lib, ... }: { boot.loader.grub.efiInstallAsRemovable = lib.mkForce true; - boot.loader.efi.canTouchEfiVariables = lib.mkForce false; + boot.loader.efi.canTouchEfiVariables = lib.mkForce false; boot.extraModulePackages = [ ]; } diff --git a/nix/os/profiles/removable-medium/configuration.nix b/nix/os/profiles/removable-medium/configuration.nix index 77d7eb5..4d4720f 100644 --- a/nix/os/profiles/removable-medium/configuration.nix +++ b/nix/os/profiles/removable-medium/configuration.nix @@ -1,7 +1,7 @@ { ... }: { - imports = [ + imports = [ ../../modules/opinionatedDisk.nix ./pkg.nix diff --git a/nix/os/profiles/removable-medium/pkg.nix b/nix/os/profiles/removable-medium/pkg.nix index 7b9ee0e..4fc2a08 100644 --- a/nix/os/profiles/removable-medium/pkg.nix +++ b/nix/os/profiles/removable-medium/pkg.nix @@ -1,7 +1,8 @@ -{ pkgs -, ... -}: +{ pkgs, ... }: { - home-manager.users.steveej = import ../../../home-manager/configuration/graphical-removable.nix { inherit pkgs; }; + home-manager.users.steveej = + import ../../../home-manager/configuration/graphical-removable.nix { + inherit pkgs; + }; } diff --git a/nix/os/profiles/removable-medium/system.nix b/nix/os/profiles/removable-medium/system.nix index fccfc9e..5753942 100644 --- a/nix/os/profiles/removable-medium/system.nix +++ b/nix/os/profiles/removable-medium/system.nix @@ -1,12 +1,9 @@ { config, lib, pkgs, ... }: - let in { - services.printing = { - enable = false; - }; + services.printing = { enable = false; }; services.spice-vdagentd.enable = true; services.qemuGuest.enable = true; diff --git a/nix/overlays/overrides.nix b/nix/overlays/overrides.nix index 7bf5dcb..7352956 100644 --- a/nix/overlays/overrides.nix +++ b/nix/overlays/overrides.nix @@ -6,8 +6,10 @@ let sources = import ../../nix/sources.nix; nixpkgs-master = import { inherit (super) config; }; - nixpkgs-unstable = import { inherit (super) config; }; - pr-holochain-launcher-bin = import sources.pr-holochain-launcher-bin { inherit (super) config; }; + nixpkgs-unstable = + import { inherit (super) config; }; + pr-holochain-launcher-bin = + import sources.pr-holochain-launcher-bin { inherit (super) config; }; in { inherit nixpkgs-master; @@ -24,12 +26,14 @@ in { ''; }; - qtile = super.qtile.overrideAttrs(oldAttrs: { - propagatedBuildInputs = oldAttrs.passthru.unwrapped.propagatedBuildInputs ++ (with self.python3Packages; [ - # python-wifi - # iwlib - keyring - ]); + qtile = super.qtile.overrideAttrs (oldAttrs: { + propagatedBuildInputs = oldAttrs.passthru.unwrapped.propagatedBuildInputs + ++ (with self.python3Packages; + [ + # python-wifi + # iwlib + keyring + ]); }); inherit (pr-holochain-launcher-bin) holochain-launcher; diff --git a/nix/overlays/pkgs.nix b/nix/overlays/pkgs.nix index b6b57ef..fcabcd3 100644 --- a/nix/overlays/pkgs.nix +++ b/nix/overlays/pkgs.nix @@ -1,4 +1,4 @@ -# This overlay includes all packages defined by the top-level default.nix. +# This overlay includes all packages defined by the top-level default.nix. # The code is copied from the NUR repository [0]. # # [0]: https://github.com/nix-community/nur-packages-template/blob/2610a5b60bd926cea3e6395511da8f0d14c613b9/overlay.nix @@ -8,11 +8,11 @@ self: super: let isReserved = n: n == "lib" || n == "overlays" || n == "modules"; - nameValuePair = n: v: { name = n; value = v; }; + nameValuePair = n: v: { + name = n; + value = v; + }; nurAttrs = import ../pkgs { pkgs = super; }; -in - builtins.listToAttrs - (map (n: nameValuePair n nurAttrs.${n}) - (builtins.filter (n: !isReserved n) - (builtins.attrNames nurAttrs))) +in builtins.listToAttrs (map (n: nameValuePair n nurAttrs.${n}) + (builtins.filter (n: !isReserved n) (builtins.attrNames nurAttrs))) diff --git a/nix/overlays/posh.nix b/nix/overlays/posh.nix index fb61e45..d101303 100644 --- a/nix/overlays/posh.nix +++ b/nix/overlays/posh.nix @@ -1,7 +1,7 @@ self: super: let - nixpkgs-master = import {}; + nixpkgs-master = import { }; inherit (nixpkgs-master) crun; crun_10_6_0 = crun.overrideAttrs (oldAttrs: rec { @@ -15,5 +15,5 @@ let in { inherit (nixpkgs-master) podman conmon slirp4netns; - posh = self.callPackage ../pkgs/posh.nix {}; + posh = self.callPackage ../pkgs/posh.nix { }; } diff --git a/nix/pkgs/browserpass/default.nix b/nix/pkgs/browserpass/default.nix index a1d1d6e..56cc257 100644 --- a/nix/pkgs/browserpass/default.nix +++ b/nix/pkgs/browserpass/default.nix @@ -1,28 +1,29 @@ -with import {}; +with import { }; stdenv.mkDerivation rec { - broken = true; + broken = true; - name = "browserpass"; - version = "2.0.9"; + name = "browserpass"; + version = "2.0.9"; - src = fetchzip { - url = "https://github.com/dannyvankooten/browserpass/releases/download/${version}/${name}-linux64.zip"; - sha256 = "1nygcfjhyrcvbdmz4hjphcnmr4lm9y24lpdkdcjix6vbsjs0hipw"; - stripRoot = false; - }; + src = fetchzip { + url = + "https://github.com/dannyvankooten/browserpass/releases/download/${version}/${name}-linux64.zip"; + sha256 = "1nygcfjhyrcvbdmz4hjphcnmr4lm9y24lpdkdcjix6vbsjs0hipw"; + stripRoot = false; + }; - buildPhase = '':''; + buildPhase = ":"; - libPath = lib.makeLibraryPath [ ]; - installPhase = '' - set -x - patchelf --set-interpreter ${glibc}/lib/ld-linux-x86-64.so.2 browserpass-linux64 + libPath = lib.makeLibraryPath [ ]; + installPhase = '' + set -x + patchelf --set-interpreter ${glibc}/lib/ld-linux-x86-64.so.2 browserpass-linux64 - mkdir -p $out/bin - cp -a * $out/bin/ -# wrapProgram $out/bin/browserpass-linux64 \ -# --prefix LD_LIBRARY_PATH : "${libPath}" -# - ''; + mkdir -p $out/bin + cp -a * $out/bin/ + # wrapProgram $out/bin/browserpass-linux64 \ + # --prefix LD_LIBRARY_PATH : "${libPath}" + # + ''; } diff --git a/nix/pkgs/default.nix b/nix/pkgs/default.nix index 8301488..2ab8ee7 100644 --- a/nix/pkgs/default.nix +++ b/nix/pkgs/default.nix @@ -2,43 +2,41 @@ let in rec { - nixpkgs-master = import {}; + nixpkgs-master = import { }; linuxPackages_sgx_540rc3 = let - linux_sgx_pkg = { fetchurl, buildLinux, ... } @ args: + linux_sgx_pkg = { fetchurl, buildLinux, ... }@args: - buildLinux (args // rec { - version = "5.4.0-rc3"; - modDirVersion = version; + buildLinux (args // rec { + version = "5.4.0-rc3"; + modDirVersion = version; - src = fetchurl { - url = "https://github.com/jsakkine-intel/linux-sgx/archive/v23.tar.gz"; - sha256 = "11rwlwv7s071ia889dk1dgrxprxiwgi7djhg47vi56dj81jgib20"; - }; - kernelPatches = []; + src = fetchurl { + url = + "https://github.com/jsakkine-intel/linux-sgx/archive/v23.tar.gz"; + sha256 = "11rwlwv7s071ia889dk1dgrxprxiwgi7djhg47vi56dj81jgib20"; + }; + kernelPatches = [ ]; - extraConfig = '' - INTEL_SGX y - ''; + extraConfig = '' + INTEL_SGX y + ''; - extraMeta.branch = "5.4"; - } // (args.argsOverride or {})); - linux_sgx = pkgs.callPackage linux_sgx_pkg {}; - in - pkgs.recurseIntoAttrs (pkgs.linuxPackagesFor linux_sgx); + extraMeta.branch = "5.4"; + } // (args.argsOverride or { })); + linux_sgx = pkgs.callPackage linux_sgx_pkg { }; + in pkgs.recurseIntoAttrs (pkgs.linuxPackagesFor linux_sgx); linuxPackages_sgx_latest = linuxPackages_sgx_540rc3; - busyboxStatic = pkgs.busybox.override { + busyboxStatic = pkgs.busybox.override { enableStatic = true; extraConfig = '' - CONFIG_STATIC y - CONFIG_INSTALL_APPLET_DONT y - CONFIG_INSTALL_APPLET_SYMLINKS n - ''; - }; - dropbearStatic = pkgs.dropbear.override { - enableStatic = true; + CONFIG_STATIC y + CONFIG_INSTALL_APPLET_DONT y + CONFIG_INSTALL_APPLET_SYMLINKS n + ''; }; + dropbearStatic = pkgs.dropbear.override { enableStatic = true; }; php5 = let nixpkgsWithPhp5 = pkgs.fetchFromGitHub { @@ -47,10 +45,9 @@ in rec { rev = "846d8f8305192dcc3a63139102698b4ac6b9ef9f"; sha256 = "1qifgc1q2i4g0ivpfjnxp4jl2cc82gfjws08dsllgw7q7kw4b4rb"; }; - php5 = (pkgs.callPackage "${nixpkgsWithPhp5}/pkgs/development/interpreters/php/default.nix" { - config = (pkgs.lib.attrsets.recursiveUpdate - pkgs.config - { + php5 = (pkgs.callPackage + "${nixpkgsWithPhp5}/pkgs/development/interpreters/php/default.nix" { + config = (pkgs.lib.attrsets.recursiveUpdate pkgs.config { php = { imap = false; openssl = false; @@ -58,58 +55,57 @@ in rec { ldap = false; mcrypt = false; }; - } - ); - stdenv = pkgs.llvmPackages_6.stdenv; #broken - icu = pkgs.icu60; - }).php56; - in - php5 - .overrideAttrs(attrs: rec { - # See https://secure.php.net/ChangeLog-5.php - version = "5.6.40"; - name = "php-${version}"; + }); + stdenv = pkgs.llvmPackages_6.stdenv; # broken + icu = pkgs.icu60; + }).php56; + in php5.overrideAttrs (attrs: rec { + # See https://secure.php.net/ChangeLog-5.php + version = "5.6.40"; + name = "php-${version}"; - sha256 = "005s7w167dypl41wlrf51niryvwy1hfv53zxyyr3lm938v9jbl7z"; - src = pkgs.fetchurl { - url = "http://www.php.net/distributions/php-${version}.tar.bz2"; - inherit sha256; - }; + sha256 = "005s7w167dypl41wlrf51niryvwy1hfv53zxyyr3lm938v9jbl7z"; + src = pkgs.fetchurl { + url = "http://www.php.net/distributions/php-${version}.tar.bz2"; + inherit sha256; + }; - configureFlags = attrs.configureFlags ++ [ - "--without-fpm-systemd" - ]; + configureFlags = attrs.configureFlags ++ [ "--without-fpm-systemd" ]; - meta.license = null; - }); + meta.license = null; + }); - duplicacy = pkgs.callPackage ../pkgs/duplicacy {}; - mfcl3770cdw = pkgs.callPackage ../pkgs/mfcl3770cdw.nix {}; - staruml = pkgs.callPackage ../pkgs/staruml.nix { inherit (pkgs.gnome2) GConf; libgcrypt = pkgs.libgcrypt_1_5; }; + duplicacy = pkgs.callPackage ../pkgs/duplicacy { }; + mfcl3770cdw = pkgs.callPackage ../pkgs/mfcl3770cdw.nix { }; + staruml = pkgs.callPackage ../pkgs/staruml.nix { + inherit (pkgs.gnome2) GConf; + libgcrypt = pkgs.libgcrypt_1_5; + }; pythonPackages = myPython; - myPython = pkgs.python310.withPackages (ps: with ps; [ - pep8 yapf flake8 - # autopep8 (broken) - # pylint (broken) - ipython - llfuse - dugong - defusedxml - wheel - pip - virtualenv - cffi - pyopenssl - urllib3 - # mistune (insecure) - sympy + myPython = pkgs.python310.withPackages (ps: + with ps; + [ + pep8 + yapf + flake8 + # autopep8 (broken) + # pylint (broken) + ipython + llfuse + dugong + defusedxml + wheel + pip + virtualenv + cffi + pyopenssl + urllib3 + # mistune (insecure) + sympy - flask + flask - pyaml - ] ++ [ - pkgs.pypi2nix - pkgs.libffi - ]); + pyaml + ] ++ [ pkgs.pypi2nix pkgs.libffi ]); } diff --git a/nix/pkgs/duplicacy/default.nix b/nix/pkgs/duplicacy/default.nix index 9aed9df..07d50e7 100644 --- a/nix/pkgs/duplicacy/default.nix +++ b/nix/pkgs/duplicacy/default.nix @@ -1,6 +1,4 @@ -{ buildGoPackage -, fetchFromGitHub -}: +{ buildGoPackage, fetchFromGitHub }: buildGoPackage rec { name = "duplicay-${version}"; diff --git a/nix/pkgs/duplicacy/deps.nix b/nix/pkgs/duplicacy/deps.nix index 5511b2e..8621cb1 100644 --- a/nix/pkgs/duplicacy/deps.nix +++ b/nix/pkgs/duplicacy/deps.nix @@ -1,336 +1,336 @@ # file generated from Gopkg.lock using dep2nix (https://github.com/nixcloud/dep2nix) [ { - goPackagePath = "cloud.google.com/go"; + goPackagePath = "cloud.google.com/go"; fetch = { type = "git"; url = "https://code.googlesource.com/gocloud"; - rev = "2d3a6656c17a60b0815b7e06ab0be04eacb6e613"; + rev = "2d3a6656c17a60b0815b7e06ab0be04eacb6e613"; sha256 = "0fi3qj9fvc4bxbrwa1m5sxsb8yhvawiwigaddvmmizjykxbq5csq"; }; } { - goPackagePath = "github.com/Azure/azure-sdk-for-go"; + goPackagePath = "github.com/Azure/azure-sdk-for-go"; fetch = { type = "git"; url = "https://github.com/Azure/azure-sdk-for-go"; - rev = "b7fadebe0e7f5c5720986080a01495bd8d27be37"; + rev = "b7fadebe0e7f5c5720986080a01495bd8d27be37"; sha256 = "11zcmd17206byxhgz2a75qascilydlzjbz73l2mrqng3yyr20yk1"; }; } { - goPackagePath = "github.com/Azure/go-autorest"; + goPackagePath = "github.com/Azure/go-autorest"; fetch = { type = "git"; url = "https://github.com/Azure/go-autorest"; - rev = "0ae36a9e544696de46fdadb7b0d5fb38af48c063"; + rev = "0ae36a9e544696de46fdadb7b0d5fb38af48c063"; sha256 = "0f2qcv24l9bx3jys2m9ycyy77vqlx7dbfa3frxlk19wnrwiv3p6g"; }; } { - goPackagePath = "github.com/aryann/difflib"; + goPackagePath = "github.com/aryann/difflib"; fetch = { type = "git"; url = "https://github.com/aryann/difflib"; - rev = "e206f873d14a916d3d26c40ab667bca123f365a3"; + rev = "e206f873d14a916d3d26c40ab667bca123f365a3"; sha256 = "00zb9sx6l6b2zq614x45zlyshl20zjhwfj8r5krw4f9y0mx3n2dm"; }; } { - goPackagePath = "github.com/aws/aws-sdk-go"; + goPackagePath = "github.com/aws/aws-sdk-go"; fetch = { type = "git"; url = "https://github.com/aws/aws-sdk-go"; - rev = "a32b1dcd091264b5dee7b386149b6cc3823395c9"; + rev = "a32b1dcd091264b5dee7b386149b6cc3823395c9"; sha256 = "1yicb7l6m4hs3mi724hz74wn8305qvx6g73mjqafaaqvh6dyn86m"; }; } { - goPackagePath = "github.com/bkaradzic/go-lz4"; + goPackagePath = "github.com/bkaradzic/go-lz4"; fetch = { type = "git"; url = "https://github.com/bkaradzic/go-lz4"; - rev = "74ddf82598bc4745b965729e9c6a463bedd33049"; + rev = "74ddf82598bc4745b965729e9c6a463bedd33049"; sha256 = "1vdid8v0c2v2qhrg9rzn3l7ya1h34jirrxfnir7gv7w6s4ivdvc1"; }; } { - goPackagePath = "github.com/dgrijalva/jwt-go"; + goPackagePath = "github.com/dgrijalva/jwt-go"; fetch = { type = "git"; url = "https://github.com/dgrijalva/jwt-go"; - rev = "dbeaa9332f19a944acb5736b4456cfcc02140e29"; + rev = "dbeaa9332f19a944acb5736b4456cfcc02140e29"; sha256 = "0zk6l6kzsjdijfn7c4h0aywdjx5j2hjwi67vy1k6wr46hc8ks2hs"; }; } { - goPackagePath = "github.com/gilbertchen/azure-sdk-for-go"; + goPackagePath = "github.com/gilbertchen/azure-sdk-for-go"; fetch = { type = "git"; url = "https://github.com/gilbertchen/azure-sdk-for-go"; - rev = "bbf89bd4d716c184f158d1e1428c2dbef4a18307"; + rev = "bbf89bd4d716c184f158d1e1428c2dbef4a18307"; sha256 = "14563izc2y05k8s20fmhanvjydbcq8k5adp4cgw91d9bs52qivx7"; }; } { - goPackagePath = "github.com/gilbertchen/cli"; + goPackagePath = "github.com/gilbertchen/cli"; fetch = { type = "git"; url = "https://github.com/gilbertchen/cli"; - rev = "1de0a1836ce9c3ae1bf737a0869c4f04f28a7f98"; + rev = "1de0a1836ce9c3ae1bf737a0869c4f04f28a7f98"; sha256 = "00vbyjsn009cqg24sxcizq10rgicnmrv0f8jg3fa1fw6yp5gqdl5"; }; } { - goPackagePath = "github.com/gilbertchen/go-dropbox"; + goPackagePath = "github.com/gilbertchen/go-dropbox"; fetch = { type = "git"; url = "https://github.com/gilbertchen/go-dropbox"; - rev = "90711b603312b1f973f3a5da3793ac4f1e5c2f2a"; + rev = "90711b603312b1f973f3a5da3793ac4f1e5c2f2a"; sha256 = "0y2ydl3mjbkfbqyygrwq7vqig9hjh7cxvzsn2gxc1851haqp4h19"; }; } { - goPackagePath = "github.com/gilbertchen/go-ole"; + goPackagePath = "github.com/gilbertchen/go-ole"; fetch = { type = "git"; url = "https://github.com/gilbertchen/go-ole"; - rev = "0e87ea779d9deb219633b828a023b32e1244dd57"; + rev = "0e87ea779d9deb219633b828a023b32e1244dd57"; sha256 = "1d937b4i9mrwfgs1s17qhbd78dcd97wwm8zsajkarky8d55rz1bw"; }; } { - goPackagePath = "github.com/gilbertchen/go.dbus"; + goPackagePath = "github.com/gilbertchen/go.dbus"; fetch = { type = "git"; url = "https://github.com/gilbertchen/go.dbus"; - rev = "9e442e6378618c083fd3b85b703ffd202721fb17"; + rev = "9e442e6378618c083fd3b85b703ffd202721fb17"; sha256 = "0q8ld38gnr4adzw5287lw5f5l14yp8slxsz1za5ryrkprh04bhkv"; }; } { - goPackagePath = "github.com/gilbertchen/goamz"; + goPackagePath = "github.com/gilbertchen/goamz"; fetch = { type = "git"; url = "https://github.com/gilbertchen/goamz"; - rev = "eada9f4e8cc2a45db775dee08a2c37597ce4760a"; + rev = "eada9f4e8cc2a45db775dee08a2c37597ce4760a"; sha256 = "0v6i4jdly06wixmm58ygxh284hnlbfxczvcwxvywiyy9bp5qyaid"; }; } { - goPackagePath = "github.com/gilbertchen/gopass"; + goPackagePath = "github.com/gilbertchen/gopass"; fetch = { type = "git"; url = "https://github.com/gilbertchen/gopass"; - rev = "bf9dde6d0d2c004a008c27aaee91170c786f6db8"; + rev = "bf9dde6d0d2c004a008c27aaee91170c786f6db8"; sha256 = "1jxzyfnqi0h1fzlsvlkn10bncic803bfhslyijcxk55mgh297g45"; }; } { - goPackagePath = "github.com/gilbertchen/keyring"; + goPackagePath = "github.com/gilbertchen/keyring"; fetch = { type = "git"; url = "https://github.com/gilbertchen/keyring"; - rev = "8855f5632086e51468cd7ce91056f8da69687ef6"; + rev = "8855f5632086e51468cd7ce91056f8da69687ef6"; sha256 = "1ja623dqnhkr1cvynrcai10s8kn2aiq53cvd8yxr47bb8i2a2q1m"; }; } { - goPackagePath = "github.com/gilbertchen/xattr"; + goPackagePath = "github.com/gilbertchen/xattr"; fetch = { type = "git"; url = "https://github.com/gilbertchen/xattr"; - rev = "68e7a6806b0137a396d7d05601d7403ae1abac58"; + rev = "68e7a6806b0137a396d7d05601d7403ae1abac58"; sha256 = "120lq8vasc5yh0ajczsdpi8cfzgi4ymrnphgqdfcar3b9rsvx80b"; }; } { - goPackagePath = "github.com/go-ini/ini"; + goPackagePath = "github.com/go-ini/ini"; fetch = { type = "git"; url = "https://github.com/go-ini/ini"; - rev = "32e4c1e6bc4e7d0d8451aa6b75200d19e37a536a"; + rev = "32e4c1e6bc4e7d0d8451aa6b75200d19e37a536a"; sha256 = "0mhgxw5q6b0pryhikx3k4wby7g32rwjjljzihi47lwn34kw5y1qn"; }; } { - goPackagePath = "github.com/golang/protobuf"; + goPackagePath = "github.com/golang/protobuf"; fetch = { type = "git"; url = "https://github.com/golang/protobuf"; - rev = "1e59b77b52bf8e4b449a57e6f79f21226d571845"; + rev = "1e59b77b52bf8e4b449a57e6f79f21226d571845"; sha256 = "19bkh81wnp6njg3931wky6hsnnl2d1ig20vfjxpv450sd3k6yys8"; }; } { - goPackagePath = "github.com/googleapis/gax-go"; + goPackagePath = "github.com/googleapis/gax-go"; fetch = { type = "git"; url = "https://github.com/googleapis/gax-go"; - rev = "317e0006254c44a0ac427cc52a0e083ff0b9622f"; + rev = "317e0006254c44a0ac427cc52a0e083ff0b9622f"; sha256 = "0h92x579vbrv2fka8q2ddy1kq6a63qbqa8zc09ygl6skzn9gw1dh"; }; } { - goPackagePath = "github.com/jmespath/go-jmespath"; + goPackagePath = "github.com/jmespath/go-jmespath"; fetch = { type = "git"; url = "https://github.com/jmespath/go-jmespath"; - rev = "0b12d6b5"; + rev = "0b12d6b5"; sha256 = "1vv6hph8j6xgv7gwl9vvhlsaaqsm22sxxqmgmldi4v11783pc1ld"; }; } { - goPackagePath = "github.com/kr/fs"; + goPackagePath = "github.com/kr/fs"; fetch = { type = "git"; url = "https://github.com/kr/fs"; - rev = "2788f0dbd16903de03cb8186e5c7d97b69ad387b"; + rev = "2788f0dbd16903de03cb8186e5c7d97b69ad387b"; sha256 = "1c0fipl4rsh0v5liq1ska1dl83v3llab4k6lm8mvrx9c4dyp71ly"; }; } { - goPackagePath = "github.com/marstr/guid"; + goPackagePath = "github.com/marstr/guid"; fetch = { type = "git"; url = "https://github.com/marstr/guid"; - rev = "8bd9a64bf37eb297b492a4101fb28e80ac0b290f"; + rev = "8bd9a64bf37eb297b492a4101fb28e80ac0b290f"; sha256 = "081qrar6wwpmb2pq3swv4byh73r9riyhl2dwv0902d8jg3kwricm"; }; } { - goPackagePath = "github.com/minio/blake2b-simd"; + goPackagePath = "github.com/minio/blake2b-simd"; fetch = { type = "git"; url = "https://github.com/minio/blake2b-simd"; - rev = "3f5f724cb5b182a5c278d6d3d55b40e7f8c2efb4"; + rev = "3f5f724cb5b182a5c278d6d3d55b40e7f8c2efb4"; sha256 = "0b6jbnj62c0gmmfd4zdmh8xbg01p80f13yygir9xprqkzk6fikmd"; }; } { - goPackagePath = "github.com/ncw/swift"; + goPackagePath = "github.com/ncw/swift"; fetch = { type = "git"; url = "https://github.com/ncw/swift"; - rev = "ae9f0ea1605b9aa6434ed5c731ca35d83ba67c55"; + rev = "ae9f0ea1605b9aa6434ed5c731ca35d83ba67c55"; sha256 = "0a0iwynhgxsl3czabl7ajnxpyw6x0dzbiqz6il8aw7kn10ld1rvl"; }; } { - goPackagePath = "github.com/pkg/errors"; + goPackagePath = "github.com/pkg/errors"; fetch = { type = "git"; url = "https://github.com/pkg/errors"; - rev = "645ef00459ed84a119197bfb8d8205042c6df63d"; + rev = "645ef00459ed84a119197bfb8d8205042c6df63d"; sha256 = "001i6n71ghp2l6kdl3qq1v2vmghcz3kicv9a5wgcihrzigm75pp5"; }; } { - goPackagePath = "github.com/pkg/sftp"; + goPackagePath = "github.com/pkg/sftp"; fetch = { type = "git"; url = "https://github.com/pkg/sftp"; - rev = "98203f5a8333288eb3163b7c667d4260fe1333e9"; + rev = "98203f5a8333288eb3163b7c667d4260fe1333e9"; sha256 = "09wxyrhwwh20rzpzb06vsj8k2bmw52cjlx7j4115zhky27528sx9"; }; } { - goPackagePath = "github.com/satori/go.uuid"; + goPackagePath = "github.com/satori/go.uuid"; fetch = { type = "git"; url = "https://github.com/satori/go.uuid"; - rev = "f58768cc1a7a7e77a3bd49e98cdd21419399b6a3"; + rev = "f58768cc1a7a7e77a3bd49e98cdd21419399b6a3"; sha256 = "1j4s5pfg2ldm35y8ls8jah4dya2grfnx2drb4jcbjsyrp4cm5yfb"; }; } { - goPackagePath = "github.com/vaughan0/go-ini"; + goPackagePath = "github.com/vaughan0/go-ini"; fetch = { type = "git"; url = "https://github.com/vaughan0/go-ini"; - rev = "a98ad7ee00ec53921f08832bc06ecf7fd600e6a1"; + rev = "a98ad7ee00ec53921f08832bc06ecf7fd600e6a1"; sha256 = "1l1isi3czis009d9k5awsj4xdxgbxn4n9yqjc1ac7f724x6jacfa"; }; } { - goPackagePath = "golang.org/x/crypto"; + goPackagePath = "golang.org/x/crypto"; fetch = { type = "git"; url = "https://go.googlesource.com/crypto"; - rev = "9f005a07e0d31d45e6656d241bb5c0f2efd4bc94"; + rev = "9f005a07e0d31d45e6656d241bb5c0f2efd4bc94"; sha256 = "1mhmr6ljzl3iafsz4qy8vval7rmr828wh59dlqqqjqx6sqmcs1dv"; }; } { - goPackagePath = "golang.org/x/net"; + goPackagePath = "golang.org/x/net"; fetch = { type = "git"; url = "https://go.googlesource.com/net"; - rev = "9dfe39835686865bff950a07b394c12a98ddc811"; + rev = "9dfe39835686865bff950a07b394c12a98ddc811"; sha256 = "0z8mnl4mi88syafrgqys2ak2gg3yrbna25hpz88y3anl8x4jhg1a"; }; } { - goPackagePath = "golang.org/x/oauth2"; + goPackagePath = "golang.org/x/oauth2"; fetch = { type = "git"; url = "https://go.googlesource.com/oauth2"; - rev = "f95fa95eaa936d9d87489b15d1d18b97c1ba9c28"; + rev = "f95fa95eaa936d9d87489b15d1d18b97c1ba9c28"; sha256 = "0p9kis69wvhv8a2qbcjxvn9ggpdh81cbfjpq5pjga7n8k6d065fh"; }; } { - goPackagePath = "golang.org/x/sys"; + goPackagePath = "golang.org/x/sys"; fetch = { type = "git"; url = "https://go.googlesource.com/sys"; - rev = "82aafbf43bf885069dc71b7e7c2f9d7a614d47da"; + rev = "82aafbf43bf885069dc71b7e7c2f9d7a614d47da"; sha256 = "1jvngpvy0q40f7krkgmwf5bbjzhv449297awcr0y78kzn0cyawi2"; }; } { - goPackagePath = "golang.org/x/text"; + goPackagePath = "golang.org/x/text"; fetch = { type = "git"; url = "https://go.googlesource.com/text"; - rev = "88f656faf3f37f690df1a32515b479415e1a6769"; + rev = "88f656faf3f37f690df1a32515b479415e1a6769"; sha256 = "0zakmgg6dlwnkhignwjajn0dckzqq18zxvnmmg0fq6455x7fs673"; }; } { - goPackagePath = "google.golang.org/api"; + goPackagePath = "google.golang.org/api"; fetch = { type = "git"; url = "https://code.googlesource.com/google-api-go-client"; - rev = "17b5f22a248d6d3913171c1a557552ace0d9c806"; + rev = "17b5f22a248d6d3913171c1a557552ace0d9c806"; sha256 = "0gs78qsxfg89kpiiray1x9jiv6bh328jmjkwd3ghnygf3l98kc8c"; }; } { - goPackagePath = "google.golang.org/appengine"; + goPackagePath = "google.golang.org/appengine"; fetch = { type = "git"; url = "https://github.com/golang/appengine"; - rev = "150dc57a1b433e64154302bdc40b6bb8aefa313a"; + rev = "150dc57a1b433e64154302bdc40b6bb8aefa313a"; sha256 = "0w3knznv39k8bm85ri62f83czcrxknql7dv6p9hk1a5jx3xljgxq"; }; } { - goPackagePath = "google.golang.org/genproto"; + goPackagePath = "google.golang.org/genproto"; fetch = { type = "git"; url = "https://github.com/google/go-genproto"; - rev = "891aceb7c239e72692819142dfca057bdcbfcb96"; + rev = "891aceb7c239e72692819142dfca057bdcbfcb96"; sha256 = "1axim84fqzsp6iialk6zl4fsbfpx658vssc6ccakn4yy1xc9h854"; }; } { - goPackagePath = "google.golang.org/grpc"; + goPackagePath = "google.golang.org/grpc"; fetch = { type = "git"; url = "https://github.com/grpc/grpc-go"; - rev = "5a9f7b402fe85096d2e1d0383435ee1876e863d0"; + rev = "5a9f7b402fe85096d2e1d0383435ee1876e863d0"; sha256 = "1hlirgvmzb929jpb1dvh930646ih5ffg3b6pmlilqr7ffdkl5z3j"; }; } -] \ No newline at end of file +] diff --git a/nix/pkgs/duplicacy/shell.nix b/nix/pkgs/duplicacy/shell.nix index 72c40b1..045572c 100644 --- a/nix/pkgs/duplicacy/shell.nix +++ b/nix/pkgs/duplicacy/shell.nix @@ -1,4 +1,4 @@ -with import {}; +with import { }; stdenv.mkDerivation { name = "env"; buildInputs = [ @@ -7,6 +7,6 @@ stdenv.mkDerivation { go2nix dep2nix nix-prefetch-github - (callPackage ./default.nix {}) + (callPackage ./default.nix { }) ]; } diff --git a/nix/pkgs/mfcl3770cdw.nix b/nix/pkgs/mfcl3770cdw.nix index f41a2b8..79919a5 100644 --- a/nix/pkgs/mfcl3770cdw.nix +++ b/nix/pkgs/mfcl3770cdw.nix @@ -1,27 +1,17 @@ -{ pkgsi686Linux -, stdenv -, fetchurl -, dpkg -, makeWrapper -, coreutils -, ghostscript -, gnugrep -, gnused -, which -, perl -, lib -}: +{ pkgsi686Linux, stdenv, fetchurl, dpkg, makeWrapper, coreutils, ghostscript +, gnugrep, gnused, which, perl, lib }: -let +let model = "mfcl3770cdw"; version = "1.0.2-0"; src = fetchurl { - url = "https://download.brother.com/welcome/dlf103935/${model}pdrv-${version}.i386.deb"; + url = + "https://download.brother.com/welcome/dlf103935/${model}pdrv-${version}.i386.deb"; sha256 = "09fhbzhpjymhkwxqyxzv24b06ybmajr6872yp7pri39595mhrvay"; }; reldir = "opt/brother/Printers/${model}/"; -in rec { +in rec { driver = stdenv.mkDerivation rec { inherit src version; name = "${model}drv-${version}"; @@ -31,23 +21,23 @@ in rec { unpackPhase = "dpkg-deb -x $src $out"; installPhase = '' - dir="$out/${reldir}" - substituteInPlace $dir/lpd/filter_${model} \ - --replace /usr/bin/perl ${perl}/bin/perl \ - --replace "BR_PRT_PATH =~" "BR_PRT_PATH = \"$dir\"; #" \ - --replace "PRINTER =~" "PRINTER = \"${model}\"; #" - wrapProgram $dir/lpd/filter_${model} \ - --prefix PATH : ${lib.makeBinPath [ - coreutils ghostscript gnugrep gnused which - ]} - # need to use i686 glibc here, these are 32bit proprietary binaries - interpreter=${pkgsi686Linux.glibc}/lib/ld-linux.so.2 - patchelf --set-interpreter "$interpreter" $dir/lpd/brmfcl3770cdwfilter + dir="$out/${reldir}" + substituteInPlace $dir/lpd/filter_${model} \ + --replace /usr/bin/perl ${perl}/bin/perl \ + --replace "BR_PRT_PATH =~" "BR_PRT_PATH = \"$dir\"; #" \ + --replace "PRINTER =~" "PRINTER = \"${model}\"; #" + wrapProgram $dir/lpd/filter_${model} \ + --prefix PATH : ${ + lib.makeBinPath [ coreutils ghostscript gnugrep gnused which ] + } + # need to use i686 glibc here, these are 32bit proprietary binaries + interpreter=${pkgsi686Linux.glibc}/lib/ld-linux.so.2 + patchelf --set-interpreter "$interpreter" $dir/lpd/brmfcl3770cdwfilter ''; meta = { description = "Brother ${lib.strings.toUpper model} driver"; - homepage = http://www.brother.com/; + homepage = "http://www.brother.com/"; license = lib.licenses.unfree; platforms = [ "x86_64-linux" "i686-linux" ]; maintainers = [ lib.maintainers.steveej ]; @@ -79,7 +69,7 @@ in rec { meta = { description = "Brother ${lib.strings.toUpper model} CUPS wrapper driver"; - homepage = http://www.brother.com/; + homepage = "http://www.brother.com/"; license = lib.licenses.gpl2; platforms = [ "x86_64-linux" "i686-linux" ]; maintainers = [ lib.maintainers.steveej ]; diff --git a/nix/pkgs/nozbe/default.nix b/nix/pkgs/nozbe/default.nix index 47bf205..ed2c728 100644 --- a/nix/pkgs/nozbe/default.nix +++ b/nix/pkgs/nozbe/default.nix @@ -1,61 +1,61 @@ -with import {}; +with import { }; stdenv.mkDerivation rec { - name = "nozbe"; - version = "3.6.3"; + name = "nozbe"; + version = "3.6.3"; - src = fetchzip { - url = "https://files.nozbe.com/linux/linux64_newest.tar.gz"; - sha256 = "08hag0kv23psqa1pl9kardz90scgk21rsr5xxfg8jvmnxy2nc858"; - stripRoot = false; - }; + src = fetchzip { + url = "https://files.nozbe.com/linux/linux64_newest.tar.gz"; + sha256 = "08hag0kv23psqa1pl9kardz90scgk21rsr5xxfg8jvmnxy2nc858"; + stripRoot = false; + }; - buildInputs = [ makeWrapper ]; + buildInputs = [ makeWrapper ]; - buildPhase = '':''; + buildPhase = ":"; - libPath = lib.makeLibraryPath [ - alsaLib - atk - cairo - cups - dbus - expat - freetype - fontconfig - gnome3.gconf - gcc.cc - gdk_pixbuf - gtk2-x11 - glib - pango - nss - nspr - systemd.lib - xorg.libX11 - xorg.libXcursor - xorg.libXcomposite - xorg.libXext - xorg.libXfixes - xorg.libXdamage - xorg.libXi - xorg.libXrandr - xorg.libXrender - xorg.libXtst - xorg.libXScrnSaver - ]; - installPhase = '' - pushd Nozbe-${version} - ls -lha + libPath = lib.makeLibraryPath [ + alsaLib + atk + cairo + cups + dbus + expat + freetype + fontconfig + gnome3.gconf + gcc.cc + gdk_pixbuf + gtk2-x11 + glib + pango + nss + nspr + systemd.lib + xorg.libX11 + xorg.libXcursor + xorg.libXcomposite + xorg.libXext + xorg.libXfixes + xorg.libXdamage + xorg.libXi + xorg.libXrandr + xorg.libXrender + xorg.libXtst + xorg.libXScrnSaver + ]; + installPhase = '' + pushd Nozbe-${version} + ls -lha - patchelf --set-interpreter ${stdenv.glibc}/lib/ld-linux-x86-64.so.2 Nozbe + patchelf --set-interpreter ${stdenv.glibc}/lib/ld-linux-x86-64.so.2 Nozbe - mkdir -p $out/bin - cp -a * $out/ + mkdir -p $out/bin + cp -a * $out/ - wrapProgram $out/Nozbe \ - --prefix LD_LIBRARY_PATH : "${libPath}" + wrapProgram $out/Nozbe \ + --prefix LD_LIBRARY_PATH : "${libPath}" - ln -sf ../Nozbe $out/bin/ - ''; + ln -sf ../Nozbe $out/bin/ + ''; } diff --git a/nix/pkgs/posh.nix b/nix/pkgs/posh.nix index 488a31e..ee49e51 100644 --- a/nix/pkgs/posh.nix +++ b/nix/pkgs/posh.nix @@ -3,47 +3,47 @@ let cniConfigDir = let - loopback = pkgs.writeText "00-loopback.conf" '' - { - "cniVersion": "0.3.0", - "type": "loopback" - } - ''; - - podman-bridge = pkgs.writeText "87-podman-bridge.conflist" '' - { - "cniVersion": "0.3.0", - "name": "podman", - "plugins": [ - { - "type": "bridge", - "bridge": "cni0", - "isGateway": true, - "ipMasq": true, - "ipam": { - "type": "host-local", - "subnet": "10.88.0.0/16", - "routes": [ - { "dst": "0.0.0.0/0" } - ] - } - }, - { - "type": "portmap", - "capabilities": { - "portMappings": true - } - } - ] - } - ''; - in pkgs.runCommand "cniConfig" {} '' - set -x - mkdir $out; - ln -s ${loopback} $out/${loopback.name} - ln -s ${podman-bridge} $out/${podman-bridge.name} + loopback = pkgs.writeText "00-loopback.conf" '' + { + "cniVersion": "0.3.0", + "type": "loopback" + } ''; + podman-bridge = pkgs.writeText "87-podman-bridge.conflist" '' + { + "cniVersion": "0.3.0", + "name": "podman", + "plugins": [ + { + "type": "bridge", + "bridge": "cni0", + "isGateway": true, + "ipMasq": true, + "ipam": { + "type": "host-local", + "subnet": "10.88.0.0/16", + "routes": [ + { "dst": "0.0.0.0/0" } + ] + } + }, + { + "type": "portmap", + "capabilities": { + "portMappings": true + } + } + ] + } + ''; + in pkgs.runCommand "cniConfig" { } '' + set -x + mkdir $out; + ln -s ${loopback} $out/${loopback.name} + ln -s ${podman-bridge} $out/${podman-bridge.name} + ''; + podmanConfig = pkgs.writeText "libpod.conf" '' # libpod.conf is the default configuration file for all tools using libpod to # manage containers @@ -126,13 +126,7 @@ let } ''; -in - -{ image -, pull ? "always" -, global_args ? "" -, run_args ? "" -, userns ? "keep-id" +in { image, pull ? "always", global_args ? "", run_args ? "", userns ? "keep-id" }: (pkgs.writeScriptBin "posh" '' @@ -170,12 +164,7 @@ in --conmon ${pkgs.conmon}/bin/conmon --runtime ${pkgs.crun}/bin/crun \ --rm -i --network host --pull=''${POSH_PULL} \ $tty $ssh -e HOME -v $HOME:$HOME -w $HOME \ - ${if userns != null then "--userns="+userns else ""} \ + ${if userns != null then "--userns=" + userns else ""} \ ${run_args} \ ''${POSH_IMAGE} /usr/bin/env bash -l "''${cmd[@]}" -'') -.overrideAttrs(attrs: attrs // { - passthru = { - shellPath = "/bin/posh"; - }; -}) +'').overrideAttrs (attrs: attrs // { passthru = { shellPath = "/bin/posh"; }; }) diff --git a/nix/pkgs/slirp4netns.nix b/nix/pkgs/slirp4netns.nix index 8d456d6..2eaf77a 100644 --- a/nix/pkgs/slirp4netns.nix +++ b/nix/pkgs/slirp4netns.nix @@ -1,11 +1,4 @@ -{ stdenv -, fetchFromGitHub -, autoconf -, automake -, libtool -, gnumake -, gcc -}: +{ stdenv, fetchFromGitHub, autoconf, automake, libtool, gnumake, gcc }: stdenv.mkDerivation rec { name = "slirp4netns-${version}"; @@ -18,21 +11,15 @@ stdenv.mkDerivation rec { sha256 = "0kqncza4kgqkqiki569j7ym9pvp7879i6q2z0djvda9y0i6b80w4"; }; - buildInputs = [ - autoconf - automake - libtool - gnumake - gcc - ]; - + buildInputs = [ autoconf automake libtool gnumake gcc ]; + configurePhase = '' ./autogen.sh ./configure --prefix="" ''; buildPhase = '' - make + make ''; installPhase = '' @@ -41,7 +28,7 @@ stdenv.mkDerivation rec { meta = with stdenv.lib; { description = "User-mode networking for unprivileged network namespaces"; - homepage = https://github.com/rootless-containers/slirp4netns; + homepage = "https://github.com/rootless-containers/slirp4netns"; license = null; maintainers = [ maintainers.steveej ]; platforms = platforms.all; diff --git a/nix/pkgs/staruml.nix b/nix/pkgs/staruml.nix index 7886d1b..62087a9 100644 --- a/nix/pkgs/staruml.nix +++ b/nix/pkgs/staruml.nix @@ -1,23 +1,34 @@ -{ stdenv, fetchurl, makeWrapper -, dpkg, patchelf -, gtk2, glib, gdk_pixbuf, alsaLib, nss, nspr, GConf, cups, libgcrypt, dbus, systemd -}: +{ stdenv, fetchurl, makeWrapper, dpkg, patchelf, gtk2, glib, gdk_pixbuf, alsaLib +, nss, nspr, GConf, cups, libgcrypt, dbus, systemd }: let inherit (stdenv) lib; - LD_LIBRARY_PATH = lib.makeLibraryPath - [ glib gtk2 gdk_pixbuf alsaLib nss nspr GConf cups libgcrypt dbus ]; -in -stdenv.mkDerivation rec { + LD_LIBRARY_PATH = lib.makeLibraryPath [ + glib + gtk2 + gdk_pixbuf + alsaLib + nss + nspr + GConf + cups + libgcrypt + dbus + ]; +in stdenv.mkDerivation rec { version = "2.8.1"; name = "staruml-${version}"; - src = - if stdenv.system == "i686-linux" then fetchurl { - url = "http://staruml.io/download/release/v${version}/StarUML-v${version}-32-bit.deb"; + src = if stdenv.system == "i686-linux" then + fetchurl { + url = + "http://staruml.io/download/release/v${version}/StarUML-v${version}-32-bit.deb"; sha256 = "0vb3k9m3l6pmsid4shlk0xdjsriq3gxzm8q7l04didsppg0vvq1n"; - } else fetchurl { - url = "https://s3.amazonaws.com/staruml-bucket/releases-v2/StarUML-v${version}-64-bit.deb"; + } + else + fetchurl { + url = + "https://s3.amazonaws.com/staruml-bucket/releases-v2/StarUML-v${version}-64-bit.deb"; sha256 = "05gzrnlssjkhyh0wv019d4r7p40lxnsa1sghazll6f233yrqmxb0"; }; @@ -50,7 +61,7 @@ stdenv.mkDerivation rec { meta = with stdenv.lib; { description = "A sophisticated software modeler"; - homepage = http://staruml.io/; + homepage = "http://staruml.io/"; license = licenses.unfree; platforms = [ "i686-linux" "x86_64-linux" ]; }; diff --git a/nix/sources.nix b/nix/sources.nix index 9a01c8a..8df8308 100644 --- a/nix/sources.nix +++ b/nix/sources.nix @@ -7,62 +7,73 @@ let # fetch_file = pkgs: name: spec: - let - name' = sanitizeName name + "-src"; - in - if spec.builtin or true then - builtins_fetchurl { inherit (spec) url sha256; name = name'; } - else - pkgs.fetchurl { inherit (spec) url sha256; name = name'; }; + let name' = sanitizeName name + "-src"; + in if spec.builtin or true then + builtins_fetchurl { + inherit (spec) url sha256; + name = name'; + } + else + pkgs.fetchurl { + inherit (spec) url sha256; + name = name'; + }; fetch_tarball = pkgs: name: spec: - let - name' = sanitizeName name + "-src"; - in - if spec.builtin or true then - builtins_fetchTarball { name = name'; inherit (spec) url sha256; } - else - pkgs.fetchzip { name = name'; inherit (spec) url sha256; }; + let name' = sanitizeName name + "-src"; + in if spec.builtin or true then + builtins_fetchTarball { + name = name'; + inherit (spec) url sha256; + } + else + pkgs.fetchzip { + name = name'; + inherit (spec) url sha256; + }; fetch_git = name: spec: let - ref = - if spec ? ref then spec.ref else - if spec ? branch then "refs/heads/${spec.branch}" else - if spec ? tag then "refs/tags/${spec.tag}" else - abort "In git source '${name}': Please specify `ref`, `tag` or `branch`!"; + ref = if spec ? ref then + spec.ref + else if spec ? branch then + "refs/heads/${spec.branch}" + else if spec ? tag then + "refs/tags/${spec.tag}" + else + abort + "In git source '${name}': Please specify `ref`, `tag` or `branch`!"; submodules = if spec ? submodules then spec.submodules else false; - submoduleArg = - let - nixSupportsSubmodules = builtins.compareVersions builtins.nixVersion "2.4" >= 0; - emptyArgWithWarning = - if submodules == true - then - builtins.trace - ( - "The niv input \"${name}\" uses submodules " - + "but your nix's (${builtins.nixVersion}) builtins.fetchGit " - + "does not support them" - ) - {} - else {}; - in - if nixSupportsSubmodules - then { inherit submodules; } - else emptyArgWithWarning; - in - builtins.fetchGit - ({ url = spec.repo; inherit (spec) rev; inherit ref; } // submoduleArg); + submoduleArg = let + nixSupportsSubmodules = + builtins.compareVersions builtins.nixVersion "2.4" >= 0; + emptyArgWithWarning = if submodules == true then + builtins.trace (''The niv input "${name}" uses submodules '' + + "but your nix's (${builtins.nixVersion}) builtins.fetchGit " + + "does not support them") { } + else + { }; + in if nixSupportsSubmodules then { + inherit submodules; + } else + emptyArgWithWarning; + in builtins.fetchGit ({ + url = spec.repo; + inherit (spec) rev; + inherit ref; + } // submoduleArg); fetch_local = spec: spec.path; - fetch_builtin-tarball = name: throw - ''[${name}] The niv type "builtin-tarball" is deprecated. You should instead use `builtin = true`. - $ niv modify ${name} -a type=tarball -a builtin=true''; + fetch_builtin-tarball = name: + throw '' + [${name}] The niv type "builtin-tarball" is deprecated. You should instead use `builtin = true`. + $ niv modify ${name} -a type=tarball -a builtin=true''; - fetch_builtin-url = name: throw - ''[${name}] The niv type "builtin-url" will soon be deprecated. You should instead use `builtin = true`. - $ niv modify ${name} -a type=file -a builtin=true''; + fetch_builtin-url = name: + throw '' + [${name}] The niv type "builtin-url" will soon be deprecated. You should instead use `builtin = true`. + $ niv modify ${name} -a type=file -a builtin=true''; # # Various helpers @@ -70,72 +81,87 @@ let # https://github.com/NixOS/nixpkgs/pull/83241/files#diff-c6f540a4f3bfa4b0e8b6bafd4cd54e8bR695 sanitizeName = name: - ( - concatMapStrings (s: if builtins.isList s then "-" else s) - ( - builtins.split "[^[:alnum:]+._?=-]+" - ((x: builtins.elemAt (builtins.match "\\.*(.*)" x) 0) name) - ) - ); + (concatMapStrings (s: if builtins.isList s then "-" else s) + (builtins.split "[^[:alnum:]+._?=-]+" + ((x: builtins.elemAt (builtins.match "\\.*(.*)" x) 0) name))); # The set of packages used when specs are fetched using non-builtins. mkPkgs = sources: system: let - sourcesNixpkgs = - import (builtins_fetchTarball { inherit (sources.nixpkgs) url sha256; }) { inherit system; }; + sourcesNixpkgs = import + (builtins_fetchTarball { inherit (sources.nixpkgs) url sha256; }) { + inherit system; + }; hasNixpkgsPath = builtins.any (x: x.prefix == "nixpkgs") builtins.nixPath; hasThisAsNixpkgsPath = == ./.; - in - if builtins.hasAttr "nixpkgs" sources - then sourcesNixpkgs - else if hasNixpkgsPath && ! hasThisAsNixpkgsPath then - import {} - else - abort - '' - Please specify either (through -I or NIX_PATH=nixpkgs=...) or - add a package called "nixpkgs" to your sources.json. - ''; + in if builtins.hasAttr "nixpkgs" sources then + sourcesNixpkgs + else if hasNixpkgsPath && !hasThisAsNixpkgsPath then + import { } + else + abort '' + Please specify either (through -I or NIX_PATH=nixpkgs=...) or + add a package called "nixpkgs" to your sources.json. + ''; # The actual fetching function. fetch = pkgs: name: spec: - if ! builtins.hasAttr "type" spec then + if !builtins.hasAttr "type" spec then abort "ERROR: niv spec ${name} does not have a 'type' attribute" - else if spec.type == "file" then fetch_file pkgs name spec - else if spec.type == "tarball" then fetch_tarball pkgs name spec - else if spec.type == "git" then fetch_git name spec - else if spec.type == "local" then fetch_local spec - else if spec.type == "builtin-tarball" then fetch_builtin-tarball name - else if spec.type == "builtin-url" then fetch_builtin-url name + else if spec.type == "file" then + fetch_file pkgs name spec + else if spec.type == "tarball" then + fetch_tarball pkgs name spec + else if spec.type == "git" then + fetch_git name spec + else if spec.type == "local" then + fetch_local spec + else if spec.type == "builtin-tarball" then + fetch_builtin-tarball name + else if spec.type == "builtin-url" then + fetch_builtin-url name else - abort "ERROR: niv spec ${name} has unknown type ${builtins.toJSON spec.type}"; + abort + "ERROR: niv spec ${name} has unknown type ${builtins.toJSON spec.type}"; # If the environment variable NIV_OVERRIDE_${name} is set, then use # the path directly as opposed to the fetched source. replace = name: drv: let - saneName = stringAsChars (c: if isNull (builtins.match "[a-zA-Z0-9]" c) then "_" else c) name; + saneName = stringAsChars + (c: if isNull (builtins.match "[a-zA-Z0-9]" c) then "_" else c) name; ersatz = builtins.getEnv "NIV_OVERRIDE_${saneName}"; - in - if ersatz == "" then drv else - # this turns the string into an actual Nix path (for both absolute and - # relative paths) - if builtins.substring 0 1 ersatz == "/" then /. + ersatz else /. + builtins.getEnv "PWD" + "/${ersatz}"; + in if ersatz == "" then + drv + else + # this turns the string into an actual Nix path (for both absolute and + # relative paths) + if builtins.substring 0 1 ersatz == "/" then + /. + ersatz + else + /. + builtins.getEnv "PWD" + "/${ersatz}"; # Ports of functions for older nix versions # a Nix version of mapAttrs if the built-in doesn't exist - mapAttrs = builtins.mapAttrs or ( - f: set: with builtins; - listToAttrs (map (attr: { name = attr; value = f attr set.${attr}; }) (attrNames set)) - ); + mapAttrs = builtins.mapAttrs or (f: set: + with builtins; + listToAttrs (map (attr: { + name = attr; + value = f attr set.${attr}; + }) (attrNames set))); # https://github.com/NixOS/nixpkgs/blob/0258808f5744ca980b9a1f24fe0b1e6f0fecee9c/lib/lists.nix#L295 - range = first: last: if first > last then [] else builtins.genList (n: first + n) (last - first + 1); + range = first: last: + if first > last then + [ ] + else + builtins.genList (n: first + n) (last - first + 1); # https://github.com/NixOS/nixpkgs/blob/0258808f5744ca980b9a1f24fe0b1e6f0fecee9c/lib/strings.nix#L257 - stringToCharacters = s: map (p: builtins.substring p 1 s) (range 0 (builtins.stringLength s - 1)); + stringToCharacters = s: + map (p: builtins.substring p 1 s) (range 0 (builtins.stringLength s - 1)); # https://github.com/NixOS/nixpkgs/blob/0258808f5744ca980b9a1f24fe0b1e6f0fecee9c/lib/strings.nix#L269 stringAsChars = f: s: concatStrings (map f (stringToCharacters s)); @@ -143,46 +169,44 @@ let concatStrings = builtins.concatStringsSep ""; # https://github.com/NixOS/nixpkgs/blob/8a9f58a375c401b96da862d969f66429def1d118/lib/attrsets.nix#L331 - optionalAttrs = cond: as: if cond then as else {}; + optionalAttrs = cond: as: if cond then as else { }; # fetchTarball version that is compatible between all the versions of Nix builtins_fetchTarball = { url, name ? null, sha256 }@attrs: - let - inherit (builtins) lessThan nixVersion fetchTarball; - in - if lessThan nixVersion "1.12" then - fetchTarball ({ inherit url; } // (optionalAttrs (!isNull name) { inherit name; })) - else - fetchTarball attrs; + let inherit (builtins) lessThan nixVersion fetchTarball; + in if lessThan nixVersion "1.12" then + fetchTarball + ({ inherit url; } // (optionalAttrs (!isNull name) { inherit name; })) + else + fetchTarball attrs; # fetchurl version that is compatible between all the versions of Nix builtins_fetchurl = { url, name ? null, sha256 }@attrs: - let - inherit (builtins) lessThan nixVersion fetchurl; - in - if lessThan nixVersion "1.12" then - fetchurl ({ inherit url; } // (optionalAttrs (!isNull name) { inherit name; })) - else - fetchurl attrs; + let inherit (builtins) lessThan nixVersion fetchurl; + in if lessThan nixVersion "1.12" then + fetchurl + ({ inherit url; } // (optionalAttrs (!isNull name) { inherit name; })) + else + fetchurl attrs; # Create the final "sources" from the config mkSources = config: - mapAttrs ( - name: spec: - if builtins.hasAttr "outPath" spec - then abort - "The values in sources.json should not have an 'outPath' attribute" - else - spec // { outPath = replace name (fetch config.pkgs name spec); } - ) config.sources; + mapAttrs (name: spec: + if builtins.hasAttr "outPath" spec then + abort + "The values in sources.json should not have an 'outPath' attribute" + else + spec // { outPath = replace name (fetch config.pkgs name spec); }) + config.sources; # The "config" used by the fetchers - mkConfig = - { sourcesFile ? if builtins.pathExists ./sources.json then ./sources.json else null - , sources ? if isNull sourcesFile then {} else builtins.fromJSON (builtins.readFile sourcesFile) - , system ? builtins.currentSystem - , pkgs ? mkPkgs sources system - }: rec { + mkConfig = { sourcesFile ? + if builtins.pathExists ./sources.json then ./sources.json else null + , sources ? if isNull sourcesFile then + { } + else + builtins.fromJSON (builtins.readFile sourcesFile) + , system ? builtins.currentSystem, pkgs ? mkPkgs sources system }: rec { # The sources, i.e. the attribute set of spec name to spec inherit sources; @@ -190,5 +214,6 @@ let inherit pkgs; }; -in -mkSources (mkConfig {}) // { __functor = _: settings: mkSources (mkConfig settings); } +in mkSources (mkConfig { }) // { + __functor = _: settings: mkSources (mkConfig settings); +} diff --git a/nix/tests/buildvmwithbootloader/build-vm.nix b/nix/tests/buildvmwithbootloader/build-vm.nix index 8347b45..6010c82 100644 --- a/nix/tests/buildvmwithbootloader/build-vm.nix +++ b/nix/tests/buildvmwithbootloader/build-vm.nix @@ -1,32 +1,35 @@ -{ system ? builtins.currentSystem -, vmPkgsPath -, buildPkgsPath -, nixosConfigPath -}: +{ system ? builtins.currentSystem, vmPkgsPath, buildPkgsPath, nixosConfigPath }: let - buildPkgs = import buildPkgsPath {}; - vmPkgs'= import vmPkgsPath {}; + buildPkgs = import buildPkgsPath { }; + vmPkgs' = import vmPkgsPath { }; vmPkgs = vmPkgs' // { runtimeShell = "${vmPkgs'.bash}/${vmPkgs'.bash.shellPath}"; }; - importWithPkgs = { path, pkgs }: args: import path (args // { inherit pkgs; }); - - nixosConfig = importWithPkgs { path = "${nixosConfigPath}"; pkgs = vmPkgs; }; - vmConfig = importWithPkgs { path = "${buildPkgsPath}/nixos/modules/virtualisation/qemu-vm.nix"; pkgs = vmPkgs; }; - evalConfig = importWithPkgs { path = "${vmPkgsPath}/nixos/lib/eval-config.nix"; pkgs = null; }; + importWithPkgs = { path, pkgs }: + args: + import path (args // { inherit pkgs; }); + + nixosConfig = importWithPkgs { + path = "${nixosConfigPath}"; + pkgs = vmPkgs; + }; + vmConfig = importWithPkgs { + path = "${buildPkgsPath}/nixos/modules/virtualisation/qemu-vm.nix"; + pkgs = vmPkgs; + }; + evalConfig = importWithPkgs { + path = "${vmPkgsPath}/nixos/lib/eval-config.nix"; + pkgs = null; + }; vmWithBootLoaderConfigMixed = (evalConfig { modules = [ nixosConfig vmConfig - { - virtualisation.useBootLoader = true; - } + { virtualisation.useBootLoader = true; } ]; }).config; -in { - vmWithBootLoaderMixed = vmWithBootLoaderConfigMixed.system.build.vm; -} +in { vmWithBootLoaderMixed = vmWithBootLoaderConfigMixed.system.build.vm; } diff --git a/nix/tests/buildvmwithbootloader/configuration.nix b/nix/tests/buildvmwithbootloader/configuration.nix index 874bea1..893c9d4 100644 --- a/nix/tests/buildvmwithbootloader/configuration.nix +++ b/nix/tests/buildvmwithbootloader/configuration.nix @@ -1,9 +1,7 @@ { pkgs, lib, ... }: let -in - -{ +in { boot.loader.grub = { enable = true; version = 2; @@ -14,25 +12,21 @@ in boot.loader.efi.canTouchEfiVariables = true; boot.loader.systemd-boot.enable = true; - boot.initrd.luks.devices = [ { - name = "crypt"; - device = "/dev/disk/uuid/463d886d-7dfe-421b-8cef-f9af3a3fa09d"; - preLVM = true; - allowDiscards = true; - } - ]; - fileSystems."/" = { - label = "root"; - }; + boot.initrd.luks.devices = [{ + name = "crypt"; + device = "/dev/disk/uuid/463d886d-7dfe-421b-8cef-f9af3a3fa09d"; + preLVM = true; + allowDiscards = true; + }]; + fileSystems."/" = { label = "root"; }; - fileSystems."/boot" = { - label = "boot"; - }; + fileSystems."/boot" = { label = "boot"; }; boot.tmpOnTmpfs = true; - boot.initrd.availableKernelModules = [ "xhci_pci" "ahci" "usb_storage" "sd_mod" "rtsx_pci_sdmmc" ]; - + boot.initrd.availableKernelModules = + [ "xhci_pci" "ahci" "usb_storage" "sd_mod" "rtsx_pci_sdmmc" ]; + users.extraUsers.root.initialPassword = lib.mkForce "toorroot"; users.mutableUsers = false; } diff --git a/nix/tests/test-vm.nix b/nix/tests/test-vm.nix index d647b3c..a48b94f 100644 --- a/nix/tests/test-vm.nix +++ b/nix/tests/test-vm.nix @@ -1,6 +1,5 @@ -{ lib, config, pkgs, fetchgit, ... }: -{ - boot.consoleLogLevel=6; +{ lib, config, pkgs, fetchgit, ... }: { + boot.consoleLogLevel = 6; users.users.root.initialPassword = "root"; systemd.services."serial-getty@ttyS0".enable = true; networking.firewall.enable = false; diff --git a/nix/variables/passwords.crypt.nix b/nix/variables/passwords.crypt.nix index 96617a15599aa49ee65e8c901ba3389f11f83a49..b18c6e439b6f8cad084c72e12423926d88720180 100644 GIT binary patch literal 1797 zcmZQ@_Y83kiVO&0Si__ARoQa7g6SL1rouf>eO`+xGVVHNml%5X+u;-c%iG>=j461$ zpzFumEvA#W?ysJ7ZPvse(ZX*Wnu~*kmtNy~NC)>;9@v;gZut8ON%YGun@SJe|`M{w(Y)cgMpDo05}CJHPGt zQ`VvzQP*(SXGhn!Lt!F3sZOE?j$QlvT&w>2kL&X!&hOApJ|LvNi}&?p%f9n9Z&$0U zolWOHSe`7*?|Eyf)f?k|)1_y$%JwJSzxiVCjrWgdy!w0OjBrNqwh7G&hj;Fmno>TA zJ;TJ-{!wdA_=MazyA$rAeE;uN-8;JZQ>&B{+e^k}vmf<-YndjyT){>Cd(x{V+rr=N znIfULNqhf}%}2P8*6AGBF?G*QPw%jgQd2KBJ-M0R5xP0*mkketprNtt)d?EB(!D+F z1g>cd&hhmURrWqmuv~RlV4!Yb(*dux8%La7_S=V@s^$8Wxs>zF$)8VqHMw%`Zkx2J zu653NQ`gB$njR@BfBGpiuYTu;{Sq4GX1C9kmH#_XbkRNdo5r<${M+r#*PQ9OHFvdT z`~r*cOw&-IuN+Mrm4Zut%xjqy|M~Y6v3NxfZQjpQ_f<`tx~SIA#zUHG^X;dXj$fXm z>L9BV+we*8cyz@VZ__tvCp981dBZLIeNzfguIIJ4;;b^Bqh0>~<%5|!6iQVMmwc5l z6-wgLP+z)t#e;j?Emw~mIlSk1$fNbqlcc4m$n5X;v#p%5KHHC-RhDg%AggF`p0w)J zvuEag(N7VY_rf{rZQ(rymB&5LHu4Lu%R8ua;gx!=5qC?efYnD6Y5mu+{vIp6VADpY%uQ605JH=WF%n2??u%&#rTOW>S3j*s0L_S1gTq zGaN%#|4rU4X7FL|(fns;l`bumI`nNS-#QyB#%|9KCqEzipu+cTsm;X`s_$4gyS&`= zyF4ZCYUOpsr|H3)-4Yu<)YaU~_?K^!e{Jp3sc*kE91}INk($u3B0}v=Rl`$Nx8muK zu2xhf@h@^Y#VN(Q+2+<<{jJ+9+222!{a;;U^6T5TZO%*HF8bwCYnXiTVA*ji-+=O3 z&*_<)i*i0oB$rS5=`#DT!uwUr{y2OKZ!28H?Q?^x?Ro8Ok*69r_sf>)PAD{Of3RJv zsq@f8m7p7L_7??pzPSI5JtnoZeEC|FH9i;E_Ay>RI$0%j$J*JZd)9nECK0n)bbt*{gkrN;W!&{Mq>}{;x6P zg%>wndHHivzBfv}Gw8j0ck}!kJC-O{bDz=w+W1>2=Hd_k=8s4FCo47W(GmNzXI0mt z1>3HExo2hjPP27MjOD(Oe)B|{rJ;6d&fY(zb7C?U zNV$98JAC_{SnJ2DUGb+>-{m? zCO|qvRy=y4z$qPD?^>^|HZl*dIkS9zH_@v`knQD`CCvUo(TdYM{z>S#ZgKg!`jv50 zTdbN!L-CuHSJdlMIhnq;*S>LF6nFh6%V)vkTg`ehUG7#o&6Sl3Xvmww(>XoHe4_$S zV%Cd`4bhh>bT8CrmhTLC@Qn3V&!|Nl-MzYVY0WmfeavQBdZRTIK?kZ@=0CRhXDDrJ%vRdBD&1ouCy=q*o zPZf0+{Hb%0?(llF@$IdSMJpZW{>=?@j>C0nJo?qnu)k5; zEv=%oo%hFwDTcon^3IZTJ(0iT7Wa*+mITv1PZ~^{8uA@~iuVMmBu*5bW>9E#=*S11 zngfYyyNdj0pYwVV{w~4c?9(Mo9nF{)C?wa$brnoPby5_O&@xs_&pL@@I>HijX^3~lb)3^SbFz=bB6?=ZDWt_+6 zlReW;OtZ<>kgqfsirTdOY`ELcBu=aO*>9>Z#s1XY=fCvX)EA8G3!_6KRAoFR%~mR@cXg_c~J$m!yKVxy}<%YX6J z0(_gZ--yngA+vm=R(j_Ii={T_bN1b7P!@|mJN;0(C-amb@-&UVbt>+?2{QvNuW)n=5WE1t1$xM|kiQD`7aD9{o z|KcPU!LE+~ualhPr%3s?Sp1Hkv*OtMw!MgDhB z!n$%N$N5RWuV~&07G1yL=E*vRR-uDOZY_)xJ!h%WERu8hBRB`{AzQuicFa{EDfsZdcC@aq4AGI)A7A(+yj(%Xd%h zx6UnMm_r`s{(H zx=b$S2;SYWBl(_p{)gwuAgGToT<^bdP$?9Uf!XN4<1H7h@Ene zYx4Vlh12IB+3(f6{9ts(*`f_g%N=!QJPKe6Je@te>g19aKNih0IR2dJ%z`tQcb|;d z$EI=c{fd^~%HhQ`%QOv6bZ+vOGm*AADl?1a?|PHX68~>Y)OgN0?@OP zZ%;kDGB!1J-pniCx2*oixNzwN&bY`O8j~KXJT14I!0*_qeOBY)oEd7ya@k+rI+sjX z(PeEghi%6FB|X}Pf0XN_=D%szeDw9p_SL4#we51gRypgP=rxXy{Ql}$|Jz;Cq{jJx`eaqQ+`;seVdN#(!z82fst+6OV_MOyz*JzIG;xdJr z$0`G6s~wBbHfK*c{^51BXhz@UdwM}z602*aX6?OyeoCa)$CB=ZW5VwGFZt!K_Om$X z&OCDcRmYOciHh+b?tND7pTQLJ*&(&enQ@__7U!|KTJ!4cog-OiwmW`;+u02c f5{sO3cKujf-`5;G>#g#SM~(S8jJIcS@M!=5bqjB; diff --git a/nix/variables/versions.nix b/nix/variables/versions.nix index 476241e..447b563 100644 --- a/nix/variables/versions.nix +++ b/nix/variables/versions.nix @@ -4,13 +4,10 @@ let ref = "nixos-22.05"; rev = "08950a6e29cf7bddee466592eb790a417550f7f9"; }; -in -{ +in { inherit nixpkgs; - nixos = nixpkgs // { - suffix = "/nixos"; - }; + nixos = nixpkgs // { suffix = "/nixos"; }; "channels-nixos-stable" = nixpkgs; "channels-nixos-unstable" = { url = "https://github.com/NixOS/nixpkgs/"; diff --git a/nix/variables/versions.tmpl.nix b/nix/variables/versions.tmpl.nix index b1af001..893ee9e 100644 --- a/nix/variables/versions.tmpl.nix +++ b/nix/variables/versions.tmpl.nix @@ -2,29 +2,34 @@ let nixpkgs = { url = "https://github.com/NixOS/nixpkgs/"; ref = "nixos-22.05"; - rev = "<% git ls-remote https://github.com/nixos/nixpkgs nixos-22.05 | awk '{ print $1 }' | tr -d '\n' -%>"; + rev = '' + <% git ls-remote https://github.com/nixos/nixpkgs nixos-22.05 | awk '{ print $1 }' | tr -d ' + ' -%>''; }; -in -{ +in { inherit nixpkgs; - nixos = nixpkgs // { - suffix = "/nixos"; - }; + nixos = nixpkgs // { suffix = "/nixos"; }; "channels-nixos-stable" = nixpkgs; "channels-nixos-unstable" = { url = "https://github.com/NixOS/nixpkgs/"; ref = "nixos-unstable"; - rev = "<% git ls-remote https://github.com/nixos/nixpkgs nixos-unstable | awk '{ print $1 }' | tr -d '\n' -%>"; + rev = '' + <% git ls-remote https://github.com/nixos/nixpkgs nixos-unstable | awk '{ print $1 }' | tr -d ' + ' -%>''; }; "nixpkgs-master" = { url = "https://github.com/NixOS/nixpkgs/"; ref = "master"; - rev = "<% git ls-remote https://github.com/NixOS/nixpkgs.git master | head -n1 | awk '{ print $1 }' | tr -d '\n' -%>"; + rev = '' + <% git ls-remote https://github.com/NixOS/nixpkgs.git master | head -n1 | awk '{ print $1 }' | tr -d ' + ' -%>''; }; "home-manager-module" = { url = "https://github.com/nix-community/home-manager"; ref = "release-22.05"; - rev = "<% git ls-remote https://github.com/nix-community/home-manager.git release-22.05 | awk '{ print $1 }' | tr -d '\n' -%>"; + rev = '' + <% git ls-remote https://github.com/nix-community/home-manager.git release-22.05 | awk '{ print $1 }' | tr -d ' + ' -%>''; }; } diff --git a/shell.nix b/shell.nix index 1568b49..814c9ea 100644 --- a/shell.nix +++ b/shell.nix @@ -2,15 +2,20 @@ let pkgsPath = (import ./nix/sources.nix).nixpkgs; - pkgs = import pkgsPath { overlays = builtins.attrValues (import ./nix/overlays); }; + pkgs = + import pkgsPath { overlays = builtins.attrValues (import ./nix/overlays); }; -in - -pkgs.stdenv.mkDerivation { +in pkgs.stdenv.mkDerivation { name = "infra-env"; buildInputs = [ - (with import (pkgsPath+"/nixos") { configuration = {}; }; with config.system.build; [ nixos-generate-config nixos-install nixos-enter manual.manpages ]) - ] ++ (with pkgs; [ + (with import (pkgsPath + "/nixos") { configuration = { }; }; + with config.system.build; [ + nixos-generate-config + nixos-install + nixos-enter + manual.manpages + ]) + ] ++ (with pkgs; [ just git-crypt vcsh