home

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README | LICENSE

commit 9506b3afc3bfdde696da8262c58d2131ae7fbd77
parent 442223190afa650f495aa5da8eb757e8ff70a7db
Author: Vincent Demeester <vincent@sbr.pm>
Date:   Fri,  8 May 2020 16:20:02 +0200

modules: nixpkgs-fmt 👼

Signed-off-by: Vincent Demeester <vincent@sbr.pm>

Diffstat:
Mci.nix | 12+++---------
Mhardware/dell-latitude-e6540.nix | 10+++++++---
Mhardware/lenovo-p50.nix | 52++++++++++++++++++++++++++--------------------------
Mhardware/thinkpad-t460s.nix | 46+++++++++++++++++++++++-----------------------
Mhardware/thinkpad-x220.nix | 60++++++++++++++++++++++++++++++------------------------------
Mhardware/thinkpad.nix | 48++++++++++++++++++++++++++----------------------
Mmachines/kerkouane.nixos.nix | 2+-
Mmachines/okinawa.nixos.nix | 8++++----
Mmachines/sakhalin.nixos.nix | 8++++----
Mmachines/wakasu.nixos.nix | 2+-
Mmodules/hardware/sane-extra-config.nixos.nix | 34++++++++++++++++------------------
Mmodules/profiles/audio.nix | 73+++++++++++++++++++++++++++++++++++++------------------------------------
Mmodules/profiles/desktop.nix | 1-
Mmodules/profiles/dev.java.nix | 31++++++++++++++++---------------
Mmodules/profiles/dev.js.nix | 37+++++++++++++++++++------------------
Mmodules/profiles/dev.nix | 93++++++++++++++++++++++++++++++++++++++++---------------------------------------
Mmodules/profiles/dev.rust.nix | 31++++++++++++++++---------------
Mmodules/profiles/direnv.nix | 63++++++++++++++++++++++++++++++++-------------------------------
Mmodules/profiles/docker.nix | 39++++++++++++++++++++-------------------
Mmodules/profiles/emacs.nix | 330++++++++++++++++++++++++++++++++++++++++----------------------------------------
Mmodules/profiles/git.nix | 401++++++++++++++++++++++++++++++++++++++++---------------------------------------
Mmodules/profiles/i3.nix | 2+-
Mmodules/profiles/kubernetes.nix | 117++++++++++++++++++++++++++++++++++++++++---------------------------------------
Mmodules/profiles/mails.nix | 327++++++++++++++++++++++++++++++++++++++++---------------------------------------
Mmodules/profiles/media.nix | 23++++++++++++-----------
Mmodules/profiles/nix-auto-update.nixos.nix | 63++++++++++++++++++++++++++++++++-------------------------------
Mmodules/profiles/openshift.nix | 35++++++++++++++++++-----------------
Mmodules/profiles/qemu.nixos.nix | 4++--
Mmodules/profiles/ssh.nix | 2+-
Mmodules/profiles/users.nixos.nix | 10+++++-----
Mmodules/profiles/virtualization.nixos.nix | 79++++++++++++++++++++++++++++++++++++++++---------------------------------------
Mmodules/profiles/zsh.nix | 313++++++++++++++++++++++++++++++++++++++++---------------------------------------
Mmodules/services/nix-binary-cache.nixos.nix | 2+-
Mmodules/virtualisation/containerd.nixos.nix | 65++++++++++++++++++++++++++++++++---------------------------------
Moverlays/emacs/builder.nix | 6+++---
Moverlays/sbr.nix | 35++++++++++++++++++-----------------
Moverlays/unstable.nix | 2+-
Mpkgs/buildkit/default.nix | 9+++++----
Mpkgs/containerd/default.nix | 4++--
Mpkgs/crc/default.nix | 37+++++++++++++++++++------------------
Mpkgs/oc/default.nix | 52++++++++++++++++++++++++++--------------------------
Mpkgs/operator-sdk/default.nix | 61+++++++++++++++++++++++++++++++------------------------------
Mpkgs/prm/default.nix | 11++++++-----
Mpkgs/tkn/default.nix | 9+++++----
Mpkgs/vscodeliveshare/default.nix | 11++++++-----
Mtmp/channels.nix | 63+++++++++++++++++++++++++++++++++++----------------------------
46 files changed, 1375 insertions(+), 1348 deletions(-)

diff --git a/ci.nix b/ci.nix @@ -9,7 +9,7 @@ # then your CI will be able to build and cache only those packages for # which this is possible. -{ pkgs ? import <nixpkgs> {} }: +{ pkgs ? import <nixpkgs> { } }: with builtins; let @@ -18,24 +18,18 @@ let isBuildable = p: !(p.meta.broken or false) && p.meta.license.free or true; isCacheable = p: !(p.preferLocalBuild or false); shouldRecurseForDerivations = p: isAttrs p && p.recurseForDerivations or false; - nameValuePair = n: v: { name = n; value = v; }; - concatMap = builtins.concatMap or (f: xs: concatLists (map f xs)); - flattenPkgs = s: let f = p: if shouldRecurseForDerivations p then flattenPkgs p else if isDerivation p then [ p ] - else []; + else [ ]; in - concatMap f (attrValues s); - + concatMap f (attrValues s); outputsOf = p: map (o: p.${o}) p.outputs; - nurAttrs = import ./pkgs/default.nix { inherit pkgs; }; - nurPkgs = flattenPkgs ( diff --git a/hardware/dell-latitude-e6540.nix b/hardware/dell-latitude-e6540.nix @@ -5,13 +5,17 @@ loader.efi.canTouchEfiVariables = true; kernelParams = [ # Kernel GPU Savings Options (NOTE i915 chipset only) - "i915.enable_rc6=0" "i915.enable_fbc=1" + "i915.enable_rc6=0" + "i915.enable_fbc=1" "i915.lvds_use_ssc=0" - "drm.debug=0" "drm.vblankoffdelay=1" + "drm.debug=0" + "drm.vblankoffdelay=1" ]; blacklistedKernelModules = [ # Kernel GPU Savings Options (NOTE i915 chipset only) - "sierra_net" "cdc_mbim" "cdc_ncm" + "sierra_net" + "cdc_mbim" + "cdc_ncm" ]; }; hardware = { diff --git a/hardware/lenovo-p50.nix b/hardware/lenovo-p50.nix @@ -1,4 +1,4 @@ -{ config, pkgs, ...}: +{ config, pkgs, ... }: { imports = [ ./thinkpad.nix ]; @@ -16,34 +16,34 @@ services = { tlp = { extraConfig = '' -# CPU optimizations -CPU_SCALING_GOVERNOR_ON_AC=performance -CPU_SCALING_GOVERNOR_ON_BAT=powersave -CPU_MIN_PERF_ON_AC=0 -CPU_MAX_PERF_ON_AC=100 -CPU_MIN_PERF_ON_BAT=0 -CPU_MAX_PERF_ON_BAT=50 -# DEVICES (wifi, ..) -DEVICES_TO_DISABLE_ON_STARTUP="" -DEVICES_TO_ENABLE_ON_AC="bluetooth wifi wwan" -DEVICES_TO_DISABLE_ON_BAT="" -# Network management -DEVICES_TO_DISABLE_ON_LAN_CONNECT="" -DEVICES_TO_DISABLE_ON_WIFI_CONNECT="" -DEVICES_TO_DISABLE_ON_WWAN_CONNECT="" -DEVICES_TO_ENABLE_ON_LAN_DISCONNECT="" -DEVICES_TO_ENABLE_ON_WIFI_DISCONNECT="" -DEVICES_TO_ENABLE_ON_WWAN_DISCONNECT="" -# Docking -DEVICES_TO_DISABLE_ON_DOCK="wifi" -DEVICES_TO_ENABLE_ON_UNDOCK="wifi" -# Make sure it uses the right hard drive -DISK_DEVICES="nvme0n1p2" + # CPU optimizations + CPU_SCALING_GOVERNOR_ON_AC=performance + CPU_SCALING_GOVERNOR_ON_BAT=powersave + CPU_MIN_PERF_ON_AC=0 + CPU_MAX_PERF_ON_AC=100 + CPU_MIN_PERF_ON_BAT=0 + CPU_MAX_PERF_ON_BAT=50 + # DEVICES (wifi, ..) + DEVICES_TO_DISABLE_ON_STARTUP="" + DEVICES_TO_ENABLE_ON_AC="bluetooth wifi wwan" + DEVICES_TO_DISABLE_ON_BAT="" + # Network management + DEVICES_TO_DISABLE_ON_LAN_CONNECT="" + DEVICES_TO_DISABLE_ON_WIFI_CONNECT="" + DEVICES_TO_DISABLE_ON_WWAN_CONNECT="" + DEVICES_TO_ENABLE_ON_LAN_DISCONNECT="" + DEVICES_TO_ENABLE_ON_WIFI_DISCONNECT="" + DEVICES_TO_ENABLE_ON_WWAN_DISCONNECT="" + # Docking + DEVICES_TO_DISABLE_ON_DOCK="wifi" + DEVICES_TO_ENABLE_ON_UNDOCK="wifi" + # Make sure it uses the right hard drive + DISK_DEVICES="nvme0n1p2" ''; }; udev.extraRules = '' - # Rules for Lenovo Thinkpad WS Dock - SUBSYSTEM=="usb", ACTION=="add|remove", ENV{ID_VENDOR}=="17ef", ENV{ID_MODEL}=="305a", RUN+="${pkgs.vde-thinkpad}/bin/dock" + # Rules for Lenovo Thinkpad WS Dock + SUBSYSTEM=="usb", ACTION=="add|remove", ENV{ID_VENDOR}=="17ef", ENV{ID_MODEL}=="305a", RUN+="${pkgs.vde-thinkpad}/bin/dock" ''; }; } diff --git a/hardware/thinkpad-t460s.nix b/hardware/thinkpad-t460s.nix @@ -5,29 +5,29 @@ services = { tlp = { extraConfig = '' -# CPU optimizations -CPU_SCALING_GOVERNOR_ON_AC=performance -CPU_SCALING_GOVERNOR_ON_BAT=powersave -CPU_MIN_PERF_ON_AC=0 -CPU_MAX_PERF_ON_AC=100 -CPU_MIN_PERF_ON_BAT=0 -CPU_MAX_PERF_ON_BAT=50 -# DEVICES (wifi, ..) -DEVICES_TO_DISABLE_ON_STARTUP="" -DEVICES_TO_ENABLE_ON_AC="bluetooth wifi wwan" -DEVICES_TO_DISABLE_ON_BAT="" -# Network management -DEVICES_TO_DISABLE_ON_LAN_CONNECT="" -DEVICES_TO_DISABLE_ON_WIFI_CONNECT="" -DEVICES_TO_DISABLE_ON_WWAN_CONNECT="" -DEVICES_TO_ENABLE_ON_LAN_DISCONNECT="" -DEVICES_TO_ENABLE_ON_WIFI_DISCONNECT="" -DEVICES_TO_ENABLE_ON_WWAN_DISCONNECT="" -# Docking -DEVICES_TO_DISABLE_ON_DOCK="wifi" -DEVICES_TO_ENABLE_ON_UNDOCK="wifi" -# Make sure it uses the right hard drive -DISK_DEVICES="nvme0n1p3" + # CPU optimizations + CPU_SCALING_GOVERNOR_ON_AC=performance + CPU_SCALING_GOVERNOR_ON_BAT=powersave + CPU_MIN_PERF_ON_AC=0 + CPU_MAX_PERF_ON_AC=100 + CPU_MIN_PERF_ON_BAT=0 + CPU_MAX_PERF_ON_BAT=50 + # DEVICES (wifi, ..) + DEVICES_TO_DISABLE_ON_STARTUP="" + DEVICES_TO_ENABLE_ON_AC="bluetooth wifi wwan" + DEVICES_TO_DISABLE_ON_BAT="" + # Network management + DEVICES_TO_DISABLE_ON_LAN_CONNECT="" + DEVICES_TO_DISABLE_ON_WIFI_CONNECT="" + DEVICES_TO_DISABLE_ON_WWAN_CONNECT="" + DEVICES_TO_ENABLE_ON_LAN_DISCONNECT="" + DEVICES_TO_ENABLE_ON_WIFI_DISCONNECT="" + DEVICES_TO_ENABLE_ON_WWAN_DISCONNECT="" + # Docking + DEVICES_TO_DISABLE_ON_DOCK="wifi" + DEVICES_TO_ENABLE_ON_UNDOCK="wifi" + # Make sure it uses the right hard drive + DISK_DEVICES="nvme0n1p3" ''; }; xserver = { diff --git a/hardware/thinkpad-x220.nix b/hardware/thinkpad-x220.nix @@ -5,7 +5,7 @@ boot = { kernelParams = [ "i915.enable_psr=1" ]; extraModprobeConfig = '' - options iwlwifi 11n_disable=1 + options iwlwifi 11n_disable=1 ''; }; security = { @@ -20,35 +20,35 @@ fprintd.enable = true; tlp = { extraConfig = '' -# CPU optimizations -CPU_SCALING_GOVERNOR_ON_AC=performance -CPU_SCALING_GOVERNOR_ON_BAT=powersave -CPU_MIN_PERF_ON_AC=0 -CPU_MAX_PERF_ON_AC=100 -CPU_MIN_PERF_ON_BAT=0 -CPU_MAX_PERF_ON_BAT=50 -CPU_BOOST_ON_AC=1 -CPU_BOOST_ON_BAT=0 -# DEVICES (wifi, ..) -DEVICES_TO_DISABLE_ON_STARTUP="bluetooth" -DEVICES_TO_ENABLE_ON_AC="bluetooth wifi wwan" -DEVICES_TO_DISABLE_ON_BAT="bluetooth" -# Network management -DEVICES_TO_DISABLE_ON_LAN_CONNECT="" -DEVICES_TO_DISABLE_ON_WIFI_CONNECT="" -DEVICES_TO_DISABLE_ON_WWAN_CONNECT="" -DEVICES_TO_ENABLE_ON_LAN_DISCONNECT="" -DEVICES_TO_ENABLE_ON_WIFI_DISCONNECT="" -DEVICES_TO_ENABLE_ON_WWAN_DISCONNECT="" -DISK_IDLE_SECS_ON_AC=0 -DISK_IDLE_SECS_ON_BAT=2 -MAX_LOST_WORK_SECS_ON_AC=15 -MAX_LOST_WORK_SECS_ON_BAT=60 -DISK_DEVICES="ata-Corsair_Force_LX_SSD_15256501000102160059" -SOUND_POWER_SAVE_ON_AC=0 -SOUND_POWER_SAVE_ON_BAT=1 -USB_AUTOSUSPEND=1 -USB_BLACKLIST_BTUSB=1 + # CPU optimizations + CPU_SCALING_GOVERNOR_ON_AC=performance + CPU_SCALING_GOVERNOR_ON_BAT=powersave + CPU_MIN_PERF_ON_AC=0 + CPU_MAX_PERF_ON_AC=100 + CPU_MIN_PERF_ON_BAT=0 + CPU_MAX_PERF_ON_BAT=50 + CPU_BOOST_ON_AC=1 + CPU_BOOST_ON_BAT=0 + # DEVICES (wifi, ..) + DEVICES_TO_DISABLE_ON_STARTUP="bluetooth" + DEVICES_TO_ENABLE_ON_AC="bluetooth wifi wwan" + DEVICES_TO_DISABLE_ON_BAT="bluetooth" + # Network management + DEVICES_TO_DISABLE_ON_LAN_CONNECT="" + DEVICES_TO_DISABLE_ON_WIFI_CONNECT="" + DEVICES_TO_DISABLE_ON_WWAN_CONNECT="" + DEVICES_TO_ENABLE_ON_LAN_DISCONNECT="" + DEVICES_TO_ENABLE_ON_WIFI_DISCONNECT="" + DEVICES_TO_ENABLE_ON_WWAN_DISCONNECT="" + DISK_IDLE_SECS_ON_AC=0 + DISK_IDLE_SECS_ON_BAT=2 + MAX_LOST_WORK_SECS_ON_AC=15 + MAX_LOST_WORK_SECS_ON_BAT=60 + DISK_DEVICES="ata-Corsair_Force_LX_SSD_15256501000102160059" + SOUND_POWER_SAVE_ON_AC=0 + SOUND_POWER_SAVE_ON_BAT=1 + USB_AUTOSUSPEND=1 + USB_BLACKLIST_BTUSB=1 ''; }; }; diff --git a/hardware/thinkpad.nix b/hardware/thinkpad.nix @@ -4,10 +4,12 @@ boot = { blacklistedKernelModules = [ # Kernel GPU Savings Options (NOTE i915 chipset only) - "sierra_net" "cdc_mbim" "cdc_ncm" + "sierra_net" + "cdc_mbim" + "cdc_ncm" ]; extraModprobeConfig = '' - options snd_hda_intel power_save=1 + options snd_hda_intel power_save=1 ''; initrd = { availableKernelModules = [ "aesni-intel" "aes_x86_64" "cryptd" ]; @@ -15,9 +17,11 @@ kernelModules = [ "kvm_intel" ]; kernelParams = [ # Kernel GPU Savings Options (NOTE i915 chipset only) - "i915.enable_rc6=1" "i915.enable_fbc=1" + "i915.enable_rc6=1" + "i915.enable_fbc=1" "i915.lvds_use_ssc=0" - "drm.debug=0" "drm.vblankoffdelay=1" + "drm.debug=0" + "drm.vblankoffdelay=1" "kvm_intel.nested=1" "intel_iommu=on" ]; @@ -39,10 +43,10 @@ acpid = { enable = true; lidEventCommands = '' -if grep -q closed /proc/acpi/button/lid/LID/state; then - date >> /tmp/i3lock.log - DISPLAY=":0.0" XAUTHORITY=/home/fadenb/.Xauthority ${pkgs.i3lock}/bin/i3lock &>> /tmp/i3lock.log -fi + if grep -q closed /proc/acpi/button/lid/LID/state; then + date >> /tmp/i3lock.log + DISPLAY=":0.0" XAUTHORITY=/home/fadenb/.Xauthority ${pkgs.i3lock}/bin/i3lock &>> /tmp/i3lock.log + fi ''; }; tlp = { @@ -51,22 +55,22 @@ fi xserver = { synaptics.enable = false; config = - '' - Section "InputClass" - Identifier "Enable libinput for TrackPoint" - MatchIsPointer "on" - Driver "libinput" - Option "ScrollMethod" "button" - Option "ScrollButton" "8" - EndSection - ''; + '' + Section "InputClass" + Identifier "Enable libinput for TrackPoint" + MatchIsPointer "on" + Driver "libinput" + Option "ScrollMethod" "button" + Option "ScrollButton" "8" + EndSection + ''; inputClassSections = [ '' - Identifier "evdev touchpad off" - MatchIsTouchpad "on" - MatchDevicePath "/dev/input/event*" - Driver "evdev" - Option "Ignore" "true" + Identifier "evdev touchpad off" + MatchIsTouchpad "on" + MatchDevicePath "/dev/input/event*" + Driver "evdev" + Option "Ignore" "true" '' ]; }; diff --git a/machines/kerkouane.nixos.nix b/machines/kerkouane.nixos.nix @@ -9,7 +9,7 @@ with import ../assets/machines.nix; { }; profiles = { git.enable = true; - nix-config.localCaches = []; + nix-config.localCaches = [ ]; nix-config.buildCores = 1; ssh.enable = true; syncthing.enable = true; diff --git a/machines/okinawa.nixos.nix b/machines/okinawa.nixos.nix @@ -34,25 +34,25 @@ with import ../assets/machines.nix; { { # home name = "home"; - slaves = []; + slaves = [ ]; file = ../assets/db.home; } { # home.reverse name = "192.168.1.in-addr.arpa"; - slaves = []; + slaves = [ ]; file = ../assets/db.192.168.1; } { # vpn name = "vpn"; - slaves = []; + slaves = [ ]; file = ../assets/db.vpn; } { # vpn.reverse name = "10.100.0.in-addr.arpa"; - slaves = []; + slaves = [ ]; file = ../assets/db.10.100.0; } ]; diff --git a/machines/sakhalin.nixos.nix b/machines/sakhalin.nixos.nix @@ -44,25 +44,25 @@ with import ../assets/machines.nix; { { # home name = "home"; - slaves = []; + slaves = [ ]; file = ../assets/db.home; } { # home.reverse name = "192.168.1.in-addr.arpa"; - slaves = []; + slaves = [ ]; file = ../assets/db.192.168.1; } { # vpn name = "vpn"; - slaves = []; + slaves = [ ]; file = ../assets/db.vpn; } { # vpn.reverse name = "10.100.0.in-addr.arpa"; - slaves = []; + slaves = [ ]; file = ../assets/db.10.100.0; } ]; diff --git a/machines/wakasu.nixos.nix b/machines/wakasu.nixos.nix @@ -69,7 +69,7 @@ with import ../assets/machines.nix; { syncthing.guiAddress = "0.0.0.0:8384"; smartd = { enable = true; - devices = [ { device = "/dev/nvme0n1"; } ]; + devices = [{ device = "/dev/nvme0n1"; }]; }; wireguard = { enable = true; diff --git a/modules/hardware/sane-extra-config.nixos.nix b/modules/hardware/sane-extra-config.nixos.nix @@ -3,26 +3,24 @@ with lib; let cfg = config.hardware.sane; - - pkg = if cfg.snapshot - then pkgs.sane-backends-git - else pkgs.sane-backends; - + pkg = + if cfg.snapshot + then pkgs.sane-backends-git + else pkgs.sane-backends; backends = [ pkg ] ++ cfg.extraBackends; - saneConfig = pkgs.mkSaneConfig { paths = backends; }; - - saneExtraConfig = pkgs.runCommand "sane-extra-config" {} '' + saneExtraConfig = pkgs.runCommand "sane-extra-config" { } '' cp -Lr '${pkgs.mkSaneConfig { paths = [ pkgs.sane-backends ]; }}'/etc/sane.d $out chmod +w $out - ${concatMapStrings ( - c: '' - f="$out/${c.name}.conf" - [ ! -e "$f" ] || chmod +w "$f" - cat ${builtins.toFile "" (c.value + "\n")} >>"$f" - chmod -w "$f" - '' - ) (mapAttrsToList nameValuePair cfg.extraConfig)} + ${concatMapStrings + ( + c: '' + f="$out/${c.name}.conf" + [ ! -e "$f" ] || chmod +w "$f" + cat ${builtins.toFile "" (c.value + "\n")} >>"$f" + chmod -w "$f" + '' + ) (mapAttrsToList nameValuePair cfg.extraConfig)} chmod -w $out ''; in @@ -30,12 +28,12 @@ in options = { hardware.sane.extraConfig = mkOption { type = types.attrsOf types.lines; - default = {}; + default = { }; example = { "some-backend" = "# some lines to add to its .conf"; }; }; }; - config = mkIf (cfg.enable && cfg.extraConfig != {}) { + config = mkIf (cfg.enable && cfg.extraConfig != { }) { hardware.sane.configDir = saneExtraConfig.outPath; }; } diff --git a/modules/profiles/audio.nix b/modules/profiles/audio.nix @@ -18,41 +18,42 @@ in }; }; }; - config = mkIf cfg.enable ( - mkMerge [ - { - services.shairport-sync.enable = cfg.shairport-sync; - } - ( - mkIf cfg.mpd.enable { - services.mpd = { - enable = true; - musicDirectory = cfg.mpd.musicDir; - network.listenAddress = "any"; - extraConfig = '' - audio_output { - type "pulse" - name "Local MPD" - } - ''; - }; - services.mpdris2 = { - enable = true; - mpd.host = "127.0.0.1"; - }; - home.packages = with pkgs; [ - mpc_cli - ncmpcpp - ]; + config = mkIf cfg.enable + ( + mkMerge [ + { + services.shairport-sync.enable = cfg.shairport-sync; } - ) - ( - mkIf (cfg.mpd.enable && config.profiles.desktop.enable) { - home.packages = with pkgs; [ - ario - ]; - } - ) - ] - ); + ( + mkIf cfg.mpd.enable { + services.mpd = { + enable = true; + musicDirectory = cfg.mpd.musicDir; + network.listenAddress = "any"; + extraConfig = '' + audio_output { + type "pulse" + name "Local MPD" + } + ''; + }; + services.mpdris2 = { + enable = true; + mpd.host = "127.0.0.1"; + }; + home.packages = with pkgs; [ + mpc_cli + ncmpcpp + ]; + } + ) + ( + mkIf (cfg.mpd.enable && config.profiles.desktop.enable) { + home.packages = with pkgs; [ + ario + ]; + } + ) + ] + ); } diff --git a/modules/profiles/desktop.nix b/modules/profiles/desktop.nix @@ -3,7 +3,6 @@ with lib; let cfg = config.profiles.desktop; - dim-screen = pkgs.writeScript "dim-sreen.sh" '' #!${pkgs.stdenv.shell} export PATH=${lib.getBin pkgs.xlibs.xbacklight}/bin:$PATH diff --git a/modules/profiles/dev.java.nix b/modules/profiles/dev.java.nix @@ -16,20 +16,21 @@ in idea = mkEnableOption "Install intellij idea"; }; }; - config = mkIf cfg.enable ( - mkMerge [ - { - profiles.dev.enable = true; - home.packages = with pkgs; [ - cfg.javaPackage - gradle - ]; - } - ( - mkIf cfg.idea { - home.packages = with pkgs; [ jetbrains.idea-ultimate ]; + config = mkIf cfg.enable + ( + mkMerge [ + { + profiles.dev.enable = true; + home.packages = with pkgs; [ + cfg.javaPackage + gradle + ]; } - ) - ] - ); + ( + mkIf cfg.idea { + home.packages = with pkgs; [ jetbrains.idea-ultimate ]; + } + ) + ] + ); } diff --git a/modules/profiles/dev.js.nix b/modules/profiles/dev.js.nix @@ -10,24 +10,25 @@ in enable = mkEnableOption "Enable js development profile"; }; }; - config = mkIf cfg.enable ( - mkMerge [ - { - home.file.".npmrc".text = '' - prefix = ${config.home.homeDirectory}/.local/npm - ''; - home.packages = with pkgs; [ - nodejs-10_x - yarn - ]; - } - ( - mkIf config.profiles.fish.enable { - xdg.configFile."fish/conf.d/js.fish".text = '' - set -gx PATH ${config.home.homeDirectory}/.local/npm/bin $PATH + config = mkIf cfg.enable + ( + mkMerge [ + { + home.file.".npmrc".text = '' + prefix = ${config.home.homeDirectory}/.local/npm ''; + home.packages = with pkgs; [ + nodejs-10_x + yarn + ]; } - ) - ] - ); + ( + mkIf config.profiles.fish.enable { + xdg.configFile."fish/conf.d/js.fish".text = '' + set -gx PATH ${config.home.homeDirectory}/.local/npm/bin $PATH + ''; + } + ) + ] + ); } diff --git a/modules/profiles/dev.nix b/modules/profiles/dev.nix @@ -10,50 +10,51 @@ in enable = mkEnableOption "Enable development profile"; }; }; - config = mkIf cfg.enable ( - mkMerge [ - { - profiles.git.enable = true; - profiles.emacs.enable = true; - home.file.".ignore".text = '' - *.swp - *~ - **/VENDOR-LICENSE - ''; - xdg.configFile."mr".source = ./assets/lib.mr; - home.file."src/.mrconfig".source = ./assets/src.mr; - home.file."src/knative.dev/.mrconfig".source = ./assets/src.knative.dev.mr; - home.file."src/github.com/.mrconfig".source = ./assets/src.github.mr; - home.file."src/github.com/openshift/.mrconfig".source = ./assets/src.github.openshift.mr; - home.file."src/pkgs.devel.redhat.com/.mrconfig".source = ./assets/src.pkgs.devel.redhat.mr; - home.packages = with pkgs; - [ - binutils - cmake - fswatch - gnumake - jq - mercurial - niv - ripgrep - shfmt - ]; - xdg.configFile."nr/dev" = { - text = builtins.toJSON [ - { cmd = "yq"; } - { cmd = "lnav"; } - { cmd = "miniserve"; } - { cmd = "licensor"; } - { cmd = "nix-review"; } - { cmd = "yamllint"; pkg = "python37Packages.yamllint"; } - { cmd = "nix-prefetch-git"; pkg = "nix-prefetch-scripts"; } - { cmd = "nix-prefetch-hg"; pkg = "nix-prefetch-scripts"; } - { cmd = "http"; pkg = "httpie"; } - ]; - onChange = "${pkgs.my.nr}/bin/nr dev"; - }; - services.lorri.enable = true; - } - ] - ); + config = mkIf cfg.enable + ( + mkMerge [ + { + profiles.git.enable = true; + profiles.emacs.enable = true; + home.file.".ignore".text = '' + *.swp + *~ + **/VENDOR-LICENSE + ''; + xdg.configFile."mr".source = ./assets/lib.mr; + home.file."src/.mrconfig".source = ./assets/src.mr; + home.file."src/knative.dev/.mrconfig".source = ./assets/src.knative.dev.mr; + home.file."src/github.com/.mrconfig".source = ./assets/src.github.mr; + home.file."src/github.com/openshift/.mrconfig".source = ./assets/src.github.openshift.mr; + home.file."src/pkgs.devel.redhat.com/.mrconfig".source = ./assets/src.pkgs.devel.redhat.mr; + home.packages = with pkgs; + [ + binutils + cmake + fswatch + gnumake + jq + mercurial + niv + ripgrep + shfmt + ]; + xdg.configFile."nr/dev" = { + text = builtins.toJSON [ + { cmd = "yq"; } + { cmd = "lnav"; } + { cmd = "miniserve"; } + { cmd = "licensor"; } + { cmd = "nix-review"; } + { cmd = "yamllint"; pkg = "python37Packages.yamllint"; } + { cmd = "nix-prefetch-git"; pkg = "nix-prefetch-scripts"; } + { cmd = "nix-prefetch-hg"; pkg = "nix-prefetch-scripts"; } + { cmd = "http"; pkg = "httpie"; } + ]; + onChange = "${pkgs.my.nr}/bin/nr dev"; + }; + services.lorri.enable = true; + } + ] + ); } diff --git a/modules/profiles/dev.rust.nix b/modules/profiles/dev.rust.nix @@ -10,22 +10,23 @@ in enable = mkEnableOption "Enable rust development profile"; }; }; - config = mkIf cfg.enable ( - mkMerge [ - { - profiles.dev.enable = true; - home.packages = with pkgs; [ - gcc - rustup - ]; - } - ( - mkIf config.profiles.emacs.enable { + config = mkIf cfg.enable + ( + mkMerge [ + { + profiles.dev.enable = true; home.packages = with pkgs; [ - rustracer + gcc + rustup ]; } - ) - ] - ); + ( + mkIf config.profiles.emacs.enable { + home.packages = with pkgs; [ + rustracer + ]; + } + ) + ] + ); } diff --git a/modules/profiles/direnv.nix b/modules/profiles/direnv.nix @@ -14,38 +14,39 @@ in }; }; }; - config = mkIf cfg.enable ( - mkMerge [ - { - programs.direnv = { - enable = true; - config = { - whitelist = { - prefix = [ - "${config.home.homeDirectory}/src/github.com/knative" - "${config.home.homeDirectory}/src/github.com/openshift" - "${config.home.homeDirectory}/src/github.com/tektoncd" - "${config.home.homeDirectory}/src/github.com/vdemeester" - ]; + config = mkIf cfg.enable + ( + mkMerge [ + { + programs.direnv = { + enable = true; + config = { + whitelist = { + prefix = [ + "${config.home.homeDirectory}/src/github.com/knative" + "${config.home.homeDirectory}/src/github.com/openshift" + "${config.home.homeDirectory}/src/github.com/tektoncd" + "${config.home.homeDirectory}/src/github.com/vdemeester" + ]; + }; }; }; - }; - } - ( - mkIf config.profiles.fish.enable { - programs.direnv.enableFishIntegration = true; } - ) - ( - mkIf config.profiles.zsh.enable { - programs.direnv.enableZshIntegration = true; - } - ) - ( - mkIf config.profiles.bash.enable { - programs.direnv.enableBashIntegration = true; - } - ) - ] - ); + ( + mkIf config.profiles.fish.enable { + programs.direnv.enableFishIntegration = true; + } + ) + ( + mkIf config.profiles.zsh.enable { + programs.direnv.enableZshIntegration = true; + } + ) + ( + mkIf config.profiles.bash.enable { + programs.direnv.enableBashIntegration = true; + } + ) + ] + ); } diff --git a/modules/profiles/docker.nix b/modules/profiles/docker.nix @@ -10,24 +10,25 @@ in enable = mkEnableOption "Enable docker profile"; }; }; - config = mkIf cfg.enable ( - mkMerge [ - { - home.packages = with pkgs; [ - docker - docker-machine - docker-machine-kvm - docker-machine-kvm2 - docker-compose - ]; - } - ( - mkIf config.profiles.fish.enable { - xdg.configFile."fish/conf.d/docker.fish".text = '' - # set -gx DOCKER_BUILDKIT 1 - ''; + config = mkIf cfg.enable + ( + mkMerge [ + { + home.packages = with pkgs; [ + docker + docker-machine + docker-machine-kvm + docker-machine-kvm2 + docker-compose + ]; } - ) - ] - ); + ( + mkIf config.profiles.fish.enable { + xdg.configFile."fish/conf.d/docker.fish".text = '' + # set -gx DOCKER_BUILDKIT 1 + ''; + } + ) + ] + ); } diff --git a/modules/profiles/emacs.nix b/modules/profiles/emacs.nix @@ -3,7 +3,6 @@ with lib; let cfg = config.profiles.emacs; - capture = pkgs.writeScriptBin "capture" '' #!${pkgs.stdenv.shell} emacsclient -s /run/user/1000/emacs/org -n -F '((name . "capture") (width . 150) (height . 90))' -e '(org-capture)' @@ -27,172 +26,173 @@ in }; }; }; - config = mkIf cfg.enable ( - mkMerge [ - { - home.file.".local/share/applications/org-protocol.desktop".source = ./assets/xorg/org-protocol.desktop; - home.file.".local/share/applications/ec.desktop".source = ./assets/xorg/ec.desktop; - home.file.".local/share/applications/capture.desktop".source = ./assets/xorg/capture.desktop; - home.packages = with pkgs; [ - ditaa - graphviz - pandoc - zip - hunspell - hunspellDicts.en_US-large - hunspellDicts.en_GB-ize - hunspellDicts.fr-any - nixpkgs-fmt - ]; - home.sessionVariables = { - EDITOR = "et"; - ALTERNATE_EDITOR = "et"; - }; - programs.emacs = { - enable = true; - package = pkgs.emacs27.override { inherit (pkgs) imagemagick; withXwidgets = cfg.withXwidgets; }; - extraPackages = epkgs: with epkgs; [ - ace-window - aggressive-indent - async - avy - bbdb - beginend - pkgs.bookmark-plus - company - company-emoji - company-go - dash - delight - dired-collapse - dired-git-info - dired-quick-sort - dired-narrow - dired-rsync - pkgs.dired-plus - direnv - dockerfile-mode - easy-kill - esup - expand-region - flycheck - flycheck-golangci-lint - git-annex - git-commit - gitattributes-mode - gitconfig-mode - gitignore-mode - github-review - goto-last-change - hardhat - helpful - highlight - highlight-indentation - highlight-numbers - ibuffer-vc - iedit - json-mode - markdown-mode - #modus-operandi-theme - #modus-vivendi-theme - mpdel - multiple-cursors + config = mkIf cfg.enable + ( + mkMerge [ + { + home.file.".local/share/applications/org-protocol.desktop".source = ./assets/xorg/org-protocol.desktop; + home.file.".local/share/applications/ec.desktop".source = ./assets/xorg/ec.desktop; + home.file.".local/share/applications/capture.desktop".source = ./assets/xorg/capture.desktop; + home.packages = with pkgs; [ + ditaa + graphviz + pandoc + zip + hunspell + hunspellDicts.en_US-large + hunspellDicts.en_GB-ize + hunspellDicts.fr-any nixpkgs-fmt - no-littering - ob-async - ob-go - ob-http - orgit - org-plus-contrib - org-capture-pop-frame - org-gcal - org-ref - org-super-agenda - org-web-tools - ox-pandoc - pandoc-mode - projectile - projectile-ripgrep - pdf-tools - python-mode - rainbow-delimiters - rainbow-mode - region-bindings-mode - ripgrep - rg - try - visual-fill-column - visual-regexp - web-mode - wgrep - with-editor - xterm-color - yaml-mode - darkroom - eshell-prompt-extras - esh-autosuggest - forge - go-mode - magit - magit-annex - magit-popup - minions - moody - mwim - nix-buffer - nix-mode - org-super-agenda - org-tree-slide - shr-tag-pre-highlight - ssh-config-mode - smartparens - symbol-overlay - undo-tree - use-package - # Highly experimental - vterm - gotest ]; - }; - } - ( - mkIf config.profiles.emacs.capture { - home.packages = with pkgs; [ wmctrl capture ]; - } - ) - ( - mkIf config.services.gpg-agent.enable { - #services.gpg-agent.extraConfig = '' - # allow-emacs-pinentry - #''; - } - ) - ( - mkIf cfg.texlive { - home.packages = with pkgs; [ texlive.combined.scheme-full ]; - } - ) - ( - mkIf cfg.daemonService { - systemd.user.services.emacs = { - Unit = { - Description = "Emacs: the extensible, self-documenting text editor"; - }; - Service = { - Environment = '' - PATH=${config.home.homeDirectory}/.nix-profile/bin:${config.home.homeDirectory}/.local/npm/bin:/run/wrappers/bin:/etc/profiles/per-user/vincent/bin:${config.home.profileDirectory}/bin:/nix/var/nix/profiles/default/bin:/run/current-system/sw/bin:/usr/share/Modules/bin:/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:${config.home.homeDirectory}/bin GOPATH=${config.home.homeDirectory} NIX_PATH=${config.home.homeDirectory}/.nix-defexpr/channels:nixpkgs=/home/vincent/.nix-defexpr/channels/nixpkgs ASPELL_CONF=dict-dir=${config.home.homeDirectory}/.nix-profile/lib/aspell SSH_AUTH_SOCK=/run/user/1000/gnupg/S.gpg-agent.ssh NIX_SSL_CERT_FILE=/etc/ssl/certs/ca-bundle.crt - ''; - Type = "forking"; - ExecStart = "${pkgs.bash}/bin/bash -c 'source /etc/profile; exec ${config.home.homeDirectory}/.nix-profile/bin/emacs --dump-file=${config.home.homeDirectory}/.config/emacs/emacs.pdmp --daemon=org'"; - ExecStop = "${config.home.homeDirectory}/.nix-profile/bin/emacsclient --eval (kill-emacs)"; - Restart = "always"; - }; - Install = { - WantedBy = [ "default.target" ]; - }; + home.sessionVariables = { + EDITOR = "et"; + ALTERNATE_EDITOR = "et"; + }; + programs.emacs = { + enable = true; + package = pkgs.emacs27.override { inherit (pkgs) imagemagick; withXwidgets = cfg.withXwidgets; }; + extraPackages = epkgs: with epkgs; [ + ace-window + aggressive-indent + async + avy + bbdb + beginend + pkgs.bookmark-plus + company + company-emoji + company-go + dash + delight + dired-collapse + dired-git-info + dired-quick-sort + dired-narrow + dired-rsync + pkgs.dired-plus + direnv + dockerfile-mode + easy-kill + esup + expand-region + flycheck + flycheck-golangci-lint + git-annex + git-commit + gitattributes-mode + gitconfig-mode + gitignore-mode + github-review + goto-last-change + hardhat + helpful + highlight + highlight-indentation + highlight-numbers + ibuffer-vc + iedit + json-mode + markdown-mode + #modus-operandi-theme + #modus-vivendi-theme + mpdel + multiple-cursors + nixpkgs-fmt + no-littering + ob-async + ob-go + ob-http + orgit + org-plus-contrib + org-capture-pop-frame + org-gcal + org-ref + org-super-agenda + org-web-tools + ox-pandoc + pandoc-mode + projectile + projectile-ripgrep + pdf-tools + python-mode + rainbow-delimiters + rainbow-mode + region-bindings-mode + ripgrep + rg + try + visual-fill-column + visual-regexp + web-mode + wgrep + with-editor + xterm-color + yaml-mode + darkroom + eshell-prompt-extras + esh-autosuggest + forge + go-mode + magit + magit-annex + magit-popup + minions + moody + mwim + nix-buffer + nix-mode + org-super-agenda + org-tree-slide + shr-tag-pre-highlight + ssh-config-mode + smartparens + symbol-overlay + undo-tree + use-package + # Highly experimental + vterm + gotest + ]; }; } - ) - ] - ); + ( + mkIf config.profiles.emacs.capture { + home.packages = with pkgs; [ wmctrl capture ]; + } + ) + ( + mkIf config.services.gpg-agent.enable { + #services.gpg-agent.extraConfig = '' + # allow-emacs-pinentry + #''; + } + ) + ( + mkIf cfg.texlive { + home.packages = with pkgs; [ texlive.combined.scheme-full ]; + } + ) + ( + mkIf cfg.daemonService { + systemd.user.services.emacs = { + Unit = { + Description = "Emacs: the extensible, self-documenting text editor"; + }; + Service = { + Environment = '' + PATH=${config.home.homeDirectory}/.nix-profile/bin:${config.home.homeDirectory}/.local/npm/bin:/run/wrappers/bin:/etc/profiles/per-user/vincent/bin:${config.home.profileDirectory}/bin:/nix/var/nix/profiles/default/bin:/run/current-system/sw/bin:/usr/share/Modules/bin:/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:${config.home.homeDirectory}/bin GOPATH=${config.home.homeDirectory} NIX_PATH=${config.home.homeDirectory}/.nix-defexpr/channels:nixpkgs=/home/vincent/.nix-defexpr/channels/nixpkgs ASPELL_CONF=dict-dir=${config.home.homeDirectory}/.nix-profile/lib/aspell SSH_AUTH_SOCK=/run/user/1000/gnupg/S.gpg-agent.ssh NIX_SSL_CERT_FILE=/etc/ssl/certs/ca-bundle.crt + ''; + Type = "forking"; + ExecStart = "${pkgs.bash}/bin/bash -c 'source /etc/profile; exec ${config.home.homeDirectory}/.nix-profile/bin/emacs --dump-file=${config.home.homeDirectory}/.config/emacs/emacs.pdmp --daemon=org'"; + ExecStop = "${config.home.homeDirectory}/.nix-profile/bin/emacsclient --eval (kill-emacs)"; + Restart = "always"; + }; + Install = { + WantedBy = [ "default.target" ]; + }; + }; + } + ) + ] + ); } diff --git a/modules/profiles/git.nix b/modules/profiles/git.nix @@ -11,212 +11,213 @@ in enable = mkEnableOption "Enable git profile"; }; }; - config = mkIf cfg.enable ( - mkMerge [ - { - home.packages = with pkgs; [ - gist - git-lfs - gitAndTools.git-annex - gitAndTools.hub - mr - my.prm - my.ape - ]; - programs.git = { - enable = true; - package = pkgs.gitAndTools.gitFull; - - userName = "Vincent Demeester"; - userEmail = "vincent@sbr.pm"; + config = mkIf cfg.enable + ( + mkMerge [ + { + home.packages = with pkgs; [ + gist + git-lfs + gitAndTools.git-annex + gitAndTools.hub + mr + my.prm + my.ape + ]; + programs.git = { + enable = true; + package = pkgs.gitAndTools.gitFull; - signing = { - key = "6EB699A3"; - signByDefault = false; - }; + userName = "Vincent Demeester"; + userEmail = "vincent@sbr.pm"; - aliases = { - b = "branch --color -v"; - br = "branch"; - ci = "commit --signoff"; - co = "checkout"; - conflicts = "!git ls-files --unmerged | cut -c51- | sort -u | xargs $EDITOR"; - ca = "commit --amend"; - wdiff = "diff --color-words"; - unstage = "reset HEAD"; - lg = "log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr)%Creset' --abbrev-commit --date=relative"; - lga = "log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr)%Creset' --abbrev-commit --date=relative --branches --remotes"; - lol = "log --pretty=oneline --abbrev-commit --graph --decorate"; - ls-ignored = "ls-files --exclude-standard --ignored --others"; - resolve = "!git ls-files --unmerged | cut -c51- | sort -u | xargs git add"; - su = "submodule update --init --recursive"; - st = "status"; - w = "status -sb"; - }; - attributes = [ - "*.org diff=org" - ]; - extraConfig = { - core = { - editor = "${pkgs.emacs}/bin/emacsclient -t"; - }; - color = { - status = "auto"; - diff = "auto"; - branch = "auto"; - interactive = "auto"; - ui = "auto"; - sh = "auto"; - }; - "color.branch" = { - current = "cyan reverse"; - local = "cyan"; - remote = "green"; - }; - "color.diff" = { - current = "white reverse"; - frag = "magenta reverse"; - old = "red"; - new = "green"; - }; - "color.status" = { - added = "green"; - changed = "yellow"; - untracked = "red"; - }; - "diff.org" = { - xfuncname = "\"^\\\\*+.*\""; - }; - forge = { - remote = "upstream"; - }; - hub = { - protocol = true; + signing = { + key = "6EB699A3"; + signByDefault = false; }; - pull = { - rebase = true; - }; - push = { - default = "upstream"; - recurseSubmodules = "check"; - }; - rebase = { - autosquash = true; - }; - advice = { - statusHints = false; - pushNonFastForward = false; - }; - http = { - sslCAinfo = "${ca-bundle_crt}"; - sslverify = true; + + aliases = { + b = "branch --color -v"; + br = "branch"; + ci = "commit --signoff"; + co = "checkout"; + conflicts = "!git ls-files --unmerged | cut -c51- | sort -u | xargs $EDITOR"; + ca = "commit --amend"; + wdiff = "diff --color-words"; + unstage = "reset HEAD"; + lg = "log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr)%Creset' --abbrev-commit --date=relative"; + lga = "log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr)%Creset' --abbrev-commit --date=relative --branches --remotes"; + lol = "log --pretty=oneline --abbrev-commit --graph --decorate"; + ls-ignored = "ls-files --exclude-standard --ignored --others"; + resolve = "!git ls-files --unmerged | cut -c51- | sort -u | xargs git add"; + su = "submodule update --init --recursive"; + st = "status"; + w = "status -sb"; }; - github.user = "vdemeester"; - "filter \"lfs\"" = { - clean = "${pkgs.git-lfs}/bin/git-lfs clean -- %f"; - smudge = "${pkgs.git-lfs}/bin/git-lfs smudge --skip -- %f"; - required = true; + attributes = [ + "*.org diff=org" + ]; + extraConfig = { + core = { + editor = "${pkgs.emacs}/bin/emacsclient -t"; + }; + color = { + status = "auto"; + diff = "auto"; + branch = "auto"; + interactive = "auto"; + ui = "auto"; + sh = "auto"; + }; + "color.branch" = { + current = "cyan reverse"; + local = "cyan"; + remote = "green"; + }; + "color.diff" = { + current = "white reverse"; + frag = "magenta reverse"; + old = "red"; + new = "green"; + }; + "color.status" = { + added = "green"; + changed = "yellow"; + untracked = "red"; + }; + "diff.org" = { + xfuncname = "\"^\\\\*+.*\""; + }; + forge = { + remote = "upstream"; + }; + hub = { + protocol = true; + }; + pull = { + rebase = true; + }; + push = { + default = "upstream"; + recurseSubmodules = "check"; + }; + rebase = { + autosquash = true; + }; + advice = { + statusHints = false; + pushNonFastForward = false; + }; + http = { + sslCAinfo = "${ca-bundle_crt}"; + sslverify = true; + }; + github.user = "vdemeester"; + "filter \"lfs\"" = { + clean = "${pkgs.git-lfs}/bin/git-lfs clean -- %f"; + smudge = "${pkgs.git-lfs}/bin/git-lfs smudge --skip -- %f"; + required = true; + }; + "url \"git@github.com:\"".insteadOf = "git://github.com/"; }; - "url \"git@github.com:\"".insteadOf = "git://github.com/"; - }; - includes = [ - { - path = "${config.xdg.configHome}/git/config.d/redhat.gitconfig"; - condition = "gitdir:${config.home.homeDirectory}/src/github.com/kubernetes/"; - } - { - path = "${config.xdg.configHome}/git/config.d/redhat.gitconfig"; - condition = "gitdir:${config.home.homeDirectory}/src/k8s.io/"; - } - { - path = "${config.xdg.configHome}/git/config.d/redhat.gitconfig"; - condition = "gitdir:${config.home.homeDirectory}/src/github.com/knative/"; - } - { - path = "${config.xdg.configHome}/git/config.d/redhat.gitconfig"; - condition = "gitdir:${config.home.homeDirectory}/src/github.com/tektoncd/"; - } - { - path = "${config.xdg.configHome}/git/config.d/redhat.gitconfig"; - condition = "gitdir/i:${config.home.homeDirectory}/src/github.com/google**"; - } - { - path = "${config.xdg.configHome}/git/config.d/redhat.gitconfig"; - condition = "gitdir:${config.home.homeDirectory}/src/k8s.io/"; - } - { - path = "${config.xdg.configHome}/git/config.d/redhat.gitconfig"; - condition = "gitdir:${config.home.homeDirectory}/src/github.com/minishift/"; - } - { - path = "${config.xdg.configHome}/git/config.d/redhat.gitconfig"; - condition = "gitdir:${config.home.homeDirectory}/src/github.com/operator-framework/"; - } - { - path = "${config.xdg.configHome}/git/config.d/redhat.gitconfig"; - condition = "gitdir:${config.home.homeDirectory}/src/github.com/openshift**"; - } - { - path = "${config.xdg.configHome}/git/config.d/redhat.gitconfig"; - condition = "gitdir:${config.home.homeDirectory}/src/github.com/redhat**"; - } - { - path = "${config.xdg.configHome}/git/config.d/redhat.gitconfig"; - condition = "gitdir:${config.home.homeDirectory}/src/github.com/containers/"; - } - { - path = "${config.xdg.configHome}/git/config.d/redhat.gitconfig"; - condition = "gitdir:${config.home.homeDirectory}/src/gitlab.cee.redhat.com/"; - } - { - path = "${config.xdg.configHome}/git/config.d/redhat.gitconfig"; - condition = "gitdir:${config.home.homeDirectory}/src/gitlab.corp.redhat.com/"; - } - { - path = "${config.xdg.configHome}/git/config.d/redhat.gitconfig"; - condition = "gitdir:${config.home.homeDirectory}/src/pkg.devel.redhat.com/"; - } - ]; - ignores = [ - "*.elc" - "*.vo" - "*.aux" - "*.v.d" - "*.o" - "*.a" - "*.la" - "*.so" - "*.dylib" - "*.pyc" - "*.pyo" - ".idea" - "*.iml" - "*~" - "#*#" - ".makefile" - ".clean" - ]; - }; - xdg.configFile."git/config.d/redhat.gitconfig".source = ./assets/git/redhat.gitconfig; - xdg.configFile."nr/git" = { - text = builtins.toJSON [ - { cmd = "tig"; } - { cmd = "grv"; pkg = "gitAndTools.grv"; } - { cmd = "git-appraise"; pkg = "gitAndTools.git-appraise"; chan = "unstable"; } - ]; - onChange = "${pkgs.my.nr}/bin/nr git"; - }; - } - ( - mkIf config.profiles.fish.enable { - programs.fish.shellAbbrs = { - gs = "git status"; - gb = "git b"; - gfr = "git fetch -p --all;and git rebase -S --autostash"; + includes = [ + { + path = "${config.xdg.configHome}/git/config.d/redhat.gitconfig"; + condition = "gitdir:${config.home.homeDirectory}/src/github.com/kubernetes/"; + } + { + path = "${config.xdg.configHome}/git/config.d/redhat.gitconfig"; + condition = "gitdir:${config.home.homeDirectory}/src/k8s.io/"; + } + { + path = "${config.xdg.configHome}/git/config.d/redhat.gitconfig"; + condition = "gitdir:${config.home.homeDirectory}/src/github.com/knative/"; + } + { + path = "${config.xdg.configHome}/git/config.d/redhat.gitconfig"; + condition = "gitdir:${config.home.homeDirectory}/src/github.com/tektoncd/"; + } + { + path = "${config.xdg.configHome}/git/config.d/redhat.gitconfig"; + condition = "gitdir/i:${config.home.homeDirectory}/src/github.com/google**"; + } + { + path = "${config.xdg.configHome}/git/config.d/redhat.gitconfig"; + condition = "gitdir:${config.home.homeDirectory}/src/k8s.io/"; + } + { + path = "${config.xdg.configHome}/git/config.d/redhat.gitconfig"; + condition = "gitdir:${config.home.homeDirectory}/src/github.com/minishift/"; + } + { + path = "${config.xdg.configHome}/git/config.d/redhat.gitconfig"; + condition = "gitdir:${config.home.homeDirectory}/src/github.com/operator-framework/"; + } + { + path = "${config.xdg.configHome}/git/config.d/redhat.gitconfig"; + condition = "gitdir:${config.home.homeDirectory}/src/github.com/openshift**"; + } + { + path = "${config.xdg.configHome}/git/config.d/redhat.gitconfig"; + condition = "gitdir:${config.home.homeDirectory}/src/github.com/redhat**"; + } + { + path = "${config.xdg.configHome}/git/config.d/redhat.gitconfig"; + condition = "gitdir:${config.home.homeDirectory}/src/github.com/containers/"; + } + { + path = "${config.xdg.configHome}/git/config.d/redhat.gitconfig"; + condition = "gitdir:${config.home.homeDirectory}/src/gitlab.cee.redhat.com/"; + } + { + path = "${config.xdg.configHome}/git/config.d/redhat.gitconfig"; + condition = "gitdir:${config.home.homeDirectory}/src/gitlab.corp.redhat.com/"; + } + { + path = "${config.xdg.configHome}/git/config.d/redhat.gitconfig"; + condition = "gitdir:${config.home.homeDirectory}/src/pkg.devel.redhat.com/"; + } + ]; + ignores = [ + "*.elc" + "*.vo" + "*.aux" + "*.v.d" + "*.o" + "*.a" + "*.la" + "*.so" + "*.dylib" + "*.pyc" + "*.pyo" + ".idea" + "*.iml" + "*~" + "#*#" + ".makefile" + ".clean" + ]; + }; + xdg.configFile."git/config.d/redhat.gitconfig".source = ./assets/git/redhat.gitconfig; + xdg.configFile."nr/git" = { + text = builtins.toJSON [ + { cmd = "tig"; } + { cmd = "grv"; pkg = "gitAndTools.grv"; } + { cmd = "git-appraise"; pkg = "gitAndTools.git-appraise"; chan = "unstable"; } + ]; + onChange = "${pkgs.my.nr}/bin/nr git"; }; } - ) - ] - ); + ( + mkIf config.profiles.fish.enable { + programs.fish.shellAbbrs = { + gs = "git status"; + gb = "git b"; + gfr = "git fetch -p --all;and git rebase -S --autostash"; + }; + } + ) + ] + ); } diff --git a/modules/profiles/i3.nix b/modules/profiles/i3.nix @@ -141,7 +141,7 @@ in "Mod4+Shift+39" = "exec ~/.screenlayout/home-work.sh && systemctl --user start random-background.service"; "Mod4+24" = "border toggle"; }; - modes = {}; + modes = { }; bars = [ { mode = "hide"; diff --git a/modules/profiles/kubernetes.nix b/modules/profiles/kubernetes.nix @@ -26,65 +26,66 @@ in }; }; }; - config = mkIf cfg.enable ( - mkMerge [ - { - home.file.".local/share/applications/chos4.desktop".source = ../../assets/chos4.desktop; - profiles.containers.enable = cfg.containers; - home.packages = with pkgs; [ - #cri-tools - kail - kustomize - kube-prompt - kubectx - my.oc - #my.openshift-install - my.operator-sdk - my.ko - my.kss - my.kubernix - ]; - } - ( - mkIf cfg.nr { - xdg.configFile."nr/kubernetes" = { - text = builtins.toJSON [ - { cmd = "kubectl"; } - ]; - onChange = "${pkgs.my.nr}/bin/nr -force kubernetes"; - }; - } - ) - ( - mkIf cfg.krew { - home.packages = with pkgs; [ my.krew ]; - } - ) - ( - mkIf config.profiles.zsh.enable { - home.file."${config.programs.zsh.dotDir}/functions/_kubectl".source = ./assets/zsh/_kubectl; - } - ) - ( - mkIf cfg.minikube.enable { - home.packages = with pkgs; [ - cfg.minikube.package - docker-machine-kvm2 - ]; - } - ) - ( - mkIf cfg.kind { + config = mkIf cfg.enable + ( + mkMerge [ + { + home.file.".local/share/applications/chos4.desktop".source = ../../assets/chos4.desktop; + profiles.containers.enable = cfg.containers; home.packages = with pkgs; [ - kind + #cri-tools + kail + kustomize + kube-prompt + kubectx + my.oc + #my.openshift-install + my.operator-sdk + my.ko + my.kss + my.kubernix ]; } - ) - ( - mkIf (!config.profiles.containers.openshift.enable) { - home.packages = with pkgs; [ kubectl ]; - } - ) - ] - ); + ( + mkIf cfg.nr { + xdg.configFile."nr/kubernetes" = { + text = builtins.toJSON [ + { cmd = "kubectl"; } + ]; + onChange = "${pkgs.my.nr}/bin/nr -force kubernetes"; + }; + } + ) + ( + mkIf cfg.krew { + home.packages = with pkgs; [ my.krew ]; + } + ) + ( + mkIf config.profiles.zsh.enable { + home.file."${config.programs.zsh.dotDir}/functions/_kubectl".source = ./assets/zsh/_kubectl; + } + ) + ( + mkIf cfg.minikube.enable { + home.packages = with pkgs; [ + cfg.minikube.package + docker-machine-kvm2 + ]; + } + ) + ( + mkIf cfg.kind { + home.packages = with pkgs; [ + kind + ]; + } + ) + ( + mkIf (!config.profiles.containers.openshift.enable) { + home.packages = with pkgs; [ kubectl ]; + } + ) + ] + ); } diff --git a/modules/profiles/mails.nix b/modules/profiles/mails.nix @@ -20,193 +20,194 @@ in }; }; - config = mkIf cfg.enable ( - mkMerge [ - { - - accounts.email = { - maildirBasePath = "desktop/mails"; - accounts = { - "redhat" = { - address = "vdemeest@redhat.com"; - userName = "vdemeest@redhat.com"; - realName = "Vincent Demeester"; - passwordCommand = "${pkgs.gnupg}/bin/gpg -q --for-your-eyes-only --no-tty --exit-on-status-write-error --batch --passphrase-file ${config.home.homeDirectory}/sync/rh.pass -d ${config.home.homeDirectory}/desktop/documents/rh.pass.gpg"; - imap.host = "imap.gmail.com"; - smtp.host = "smtp.gmail.com"; - mbsync = { - enable = true; - create = "both"; - expunge = "both"; - patterns = [ "*" "![Gmail]*" "[Gmail]/Sent Mail" "[Gmail]/Starred" "[Gmail]/All Mail" ]; - extraConfig = { - channel = { - Sync = "All"; - }; - account = { - Timeout = 120; - PipelineDepth = 1; + config = mkIf cfg.enable + ( + mkMerge [ + { + + accounts.email = { + maildirBasePath = "desktop/mails"; + accounts = { + "redhat" = { + address = "vdemeest@redhat.com"; + userName = "vdemeest@redhat.com"; + realName = "Vincent Demeester"; + passwordCommand = "${pkgs.gnupg}/bin/gpg -q --for-your-eyes-only --no-tty --exit-on-status-write-error --batch --passphrase-file ${config.home.homeDirectory}/sync/rh.pass -d ${config.home.homeDirectory}/desktop/documents/rh.pass.gpg"; + imap.host = "imap.gmail.com"; + smtp.host = "smtp.gmail.com"; + mbsync = { + enable = true; + create = "both"; + expunge = "both"; + patterns = [ "*" "![Gmail]*" "[Gmail]/Sent Mail" "[Gmail]/Starred" "[Gmail]/All Mail" ]; + extraConfig = { + channel = { + Sync = "All"; + }; + account = { + Timeout = 120; + PipelineDepth = 1; + }; }; }; + notmuch.enable = cfg.sync; + astroid.enable = cfg.sync; + msmtp.enable = true; }; - notmuch.enable = cfg.sync; - astroid.enable = cfg.sync; - msmtp.enable = true; - }; - "perso" = { - address = "vinc.demeester@gmail.com"; - userName = "vinc.demeester@gmail.com"; - realName = "Vincent Demeester"; - passwordCommand = "${pkgs.gnupg}/bin/gpg -q --for-your-eyes-only --no-tty --exit-on-status-write-error --batch --passphrase-file ${config.home.homeDirectory}/sync/perso.pass -d ${config.home.homeDirectory}/desktop/documents/perso.pass.gpg"; - imap.host = "imap.gmail.com"; - smtp.host = "smtp.gmail.com"; - mbsync = { - enable = true; - create = "both"; - expunge = "both"; - patterns = [ "*" "![Gmail]*" "[Gmail]/Sent Mail" "[Gmail]/Starred" "[Gmail]/All Mail" ]; - extraConfig = { - channel = { - Sync = "All"; - }; - account = { - Timeout = 120; - PipelineDepth = 1; + "perso" = { + address = "vinc.demeester@gmail.com"; + userName = "vinc.demeester@gmail.com"; + realName = "Vincent Demeester"; + passwordCommand = "${pkgs.gnupg}/bin/gpg -q --for-your-eyes-only --no-tty --exit-on-status-write-error --batch --passphrase-file ${config.home.homeDirectory}/sync/perso.pass -d ${config.home.homeDirectory}/desktop/documents/perso.pass.gpg"; + imap.host = "imap.gmail.com"; + smtp.host = "smtp.gmail.com"; + mbsync = { + enable = true; + create = "both"; + expunge = "both"; + patterns = [ "*" "![Gmail]*" "[Gmail]/Sent Mail" "[Gmail]/Starred" "[Gmail]/All Mail" ]; + extraConfig = { + channel = { + Sync = "All"; + }; + account = { + Timeout = 120; + PipelineDepth = 1; + }; }; }; + notmuch.enable = cfg.sync; + astroid.enable = cfg.sync; + msmtp.enable = true; }; - notmuch.enable = cfg.sync; - astroid.enable = cfg.sync; - msmtp.enable = true; - }; - "prv" = { - primary = true; - address = "vincent@demeester.fr"; - userName = "vincent@demeester.fr"; - realName = "Vincent Demeester"; - passwordCommand = "${pkgs.gnupg}/bin/gpg -q --for-your-eyes-only --no-tty --exit-on-status-write-error --batch --passphrase-file ${config.home.homeDirectory}/sync/prv.pass -d ${config.home.homeDirectory}/desktop/documents/prv.pass.gpg"; - imap.host = "mail.gandi.net"; - smtp.host = "mail.gandi.net"; - mbsync = { - enable = true; - create = "both"; - expunge = "both"; - patterns = [ "*" ]; - extraConfig = { - channel = { - Sync = "All"; - }; - account = { - Timeout = 120; - PipelineDepth = 1; + "prv" = { + primary = true; + address = "vincent@demeester.fr"; + userName = "vincent@demeester.fr"; + realName = "Vincent Demeester"; + passwordCommand = "${pkgs.gnupg}/bin/gpg -q --for-your-eyes-only --no-tty --exit-on-status-write-error --batch --passphrase-file ${config.home.homeDirectory}/sync/prv.pass -d ${config.home.homeDirectory}/desktop/documents/prv.pass.gpg"; + imap.host = "mail.gandi.net"; + smtp.host = "mail.gandi.net"; + mbsync = { + enable = true; + create = "both"; + expunge = "both"; + patterns = [ "*" ]; + extraConfig = { + channel = { + Sync = "All"; + }; + account = { + Timeout = 120; + PipelineDepth = 1; + }; }; }; + notmuch.enable = cfg.sync; + astroid.enable = cfg.sync; + msmtp.enable = true; }; - notmuch.enable = cfg.sync; - astroid.enable = cfg.sync; - msmtp.enable = true; }; }; - }; - - home.file."bin/msmtp" = { - text = '' - #!${pkgs.stdenv.shell} - ${pkgs.libnotify}/bin/notify-send "Sending mail ✉️" - ${pkgs.msmtp}/bin/msmtp --read-envelope-from $@ - ''; - executable = true; - }; - - programs.msmtp.enable = true; - - } - - ( - mkIf cfg.sync { - - services.mbsync = { - enable = true; - preExec = "${config.xdg.configHome}/mbsync/preExec"; - postExec = "${config.xdg.configHome}/mbsync/postExec"; - frequency = cfg.frequency; - }; - xdg.configFile."mbsync/preExec" = { + home.file."bin/msmtp" = { text = '' #!${pkgs.stdenv.shell} - - export NOTMUCH_CONFIG=${config.xdg.configHome}/notmuch/notmuchrc - export NMBGIT=${config.xdg.dataHome}/notmuch/nmbug - - ${pkgs.coreutils}/bin/mkdir -p ${config.home.homeDirectory}/desktop/mails/redhat ${config.home.homeDirectory}/desktop/mails/perso - ${pkgs.afew}/bin/afew -C ${config.xdg.configHome}/notmuch/notmuchrc -m -v + ${pkgs.libnotify}/bin/notify-send "Sending mail ✉️" + ${pkgs.msmtp}/bin/msmtp --read-envelope-from $@ ''; executable = true; }; - xdg.configFile."mbsync/postExec" = { - text = '' - #!${pkgs.stdenv.shell} + programs.msmtp.enable = true; - export NOTMUCH_CONFIG=${config.xdg.configHome}/notmuch/notmuchrc - export NMBGIT=${config.xdg.dataHome}/notmuch/nmbug + } - ${pkgs.notmuch}/bin/notmuch new - ${pkgs.afew}/bin/afew -C ${config.xdg.configHome}/notmuch/notmuchrc --tag --new -v - # Remove inbox (lower-case) - ${pkgs.notmuch}/bin/notmuch tag -inbox -- tag:inbox - # Remove Inbox tagged message that are not in an Inbox - ${pkgs.notmuch}/bin/notmuch tag -Inbox -- not folder:redhat/Inbox and not folder:perso/Inbox and tag:Inbox - ${pkgs.libnotify}/bin/notify-send "Mails synced 📬" - ''; - executable = true; - }; + ( + mkIf cfg.sync { - home.file."bin/msync" = { - text = '' - #!${pkgs.stdenv.shell} - ${pkgs.libnotify}/bin/notify-send "Syncing mails 📫️" - systemctl --user start mbsync - ''; - executable = true; - }; + services.mbsync = { + enable = true; + preExec = "${config.xdg.configHome}/mbsync/preExec"; + postExec = "${config.xdg.configHome}/mbsync/postExec"; + frequency = cfg.frequency; + }; - programs.mbsync.enable = true; - programs.notmuch.enable = true; - - programs.afew = { - enable = true; - extraConfig = '' - [SpamFilter] - [KillThreadsFilter] - [ListMailsFilter] - [ArchiveSentMailsFilter] - [FolderNameFilter] - maildir_separator = / - - [MailMover] - folders = perso/Inbox redhat/Inbox - rename = true - - perso/Inbox = 'NOT tag:Inbox':"perso/[Gmail]/All Mail" - redhat/Inbox = 'NOT tag:Inbox':"redhat/[Gmail]/All Mail" - ''; - }; + xdg.configFile."mbsync/preExec" = { + text = '' + #!${pkgs.stdenv.shell} + + export NOTMUCH_CONFIG=${config.xdg.configHome}/notmuch/notmuchrc + export NMBGIT=${config.xdg.dataHome}/notmuch/nmbug - programs.astroid = { - enable = true; - externalEditor = "emacsclient -c"; - extraConfig = { - startup.queries.inbox = "tag:Inbox"; - startup.queries.inbox_perso = "folder:perso/Inbox"; - startup.queries.inbox_redhat = "folder:redhat/Inbox"; + ${pkgs.coreutils}/bin/mkdir -p ${config.home.homeDirectory}/desktop/mails/redhat ${config.home.homeDirectory}/desktop/mails/perso + ${pkgs.afew}/bin/afew -C ${config.xdg.configHome}/notmuch/notmuchrc -m -v + ''; + executable = true; }; - }; - } - ) + xdg.configFile."mbsync/postExec" = { + text = '' + #!${pkgs.stdenv.shell} + + export NOTMUCH_CONFIG=${config.xdg.configHome}/notmuch/notmuchrc + export NMBGIT=${config.xdg.dataHome}/notmuch/nmbug + + ${pkgs.notmuch}/bin/notmuch new + ${pkgs.afew}/bin/afew -C ${config.xdg.configHome}/notmuch/notmuchrc --tag --new -v + # Remove inbox (lower-case) + ${pkgs.notmuch}/bin/notmuch tag -inbox -- tag:inbox + # Remove Inbox tagged message that are not in an Inbox + ${pkgs.notmuch}/bin/notmuch tag -Inbox -- not folder:redhat/Inbox and not folder:perso/Inbox and tag:Inbox + ${pkgs.libnotify}/bin/notify-send "Mails synced 📬" + ''; + executable = true; + }; + + home.file."bin/msync" = { + text = '' + #!${pkgs.stdenv.shell} + ${pkgs.libnotify}/bin/notify-send "Syncing mails 📫️" + systemctl --user start mbsync + ''; + executable = true; + }; + + programs.mbsync.enable = true; + programs.notmuch.enable = true; + + programs.afew = { + enable = true; + extraConfig = '' + [SpamFilter] + [KillThreadsFilter] + [ListMailsFilter] + [ArchiveSentMailsFilter] + [FolderNameFilter] + maildir_separator = / + + [MailMover] + folders = perso/Inbox redhat/Inbox + rename = true + + perso/Inbox = 'NOT tag:Inbox':"perso/[Gmail]/All Mail" + redhat/Inbox = 'NOT tag:Inbox':"redhat/[Gmail]/All Mail" + ''; + }; + + programs.astroid = { + enable = true; + externalEditor = "emacsclient -c"; + extraConfig = { + startup.queries.inbox = "tag:Inbox"; + startup.queries.inbox_perso = "folder:perso/Inbox"; + startup.queries.inbox_redhat = "folder:redhat/Inbox"; + }; + }; + + } + ) - ] - ); + ] + ); } diff --git a/modules/profiles/media.nix b/modules/profiles/media.nix @@ -10,16 +10,17 @@ in enable = mkEnableOption "Enable media configuration"; }; }; - config = mkIf cfg.enable ( - mkMerge [ - { - home.packages = with pkgs; [ youtube-dl ]; - } - ( - mkIf config.profiles.desktop.enable { - home.packages = with pkgs; [ spotify ]; + config = mkIf cfg.enable + ( + mkMerge [ + { + home.packages = with pkgs; [ youtube-dl ]; } - ) - ] - ); + ( + mkIf config.profiles.desktop.enable { + home.packages = with pkgs; [ spotify ]; + } + ) + ] + ); } diff --git a/modules/profiles/nix-auto-update.nixos.nix b/modules/profiles/nix-auto-update.nixos.nix @@ -29,37 +29,38 @@ in }; }; }; - config = mkIf cfg.enable ( - mkMerge [ - { - system = { - stateVersion = cfg.version; - }; - } - ( - mkIf cfg.autoUpgrade { - systemd.services.nixos-update = { - description = "NixOS Upgrade"; - unitConfig.X-StopOnRemoval = false; - restartIfChanged = false; - serviceConfig.Type = "oneshot"; - environment = config.nix.envVars - // { - inherit (config.environment.sessionVariables) NIX_PATH; - HOME = "/root"; - }; - path = [ pkgs.gnutar pkgs.xz pkgs.git pkgs.gnumake config.nix.package.out pkgs.commonsCompress ]; - script = '' - export PATH=/run/current-system/sw/bin - cd /etc/nixos/ - runuser -l vincent -c 'git pull --autostash --rebase' - make update switch - ''; - startAt = cfg.dates; - onFailure = [ "status-email-root@%n.service" ]; + config = mkIf cfg.enable + ( + mkMerge [ + { + system = { + stateVersion = cfg.version; }; } - ) - ] - ); + ( + mkIf cfg.autoUpgrade { + systemd.services.nixos-update = { + description = "NixOS Upgrade"; + unitConfig.X-StopOnRemoval = false; + restartIfChanged = false; + serviceConfig.Type = "oneshot"; + environment = config.nix.envVars + // { + inherit (config.environment.sessionVariables) NIX_PATH; + HOME = "/root"; + }; + path = [ pkgs.gnutar pkgs.xz pkgs.git pkgs.gnumake config.nix.package.out pkgs.commonsCompress ]; + script = '' + export PATH=/run/current-system/sw/bin + cd /etc/nixos/ + runuser -l vincent -c 'git pull --autostash --rebase' + make update switch + ''; + startAt = cfg.dates; + onFailure = [ "status-email-root@%n.service" ]; + }; + } + ) + ] + ); } diff --git a/modules/profiles/openshift.nix b/modules/profiles/openshift.nix @@ -23,24 +23,25 @@ in }; }; }; - config = mkIf cfg.enable ( - mkMerge [ - { - profiles.containers.kubernetes.enable = true; - home.packages = with pkgs; [ - my.s2i - cfg.package - ]; - } - ( - mkIf cfg.minishift.enable { + config = mkIf cfg.enable + ( + mkMerge [ + { + profiles.containers.kubernetes.enable = true; home.packages = with pkgs; [ - cfg.minishift.package - docker-machine-kvm - docker-machine-kvm2 + my.s2i + cfg.package ]; } - ) - ] - ); + ( + mkIf cfg.minishift.enable { + home.packages = with pkgs; [ + cfg.minishift.package + docker-machine-kvm + docker-machine-kvm2 + ]; + } + ) + ] + ); } diff --git a/modules/profiles/qemu.nixos.nix b/modules/profiles/qemu.nixos.nix @@ -29,7 +29,7 @@ in nix.supportedPlatforms = mkOption { type = types.listOf types.str; description = "extra platforms that nix will run binaries for"; - default = []; + default = [ ]; }; }; config = mkIf (cfg.arm || cfg.aarch64) { @@ -41,7 +41,7 @@ in // optionalAttrs cfg.aarch64 { inherit aarch64; } // optionalAttrs cfg.riscv64 { inherit riscv64; }; nix.supportedPlatforms = (optionals cfg.arm [ "armv6l-linux" "armv7l-linux" ]) - ++ (optional cfg.aarch64 "aarch64-linux"); + ++ (optional cfg.aarch64 "aarch64-linux"); nix.extraOptions = '' extra-platforms = ${toString config.nix.supportedPlatforms} i686-linux ''; diff --git a/modules/profiles/ssh.nix b/modules/profiles/ssh.nix @@ -13,7 +13,7 @@ in type = types.bool; }; machines = mkOption { - default = {}; + default = { }; type = types.attrs; }; }; diff --git a/modules/profiles/users.nixos.nix b/modules/profiles/users.nixos.nix @@ -28,15 +28,15 @@ in uid = 1000; createHome = true; extraGroups = [ "wheel" "input" ] ++ optionals config.profiles.desktop.enable [ "audio" "video" "lp" "scanner" "networkmanager" ] - ++ optionals config.profiles.docker.enable [ "docker" ] - ++ optionals config.profiles.buildkit.enable [ "buildkit" ] - ++ optionals config.profiles.virtualization.enable [ "libvirtd" "vboxusers" ]; + ++ optionals config.profiles.docker.enable [ "docker" ] + ++ optionals config.profiles.buildkit.enable [ "buildkit" ] + ++ optionals config.profiles.virtualization.enable [ "libvirtd" "vboxusers" ]; shell = if config.programs.fish.enable then pkgs.fish else pkgs.zsh; initialPassword = "changeMe"; openssh.authorizedKeys.keys = with import ../../assets/machines.nix; [ ssh.yubikey.key ssh.yubikey5.key ssh.wakasu.key ssh.vincent.key ssh.houbeb.key ssh.hokkaido.key ssh.okinawa.key ]; - subUidRanges = [ { startUid = 100000; count = 65536; } ]; - subGidRanges = [ { startGid = 100000; count = 65536; } ]; + subUidRanges = [{ startUid = 100000; count = 65536; }]; + subGidRanges = [{ startGid = 100000; count = 65536; }]; }; }; }; diff --git a/modules/profiles/virtualization.nixos.nix b/modules/profiles/virtualization.nixos.nix @@ -24,46 +24,47 @@ in }; }; }; - config = mkIf cfg.enable ( - mkMerge [ - { - virtualisation.libvirtd = { - enable = true; - }; - environment.systemPackages = with pkgs; [ - qemu - vde2 - libosinfo - ]; - } - ( - mkIf cfg.nested { - environment.etc."modprobe.d/kvm.conf".text = '' - options kvm_intel nested=1 - ''; - } - ) - ( - mkIf config.profiles.desktop.enable { - environment.systemPackages = with pkgs; [ virtmanager ]; - } - ) - ( - mkIf cfg.listenTCP { - boot.kernel.sysctl = { "net.ipv4.ip_forward" = 1; }; + config = mkIf cfg.enable + ( + mkMerge [ + { virtualisation.libvirtd = { - allowedBridges = [ "br1" ]; - extraConfig = '' - listen_tls = 0 - listen_tcp = 1 - auth_tcp="none" - tcp_port = "16509" - ''; - # extraOptions = [ "--listen" ]; + enable = true; }; - networking.firewall.allowedTCPPorts = [ 16509 ]; + environment.systemPackages = with pkgs; [ + qemu + vde2 + libosinfo + ]; } - ) - ] - ); + ( + mkIf cfg.nested { + environment.etc."modprobe.d/kvm.conf".text = '' + options kvm_intel nested=1 + ''; + } + ) + ( + mkIf config.profiles.desktop.enable { + environment.systemPackages = with pkgs; [ virtmanager ]; + } + ) + ( + mkIf cfg.listenTCP { + boot.kernel.sysctl = { "net.ipv4.ip_forward" = 1; }; + virtualisation.libvirtd = { + allowedBridges = [ "br1" ]; + extraConfig = '' + listen_tls = 0 + listen_tcp = 1 + auth_tcp="none" + tcp_port = "16509" + ''; + # extraOptions = [ "--listen" ]; + }; + networking.firewall.allowedTCPPorts = [ 16509 ]; + } + ) + ] + ); } diff --git a/modules/profiles/zsh.nix b/modules/profiles/zsh.nix @@ -14,163 +14,164 @@ in }; }; }; - config = mkIf cfg.enable ( - mkMerge [ - { - home.packages = with pkgs; [ - zsh-syntax-highlighting - nix-zsh-completions - ]; - home.file."${config.programs.zsh.dotDir}/completion.zsh".source = ./assets/zsh/completion.zsh; - home.file."${config.programs.zsh.dotDir}/prompt.zsh".source = ./assets/zsh/prompt.zsh; - home.file."${config.programs.zsh.dotDir}/functions/j".source = ./assets/zsh/j; - programs.zsh = { - enable = true; - dotDir = ".config/zsh"; - autocd = true; - defaultKeymap = "emacs"; - enableAutosuggestions = true; - history = { - size = 100000; - expireDuplicatesFirst = true; - ignoreDups = true; + config = mkIf cfg.enable + ( + mkMerge [ + { + home.packages = with pkgs; [ + zsh-syntax-highlighting + nix-zsh-completions + ]; + home.file."${config.programs.zsh.dotDir}/completion.zsh".source = ./assets/zsh/completion.zsh; + home.file."${config.programs.zsh.dotDir}/prompt.zsh".source = ./assets/zsh/prompt.zsh; + home.file."${config.programs.zsh.dotDir}/functions/j".source = ./assets/zsh/j; + programs.zsh = { + enable = true; + dotDir = ".config/zsh"; + autocd = true; + defaultKeymap = "emacs"; + enableAutosuggestions = true; + history = { + size = 100000; + expireDuplicatesFirst = true; + ignoreDups = true; + }; + localVariables = { + EMOJI_CLI_KEYBIND = "^n"; + EMOJI_CLI_USE_EMOJI = "yes"; + ZSH_HIGHLIGHT_HIGHLIGHTERS = [ "main" "brackets" "pattern" ]; + }; + shellAliases = import ./aliases.shell.nix; + plugins = [ + { + name = "emoji-cli"; + src = pkgs.fetchFromGitHub { + owner = "b4b4r07"; + repo = "emoji-cli"; + rev = "26e2d67d566bfcc741891c8e063a00e0674abc92"; + sha256 = "0n88w4k5vaz1iyikpmlzdrrkxmfn91x5s4q405k1fxargr1w6bmx"; + }; + } + { + name = "zsh-z"; + src = pkgs.fetchFromGitHub { + owner = "agkozak"; + repo = "zsh-z"; + rev = "5b903f8f5489783ee2a4af668a941b7d9a02efc9"; + sha256 = "07h6ksiqgqyf5m84hv5xf4jcqrl8q1cj8wd4z52cjmy82kk10fkn"; + }; + } + { + name = "async"; + src = pkgs.fetchFromGitHub { + owner = "mafredri"; + repo = "zsh-async"; + rev = "v1.7.0"; + sha256 = "1jbbypgn0r4pilhv2s2p11vbkkvlnf75wrhxfcvr7bfjpzyp9wbc"; + }; + } + { + name = "zsh-completions"; + src = pkgs.fetchFromGitHub { + owner = "zsh-users"; + repo = "zsh-completions"; + rev = "922eee0706acb111e9678ac62ee77801941d6df2"; + sha256 = "04skzxv8j06f1snsx62qnca5f2183w0wfs5kz78rs8hkcyd6g89w"; + }; + } + { + name = "powerlevel10k"; + src = pkgs.fetchFromGitHub { + owner = "romkatv"; + repo = "powerlevel10k"; + rev = "700910cd0421a7d25d2800cefa76eb6d80dc62a8"; + sha256 = "011ja4r3a8vbcs42js9nri4p8pi8z4ccqxl2qyf52pn3pfnidigj"; + }; + } + { + name = "zsh-nix-shell"; + src = pkgs.fetchFromGitHub { + owner = "chisui"; + repo = "zsh-nix-shell"; + rev = "v0.1.0"; + sha256 = "0snhch9hfy83d4amkyxx33izvkhbwmindy0zjjk28hih1a9l2jmx"; + }; + } + ]; + envExtra = '' + export GOPATH=${config.home.homeDirectory} + export WEBKIT_DISABLE_COMPOSITING_MODE=1; + export PATH=$HOME/bin:$PATH + if [ -d $HOME/.krew/bin ]; then + export PATH=$HOME/.krew/bin:$PATH + fi + ''; + loginExtra = '' + export GOPATH=${config.home.homeDirectory} + ''; + initExtra = '' + path+="$HOME/${config.programs.zsh.dotDir}/functions" + fpath+="$HOME/.nix-profile/share/zsh/site-functions" + fpath+="$HOME/${config.programs.zsh.dotDir}/functions" + for func ($HOME/${config.programs.zsh.dotDir}/functions) autoload -U $func/*(x:t) + autoload -Uz select-word-style; select-word-style bash + if [ -e /home/vincent/.nix-profile/etc/profile.d/nix.sh ]; then . /home/vincent/.nix-profile/etc/profile.d/nix.sh; fi + #if [ -n "$INSIDE_EMACS" ]; then + # chpwd() { print -P "\033AnSiTc %d" } + # print -P "\033AnSiTu %n" + # print -P "\033AnSiTc %d" + #fi + if [[ "$TERM" == "dumb" || "$TERM" == "emacs" ]] + then + TERM=eterm-color + unsetopt zle + unsetopt prompt_cr + unsetopt prompt_subst + unfunction precmd + unfunction preexec + PS1='$ ' + return + fi + # make sure navigation using emacs keybindings works on all non-alphanumerics + # syntax highlighting + source $HOME/${config.programs.zsh.dotDir}/plugins/zsh-nix-shell/nix-shell.plugin.zsh + source ${pkgs.zsh-syntax-highlighting}/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh + ZSH_HIGHLIGHT_PATTERNS+=('rm -rf *' 'fg=white,bold,bg=red') + ZSH_HIGHLIGHT_PATTERNS+=('rm -fR *' 'fg=white,bold,bg=red') + ZSH_HIGHLIGHT_PATTERNS+=('rm -fr *' 'fg=white,bold,bg=red') + source $HOME/${config.programs.zsh.dotDir}/completion.zsh + source $HOME/${config.programs.zsh.dotDir}/plugins/powerlevel10k/powerlevel10k.zsh-theme + source $HOME/${config.programs.zsh.dotDir}/prompt.zsh + setopt hist_ignore_space + alias -g L="|less" + alias -g EEL=' 2>&1 | less' + alias -g GB='`git rev-parse --abbrev-ref HEAD`' + alias -g GR='`git rev-parse --show-toplevel`' + (( $+commands[jq] )) && alias -g MJ="| jq -C '.'" || alias -g MJ="| ${pkgs.python3}/bin/python -mjson.tool" + ''; + profileExtra = '' + if [ -e /home/vincent/.nix-profile/etc/profile.d/nix.sh ]; then . /home/vincent/.nix-profile/etc/profile.d/nix.sh; fi + export NIX_PATH=$HOME/.nix-defexpr/channels:$NIX_PATH + ''; }; - localVariables = { - EMOJI_CLI_KEYBIND = "^n"; - EMOJI_CLI_USE_EMOJI = "yes"; - ZSH_HIGHLIGHT_HIGHLIGHTERS = [ "main" "brackets" "pattern" ]; + programs.fzf = { + enable = true; + enableZshIntegration = true; + defaultOptions = [ "--bind=ctrl-j:accept" ]; }; - shellAliases = import ./aliases.shell.nix; - plugins = [ - { - name = "emoji-cli"; - src = pkgs.fetchFromGitHub { - owner = "b4b4r07"; - repo = "emoji-cli"; - rev = "26e2d67d566bfcc741891c8e063a00e0674abc92"; - sha256 = "0n88w4k5vaz1iyikpmlzdrrkxmfn91x5s4q405k1fxargr1w6bmx"; - }; - } - { - name = "zsh-z"; - src = pkgs.fetchFromGitHub { - owner = "agkozak"; - repo = "zsh-z"; - rev = "5b903f8f5489783ee2a4af668a941b7d9a02efc9"; - sha256 = "07h6ksiqgqyf5m84hv5xf4jcqrl8q1cj8wd4z52cjmy82kk10fkn"; - }; - } - { - name = "async"; - src = pkgs.fetchFromGitHub { - owner = "mafredri"; - repo = "zsh-async"; - rev = "v1.7.0"; - sha256 = "1jbbypgn0r4pilhv2s2p11vbkkvlnf75wrhxfcvr7bfjpzyp9wbc"; - }; - } - { - name = "zsh-completions"; - src = pkgs.fetchFromGitHub { - owner = "zsh-users"; - repo = "zsh-completions"; - rev = "922eee0706acb111e9678ac62ee77801941d6df2"; - sha256 = "04skzxv8j06f1snsx62qnca5f2183w0wfs5kz78rs8hkcyd6g89w"; - }; - } - { - name = "powerlevel10k"; - src = pkgs.fetchFromGitHub { - owner = "romkatv"; - repo = "powerlevel10k"; - rev = "700910cd0421a7d25d2800cefa76eb6d80dc62a8"; - sha256 = "011ja4r3a8vbcs42js9nri4p8pi8z4ccqxl2qyf52pn3pfnidigj"; - }; - } - { - name = "zsh-nix-shell"; - src = pkgs.fetchFromGitHub { - owner = "chisui"; - repo = "zsh-nix-shell"; - rev = "v0.1.0"; - sha256 = "0snhch9hfy83d4amkyxx33izvkhbwmindy0zjjk28hih1a9l2jmx"; - }; - } - ]; - envExtra = '' - export GOPATH=${config.home.homeDirectory} - export WEBKIT_DISABLE_COMPOSITING_MODE=1; - export PATH=$HOME/bin:$PATH - if [ -d $HOME/.krew/bin ]; then - export PATH=$HOME/.krew/bin:$PATH - fi - ''; - loginExtra = '' - export GOPATH=${config.home.homeDirectory} - ''; - initExtra = '' - path+="$HOME/${config.programs.zsh.dotDir}/functions" - fpath+="$HOME/.nix-profile/share/zsh/site-functions" - fpath+="$HOME/${config.programs.zsh.dotDir}/functions" - for func ($HOME/${config.programs.zsh.dotDir}/functions) autoload -U $func/*(x:t) - autoload -Uz select-word-style; select-word-style bash - if [ -e /home/vincent/.nix-profile/etc/profile.d/nix.sh ]; then . /home/vincent/.nix-profile/etc/profile.d/nix.sh; fi - #if [ -n "$INSIDE_EMACS" ]; then - # chpwd() { print -P "\033AnSiTc %d" } - # print -P "\033AnSiTu %n" - # print -P "\033AnSiTc %d" - #fi - if [[ "$TERM" == "dumb" || "$TERM" == "emacs" ]] - then - TERM=eterm-color - unsetopt zle - unsetopt prompt_cr - unsetopt prompt_subst - unfunction precmd - unfunction preexec - PS1='$ ' - return - fi - # make sure navigation using emacs keybindings works on all non-alphanumerics - # syntax highlighting - source $HOME/${config.programs.zsh.dotDir}/plugins/zsh-nix-shell/nix-shell.plugin.zsh - source ${pkgs.zsh-syntax-highlighting}/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh - ZSH_HIGHLIGHT_PATTERNS+=('rm -rf *' 'fg=white,bold,bg=red') - ZSH_HIGHLIGHT_PATTERNS+=('rm -fR *' 'fg=white,bold,bg=red') - ZSH_HIGHLIGHT_PATTERNS+=('rm -fr *' 'fg=white,bold,bg=red') - source $HOME/${config.programs.zsh.dotDir}/completion.zsh - source $HOME/${config.programs.zsh.dotDir}/plugins/powerlevel10k/powerlevel10k.zsh-theme - source $HOME/${config.programs.zsh.dotDir}/prompt.zsh - setopt hist_ignore_space - alias -g L="|less" - alias -g EEL=' 2>&1 | less' - alias -g GB='`git rev-parse --abbrev-ref HEAD`' - alias -g GR='`git rev-parse --show-toplevel`' - (( $+commands[jq] )) && alias -g MJ="| jq -C '.'" || alias -g MJ="| ${pkgs.python3}/bin/python -mjson.tool" - ''; - profileExtra = '' - if [ -e /home/vincent/.nix-profile/etc/profile.d/nix.sh ]; then . /home/vincent/.nix-profile/etc/profile.d/nix.sh; fi - export NIX_PATH=$HOME/.nix-defexpr/channels:$NIX_PATH - ''; - }; - programs.fzf = { - enable = true; - enableZshIntegration = true; - defaultOptions = [ "--bind=ctrl-j:accept" ]; - }; - } - ( - mkIf config.profiles.emacs.enable { - /*programs.zsh.initExtra = '' - export EDITOR=et - '';*/ - } - ) - ( - mkIf config.machine.home-manager { - home.packages = with pkgs; [ hello ]; } - ) - ] - ); + ( + mkIf config.profiles.emacs.enable { + /*programs.zsh.initExtra = '' + export EDITOR=et + '';*/ + } + ) + ( + mkIf config.machine.home-manager { + home.packages = with pkgs; [ hello ]; + } + ) + ] + ); } diff --git a/modules/services/nix-binary-cache.nixos.nix b/modules/services/nix-binary-cache.nixos.nix @@ -17,7 +17,7 @@ in type = types.str; }; aliases = mkOption { - default = []; + default = [ ]; description = "server aliases to serve"; type = types.listOf types.str; }; diff --git a/modules/virtualisation/containerd.nixos.nix b/modules/virtualisation/containerd.nixos.nix @@ -3,38 +3,36 @@ { config, lib, pkgs, ... }: with lib; - let cfg = config.virtualisation.containerd; in - { ###### interface options.virtualisation.containerd = { enable = mkOption { - type = types.bool; - default = false; - description = - '' - This option enables containerd, a daemon that manages - linux containers. - ''; - }; + type = types.bool; + default = false; + description = + '' + This option enables containerd, a daemon that manages + linux containers. + ''; + }; listenOptions = mkOption { - type = types.listOf types.str; - default = ["/run/containerd/containerd.sock"]; - description = - '' - A list of unix and tcp containerd should listen to. The format follows - ListenStream as described in systemd.socket(5). - ''; - }; + type = types.listOf types.str; + default = [ "/run/containerd/containerd.sock" ]; + description = + '' + A list of unix and tcp containerd should listen to. The format follows + ListenStream as described in systemd.socket(5). + ''; + }; package = mkOption { default = pkgs.containerd; @@ -53,33 +51,34 @@ in extraOptions = mkOption { - type = types.separatedString " "; - default = ""; - description = - '' - The extra command-line options to pass to - <command>containerd</command> daemon. - ''; - }; + type = types.separatedString " "; + default = ""; + description = + '' + The extra command-line options to pass to + <command>containerd</command> daemon. + ''; + }; }; ###### implementation config = mkIf cfg.enable { - environment.systemPackages = [ cfg.package]; - systemd.packages = [ cfg.package]; + environment.systemPackages = [ cfg.package ]; + systemd.packages = [ cfg.package ]; systemd.services.containerd = { wantedBy = [ "multi-user.target" ]; serviceConfig = { ExecStart = [ "" - '' - ${cfg.package}/bin/containerd \ - ${cfg.extraOptions} - '']; + '' + ${cfg.package}/bin/containerd \ + ${cfg.extraOptions} + '' + ]; }; - path = [cfg.package] ++ cfg.packages; + path = [ cfg.package ] ++ cfg.packages; }; diff --git a/overlays/emacs/builder.nix b/overlays/emacs/builder.nix @@ -2,8 +2,8 @@ , emacs , name , src -, buildInputs ? [] -, patches ? [] +, buildInputs ? [ ] +, patches ? [ ] , preBuild ? "" }: @@ -16,7 +16,7 @@ stdenv.mkDerivation { buildPhase = '' ${preBuild} ARGS=$(find ${stdenv.lib.concatStrings - (builtins.map (arg: arg + "/share/emacs/site-lisp ") buildInputs)} \ + (builtins.map (arg: arg + "/share/emacs/site-lisp ") buildInputs)} \ -type d -exec echo -L {} \;) mkdir $out export HOME=$out diff --git a/overlays/sbr.nix b/overlays/sbr.nix @@ -19,24 +19,25 @@ rec { inherit (self) stdenv lib; }; - my = import ../pkgs {}; + my = import ../pkgs { }; - emacs27 = (self.emacs.override { srcRepo = true; }).overrideAttrs ( - old: { - name = "emacs-dev"; - version = "27.0.91"; - src = super.fetchFromGitHub { - owner = "emacs-mirror"; - repo = "emacs"; - rev = "emacs-27.0.91"; - sha256 = "0mlrg2npy1r79laahkgzhxd1qassfcdz8qk1cpw7mqgf6y5x505h"; - }; - buildInputs = old.buildInputs ++ [ super.jansson ]; - patches = [ - ./patches/clean-env.patch - ]; - } - ); + emacs27 = (self.emacs.override { srcRepo = true; }).overrideAttrs + ( + old: { + name = "emacs-dev"; + version = "27.0.91"; + src = super.fetchFromGitHub { + owner = "emacs-mirror"; + repo = "emacs"; + rev = "emacs-27.0.91"; + sha256 = "0mlrg2npy1r79laahkgzhxd1qassfcdz8qk1cpw7mqgf6y5x505h"; + }; + buildInputs = old.buildInputs ++ [ super.jansson ]; + patches = [ + ./patches/clean-env.patch + ]; + } + ); bookmark-plus = compileEmacsFiles { name = "bookmark-plus"; diff --git a/overlays/unstable.nix b/overlays/unstable.nix @@ -1,7 +1,7 @@ _: _: let unstableTarball = fetchTarball https://github.com/NixOS/nixpkgs-channels/archive/nixos-unstable.tar.gz; - unstable = import unstableTarball { overlays = []; }; + unstable = import unstableTarball { overlays = [ ]; }; in { inherit (unstable) diff --git a/pkgs/buildkit/default.nix b/pkgs/buildkit/default.nix @@ -7,10 +7,11 @@ buildGoPackage rec { goPackagePath = "github.com/moby/buildkit"; subPackages = [ "cmd/buildctl" "cmd/buildkitd" ]; - buildFlagsArray = let t = "${goPackagePath}/version"; in '' - -ldflags= - -X ${t}.Version=${version} - ''; + buildFlagsArray = let t = "${goPackagePath}/version"; in + '' + -ldflags= + -X ${t}.Version=${version} + ''; src = fetchFromGitHub { inherit rev; diff --git a/pkgs/containerd/default.nix b/pkgs/containerd/default.nix @@ -23,8 +23,8 @@ rec { buildFlags = [ "VERSION=v${version}" ]; - BUILDTAGS = [] - ++ optional (btrfs-progs == null) "no_btrfs"; + BUILDTAGS = [ ] + ++ optional (btrfs-progs == null) "no_btrfs"; buildPhase = '' cd go/src/${goPackagePath} diff --git a/pkgs/crc/default.nix b/pkgs/crc/default.nix @@ -8,32 +8,33 @@ rec { , bundle }: - buildGoPackage rec { - pname = "crc"; - name = "${pname}-${version}"; + buildGoPackage rec { + pname = "crc"; + name = "${pname}-${version}"; - src = fetchFromGitHub { - owner = "code-ready"; - repo = "crc"; - rev = "${version}"; - sha256 = "${sha256}"; - }; + src = fetchFromGitHub { + owner = "code-ready"; + repo = "crc"; + rev = "${version}"; + sha256 = "${sha256}"; + }; - goPackagePath = "github.com/code-ready/crc"; - subPackages = [ "cmd/crc" ]; - buildFlagsArray = let t = "${goPackagePath}/pkg/crc/version"; in '' + goPackagePath = "github.com/code-ready/crc"; + subPackages = [ "cmd/crc" ]; + buildFlagsArray = let t = "${goPackagePath}/pkg/crc/version"; in + '' -ldflags= -X ${t}.crcVersion=${version} -X ${t}.bundleVersion=${bundle} ''; - meta = with stdenv.lib; { - homepage = https://github.com/code-ready/crc; - description = "OpenShift 4.x cluster for testing and development purposes"; - license = licenses.asl20; - maintainers = with maintainers; [ vdemeester ]; - }; + meta = with stdenv.lib; { + homepage = https://github.com/code-ready/crc; + description = "OpenShift 4.x cluster for testing and development purposes"; + license = licenses.asl20; + maintainers = with maintainers; [ vdemeester ]; }; + }; # bundle is https://storage.googleapis.com/crc-bundle-github-ci/crc_libvirt_4.4.3.zip crc_1_9 = makeOverridable crcGen { diff --git a/pkgs/oc/default.nix b/pkgs/oc/default.nix @@ -7,36 +7,36 @@ rec { , sha256 }: - stdenv.mkDerivation rec { - pname = "oc"; - name = "${pname}-${version}"; + stdenv.mkDerivation rec { + pname = "oc"; + name = "${pname}-${version}"; - src = fetchurl { - url = "https://mirror.openshift.com/pub/openshift-v4/clients/ocp/${version}/openshift-client-linux-${version}.tar.gz"; - sha256 = "${sha256}"; - }; + src = fetchurl { + url = "https://mirror.openshift.com/pub/openshift-v4/clients/ocp/${version}/openshift-client-linux-${version}.tar.gz"; + sha256 = "${sha256}"; + }; - phases = " unpackPhase installPhase fixupPhase "; + phases = " unpackPhase installPhase fixupPhase "; - unpackPhase = '' - runHook preUnpack - mkdir ${name} - tar -C ${name} -xzf $src - ''; + unpackPhase = '' + runHook preUnpack + mkdir ${name} + tar -C ${name} -xzf $src + ''; - installPhase = '' - runHook preInstall - install -D ${name}/oc $out/bin/oc - patchelf \ - --set-interpreter $(cat $NIX_CC/nix-support/dynamic-linker) \ - $out/bin/oc - # completions - mkdir -p $out/share/bash-completion/completions/ - $out/bin/oc completion bash > $out/share/bash-completion/completions/oc - mkdir -p $out/share/zsh/site-functions - $out/bin/oc completion zsh > $out/share/zsh/site-functions/_oc - ''; - }; + installPhase = '' + runHook preInstall + install -D ${name}/oc $out/bin/oc + patchelf \ + --set-interpreter $(cat $NIX_CC/nix-support/dynamic-linker) \ + $out/bin/oc + # completions + mkdir -p $out/share/bash-completion/completions/ + $out/bin/oc completion bash > $out/share/bash-completion/completions/oc + mkdir -p $out/share/zsh/site-functions + $out/bin/oc completion zsh > $out/share/zsh/site-functions/_oc + ''; + }; oc_4_4 = makeOverridable ocGen { version = "4.4.1"; diff --git a/pkgs/operator-sdk/default.nix b/pkgs/operator-sdk/default.nix @@ -8,43 +8,44 @@ rec { , modSha256 }: - buildGoModule rec { - inherit modSha256; - pname = "operator-sdk"; - name = "${pname}-${version}"; - rev = "v${version}"; - - builtInputs = [ "git" ]; - - goPackagePath = "github.com/operator-framework/operator-sdk"; - subPackages = [ "cmd/operator-sdk" ]; - buildFlagsArray = let t = "${goPackagePath}/version"; in '' + buildGoModule rec { + inherit modSha256; + pname = "operator-sdk"; + name = "${pname}-${version}"; + rev = "v${version}"; + + builtInputs = [ "git" ]; + + goPackagePath = "github.com/operator-framework/operator-sdk"; + subPackages = [ "cmd/operator-sdk" ]; + buildFlagsArray = let t = "${goPackagePath}/version"; in + '' -ldflags= -X ${t}.GitVersion=${version} -X ${t}.KubernetesVersion=v1.17.2 ''; - src = fetchFromGitHub { - inherit rev; - owner = "operator-framework"; - repo = "operator-sdk"; - sha256 = "${sha256}"; - }; - - postInstall = '' - # completions - mkdir -p $out/share/bash-completion/completions/ - $out/bin/operator-sdk completion bash > $out/share/bash-completion/completions/operator-sdk - mkdir -p $out/share/zsh/site-functions/ - $out/bin/operator-sdk completion zsh > $out/share/zsh/site-functions/_operator-sdk - ''; + src = fetchFromGitHub { + inherit rev; + owner = "operator-framework"; + repo = "operator-sdk"; + sha256 = "${sha256}"; + }; - meta = { - description = "SDK for building Kubernetes applications. Provides high level APIs, useful abstractions, and project scaffolding"; - homepage = https://github.com/operator-framework/operator-sdk; - license = lib.licenses.asl20; - }; + postInstall = '' + # completions + mkdir -p $out/share/bash-completion/completions/ + $out/bin/operator-sdk completion bash > $out/share/bash-completion/completions/operator-sdk + mkdir -p $out/share/zsh/site-functions/ + $out/bin/operator-sdk completion zsh > $out/share/zsh/site-functions/_operator-sdk + ''; + + meta = { + description = "SDK for building Kubernetes applications. Provides high level APIs, useful abstractions, and project scaffolding"; + homepage = https://github.com/operator-framework/operator-sdk; + license = lib.licenses.asl20; }; + }; operator-sdk_0_16 = makeOverridable operatorSdkGen { version = "0.16.0"; diff --git a/pkgs/prm/default.nix b/pkgs/prm/default.nix @@ -7,11 +7,12 @@ buildGoModule rec { goPackagePath = "github.com/ldez/prm"; - buildFlagsArray = let t = "${goPackagePath}/meta"; in '' - -ldflags= - -X ${t}.Version=${version} - -X ${t}.BuildDate=unknown - ''; + buildFlagsArray = let t = "${goPackagePath}/meta"; in + '' + -ldflags= + -X ${t}.Version=${version} + -X ${t}.BuildDate=unknown + ''; src = fetchFromGitHub { inherit rev; diff --git a/pkgs/tkn/default.nix b/pkgs/tkn/default.nix @@ -9,10 +9,11 @@ rec { goPackagePath = "github.com/tektoncd/cli"; subPackages = [ "cmd/tkn" ]; - buildFlagsArray = let t = "${goPackagePath}/pkg/cmd/version"; in '' - -ldflags= - -X ${t}.clientVersion=${version} - ''; + buildFlagsArray = let t = "${goPackagePath}/pkg/cmd/version"; in + '' + -ldflags= + -X ${t}.clientVersion=${version} + ''; src = fetchFromGitHub { owner = "tektoncd"; repo = "cli"; diff --git a/pkgs/vscodeliveshare/default.nix b/pkgs/vscodeliveshare/default.nix @@ -33,12 +33,13 @@ in sha256 = "1y24q5id9hkgdndh2v8z1rpw736bi16yk66n260s44qd3w5yss8r"; }; } -).overrideAttrs ( - attrs: +).overrideAttrs + ( + attrs: { buildInputs = attrs.buildInputs - ++ [ autoPatchelfHook ] - ++ [ icu curl lttng-ust xorg.libX11 ]; + ++ [ autoPatchelfHook ] + ++ [ icu curl lttng-ust xorg.libX11 ]; installPhase = attrs.installPhase + '' @@ -89,4 +90,4 @@ in propagatedBuildInputs = with gnome3; [ gnome-keyring ]; } -) + ) diff --git a/tmp/channels.nix b/tmp/channels.nix @@ -1,28 +1,35 @@ -let mapAttrs = f: set: builtins.listToAttrs ( -map (attr: { name = attr; value = f set.${attr}; }) -(builtins.attrNames set)); -channels = { - aardvark = "13.10"; - baboon = "14.04"; - caterpillar = "14.12"; - dingo = "15.09"; - emu = "16.03"; - flounder = "16.09"; - gorilla = "17.03"; - v17_03 = "17.03"; - hummingbird = "17.09"; - v17_09 = "17.09"; - impala = "18.03"; - v18_03 = "18.03"; - jellyfish = "18.09"; - v18_09 = "18.09"; - koi = "19.03"; - v19_03 = "19.03"; - loris = "19.09"; - v19_09 = "19.09"; - unstable = "unstable"; -}; -in mapAttrs (v: - import (builtins.fetchTarball - "https://nixos.org/channels/nixos-${v}/nixexprs.tar.xz") {}) - channels +let + mapAttrs = f: set: builtins.listToAttrs + ( + map (attr: { name = attr; value = f set.${attr}; }) + (builtins.attrNames set) + ); + channels = { + aardvark = "13.10"; + baboon = "14.04"; + caterpillar = "14.12"; + dingo = "15.09"; + emu = "16.03"; + flounder = "16.09"; + gorilla = "17.03"; + v17_03 = "17.03"; + hummingbird = "17.09"; + v17_09 = "17.09"; + impala = "18.03"; + v18_03 = "18.03"; + jellyfish = "18.09"; + v18_09 = "18.09"; + koi = "19.03"; + v19_03 = "19.03"; + loris = "19.09"; + v19_09 = "19.09"; + unstable = "unstable"; + }; +in +mapAttrs + (v: + import + (builtins.fetchTarball + "https://nixos.org/channels/nixos-${v}/nixexprs.tar.xz") { } + ) + channels