From 82705a2887e6c0da915f52f2f0f4d232f2e4763a Mon Sep 17 00:00:00 2001 From: LavaDesu Date: Mon, 28 Jun 2021 08:48:08 +0700 Subject: [PATCH 0001/1107] Add linux-tkg --- .github/workflows/cachix.yml | 23 +++ flake.nix | 34 +++- hosts/winter/kernel.nix | 14 +- packages/linux-tkg/default.nix | 359 +++++++++++++++++++++++++++++++++ 4 files changed, 427 insertions(+), 3 deletions(-) create mode 100644 packages/linux-tkg/default.nix diff --git a/.github/workflows/cachix.yml b/.github/workflows/cachix.yml index 602af55..f5e3871 100644 --- a/.github/workflows/cachix.yml +++ b/.github/workflows/cachix.yml @@ -19,6 +19,29 @@ jobs: name: lava authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}' - run: nix build -L .#linux-lava + + linux_tkg: + name: Build Linux-tkg + runs-on: ubuntu-latest + strategy: + matrix: + kernelVersion: [5.4, 5.10, 5.11] + sched: [bmq, cfs, cacule, muqss, pds] + include: + kernelVersion: 5.10 + sched: upds + steps: + - uses: actions/checkout@v2.3.4 + - uses: cachix/install-nix-action@v13 + with: + install_url: https://github.com/numtide/nix-flakes-installer/releases/download/nix-3.0pre20201007_5257a25/install + extra_nix_config: experimental-features = nix-command flakes + - uses: cachix/cachix-action@v10 + with: + name: lava + authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}' + - run: nix build -L .#linux_tkg-${{ matrix.sched }}-${{ matrix.kernelVersion }} + wine: name: Build Wine runs-on: ubuntu-latest diff --git a/flake.nix b/flake.nix index f1585df..125a58c 100644 --- a/flake.nix +++ b/flake.nix @@ -16,9 +16,39 @@ customPackages = pkgs: let callPackage = pkgs.callPackage; - in { - linux-lava = callPackage ./packages/linux-lava {}; + in rec { + linux_lava = callPackage ./packages/linux-lava {}; + linux_tkg = callPackage ./packages/linux-tkg { + kernelPatches = with pkgs.kernelPatches; [ + bridge_stp_helper + request_key_helper + ]; + }; + linuxPackages_tkg = args: pkgs.recurseIntoAttrs (pkgs.linuxPackagesFor (linux_tkg.override args)); wine-osu = callPackage ./packages/wine-osu { inherit getPaths; }; + } + # For github workflow tests + // builtins.listToAttrs (builtins.map (e: { + name = "linux_tkg-${e.scheduler}-${e.version}"; + value = callPackage ./packages/linux-tkg { + inherit (e) scheduler version; + kernelPatches = with pkgs.kernelPatches; [ + bridge_stp_helper + request_key_helper + ]; + }; + }) (pkgs.lib.cartesianProductOfSets { + scheduler = ["bmq" "cfs" "cacule" "muqss" "pds"]; + version = ["5.4" "5.10" "5.11"]; + })) // { + "linux_tkg-upds-5.10" = callPackage ./packages/linux-tkg { + version = "5.10"; + scheduler = "upds"; + kernelPatches = with pkgs.kernelPatches; [ + bridge_stp_helper + request_key_helper + ]; + }; }; overlays = (builtins.map diff --git a/hosts/winter/kernel.nix b/hosts/winter/kernel.nix index 68f2cf6..4017db6 100644 --- a/hosts/winter/kernel.nix +++ b/hosts/winter/kernel.nix @@ -26,7 +26,19 @@ "intel_pstate=passive" "msr.allow_writes=on" ]; - kernelPackages = pkgs.lib.mkForce (pkgs.linuxPackagesFor pkgs.linux-lava); + kernelPackages = pkgs.linuxPackages_tkg { + debug = false; + scheduler = "cacule"; + timerFreq = 2000; + numa = false; + tickless = 1; + localVersion = "Lava"; + }; + kernelPatches = [{ + name = "si-clocking"; + patch = ../../packages/linux-lava/si-manual-clocking.patch; + }]; + #kernelPackages = pkgs.lib.mkForce (pkgs.linuxPackagesFor pkgs.linux-lava); }; zramSwap.enable = true; } diff --git a/packages/linux-tkg/default.nix b/packages/linux-tkg/default.nix new file mode 100644 index 0000000..94c0c76 --- /dev/null +++ b/packages/linux-tkg/default.nix @@ -0,0 +1,359 @@ +# FIXME: This entire derivation is extremely ugly. +{ + buildLinux +, fetchFromGitHub +, lib +, extraConfig ? {} +, kernelPatches ? [] + +, version ? "5.12" +, debug ? true +, tcpAlgorithm ? "cubic" +, scheduler ? "cfs" +, runqueueSharing ? "smt" +, timerFreq ? 500 +, defaultGovernor ? "ondemand" +, ftrace ? true +, numa ? true +, tickless ? 2 + +, enableAnbox ? false +, bcachefs ? false +, futex2 ? true +, winesync ? true +, irqThreading ? false +, randomTrustCPU ? false +, smtNice ? true +, zenify ? true + +# TODO: yieldType +, yieldType ? 1 +# TODO: rrInterval +, rrInterval ? 0 + +, acsOverride ? false +, aggressiveOndemand ? true +, fsync ? true +, miscAdditions ? true +, zfsFix ? (lib.versionOlder version "5.11") + +, localVersion ? "" + +, ... +} @ args: +let + tkg = "2da317c20ed6f70085b195639b9aad2cacf31ab5"; + + majorVersion = + if lib.versions.major version == "5" + then "5" + else throw "Unsupported major version"; + minorVersion = lib.versions.minor version; + patchVersion = + if minorVersion == "4" then "128" + else if minorVersion == "10" then "46" + else if minorVersion == "12" then "13" + else throw "Unsupported minor version"; + + mmp = "${majorVersion}.${minorVersion}.${patchVersion}"; + mm = "${majorVersion}.${minorVersion}"; + + kernelUrl = name: sha256: builtins.fetchurl { + inherit sha256; + url = "https://cdn.kernel.org/pub/linux/kernel/v${majorVersion}.x/${name}.xz"; + }; + + tkgSource = fetchFromGitHub { + owner = "Frogging-Family"; + repo = "linux-tkg"; + rev = "2da317c20ed6f70085b195639b9aad2cacf31ab5"; + sha256 = "06a5fpafids8nc550pcsyvar2igphi6bpghqzl6cp48hg6p2g07w"; + }; + + boolToKernel = bool: with lib.kernel; if bool then yes else no; + boolToKernelMod = bool: with lib.kernel; if bool then module else no; + mapBoolToKernel = bool: list: builtins.listToAttrs ( + builtins.map (e: { + name = e; + value = boolToKernel bool; + }) list + ); + mapNo = list: mapBoolToKernel false list; + mapYes = list: mapBoolToKernel true list; + mapNY = list: + (mapNo (builtins.elemAt list 0) + // mapYes (builtins.elemAt list 1)); + + supportedSchedulers = { + "5.4" = [ "bmq" "cfs" "cacule" "muqss" "pds" ]; + "5.10" = [ "bmq" "cfs" "cacule" "muqss" "pds" "upds" ]; + "5.12" = [ "bmq" "cfs" "cacule" "muqss" "pds" ]; + }; + + # do not put rec please kthx + tkgConfig = with lib.kernel; { + defaults = let + base = { + # openrgb + I2C_NCT6775 = module; + ZSWAP_COMPRESSOR_DEFAULT = freeform "lz4"; + } // mapNY [ + [ "DYNAMIC_FAULT" "DEFAULT_FQ_CODEL" "NTP_PPS" "CPU_FREQ_DEFAULT_GOV_PERFORMANCE_NODEF" "ZSWAP_COMPRESSOR_DEFAULT_LZO" "CMDLINE_OVERRIDE" "X86_P6_NOP" "CPU_FREQ_DEFAULT_GOV_ONDEMAND" "CPU_FREQ_DEFAULT_GOV_CONSERVATIVE" "DEBUG_INFO" "PREEMPT_VOLUNTARY" ] + [ "DEFAULT_CAKE" "CRYPTO_LZ4" "CRYPTO_LZ4HC" "LZ4_COMPRESS" "LZ4HC_COMPRESS" "ZSWAP_COMPRESSOR_DEFAULT_LZ4" "CMDLINE_BOOL" "TCP_CONG_ADVANCED" "PREEMPT" "PREEMPT_COUNT" "PREEMPTION" "PREEMPT_DYNAMIC" ] + ]; + extras = { + "5.4" = { + TP_SMAPI = module; + RAID6_USE_PREFER_GEN = yes; + RCU_BOOST_DELAY = freeform 0; + }; + }; + in base // (if builtins.hasAttr mm extras then extras.${mm} else {}); + + debug = + if debug + then mapNo [ "SLUB_DEBUG" "PM_DEBUG" "PM_ADVANCED_DEBUG" "PM_SLEEP_DEBUG" "ACPI_DEBUG" "SCHED_DEBUG" "LATENCYTOP" "DEBUG_PREEMPT" ] + else {}; + + tcpAlgorithm = let + algorithms = [ "yeah" "bbr" "cubic" "vegas" "westwood" "reno" ]; + base = mapBoolToKernel false (builtins.map(e: "DEFAULT_${lib.toUpper e}") algorithms) + // mapBoolToKernel true (builtins.map(e: "TCP_CONG_${lib.toUpper e}") algorithms); + in + if builtins.elem tcpAlgorithm algorithms + then base // { + "DEFAULT_${lib.toUpper tcpAlgorithm}" = yes; + DEFAULT_TCP_CONG = freeform tcpAlgorithm; + } + else throw "Unsupported TCP algorithm"; + + scheduler = let + schedConfigs = { + cfs = {}; + cacule = mapNY [ + [ "BSD_PROCESS_ACCT" "TASK_XACCT" "CGROUP_CPUACCT" "CGROUP_DEBUG" ] + [ "CACULE_SCHED" "SCHED_AUTOGROUP" ] + ]; + muqss = mapNY [ + [ "CFS_BANDWIDTH" "FAIR_GROUP_SCHED" ] + [ "SCHED_MUQSS" ] + ]; + pds = mapNY [ + [ "CFS_BANDWIDTH" "FAIR_GROUP_SCHED" "SCHED_BMQ" ] + [ "SCHED_ALT" "SCHED_PDS" ] + ]; + bmq = mapNY [ + [ "CFS_BANDWIDTH" "FAIR_GROUP_SCHED" "SCHED_PDS" ] + [ "SCHED_ALT" "SCHED_BMQ" ] + ]; + upds = mapNY [ + [ "CFS_BANDWIDTH" "FAIR_GROUP_SCHED" ] + [ "SCHED_PDS" ] + ]; + }; + in + if builtins.hasAttr scheduler schedConfigs + then + if builtins.elem scheduler supportedSchedulers.${mm} + then schedConfigs.${scheduler} + else throw "Unsupported scheduler for kernel version" + else throw "Unknown scheduler"; + + runqueueSharing = let + types = [ "none" "smt" "mc" "mc_llc" "smp" "all" ]; + base = mapBoolToKernel false (builtins.map (e: "RQ_${lib.toUpper e}") types); + in + if (scheduler == "muqss") then + if (builtins.elem type types) + then base // { "RQ_${lib.toUpper type}" = yes; } + else throw "Unknown runqueueSharing type" + else {}; + + timerFreq = let + availableFreqs = [100 250 300 500 750 1000] + ++ lib.optional (scheduler == "cacule") 2000; + + base = mapBoolToKernel false ( + builtins.map (e: "HZ_${builtins.toString e}") availableFreqs + ++ builtins.map (e: "HZ_${builtins.toString e}_NODEF") availableFreqs + ); + in + if builtins.elem timerFreq availableFreqs + then base // { + "HZ_${builtins.toString timerFreq}" = yes; + "HZ_${builtins.toString timerFreq}_NODEF" = yes; + } + else throw "Unsupported timer frequency"; + + defaultGovernor = let + governors = { + schedutil = {}; + performance = mapNY [ + [ "CPU_FREQ_DEFAULT_GOV_SCHEDUTIL" ] + [ "CPU_FREQ_DEFAULT_GOV_PERFORMANCE" "CPU_FREQ_DEFAULT_GOV_PERFORMANCE_NODEF" ] + ]; + ondemand = mapNY [ + [ "CPU_FREQ_DEFAULT_GOV_SCHEDUTIL" ] + [ "CPU_FREQ_DEFAULT_GOV_ONDEMAND" "CPU_FREQ_GOV_ONDEMAND" ] + ]; + }; + in + if builtins.hasAttr defaultGovernor governors + then governors.${defaultGovernor} + else throw "Unsupported default governor"; + + ftrace = mapBoolToKernel ftrace [ "FUNCTION_TRACER" "FUNCTION_GRAPH_TRACER" ]; + numa = if numa then {} else mapNo [ "NUMA" "AMD_NUMA" "ACPI_NUMA" "X86_64_ACPI_NUMA" "NODES_SPAN_OTHER_NODES" "NUMA_EMU" "NODES_SHIFT" "NEED_MULTIPLE_NODES" "USE_PERCPU_NUMA_NODE_ID" ]; + tickless = let + modes = [ + # Periodic ticks + (mapNY [ + [ "NO_HZ_FULL_NODEF" "NO_HZ_IDLE" "NO_HZ_FULL" "NO_HZ" "NO_HZ_COMMON" ] + [ "HZ_PERIODIC" ] + ]) + # Tickless + (mapNY [ + [ "HZ_PERIODIC" "NO_HZ_IDLE" "CONTEXT_TRACKING_FORCE" ] + [ "NO_HZ_FULL_NODEF" "NO_HZ_FULL" "NO_HZ" "NO_HZ_COMMON" "CONTEXT_TRACKING" ] + ]) + # Tickless idle + (mapNY [ + [ "HZ_PERIODIC" "NO_HZ_FULL_NODEF" "NO_HZ_FULL" ] + [ "NO_HZ_IDLE" "NO_HZ" "NO_HZ_COMMON" ] + ]) + ]; + in + if builtins.length modes >= tickless + then builtins.elemAt modes tickless + else throw "Unsupported tickless value"; + + anbox = + if enableAnbox + then + { ANDROID_BINDER_DEVICES = freeform "binder,hwbinder,vndbinder"; } + // mapNY [ + [ "ION_SYSTEM_HEAP" "ANDROID_BINDER_IPC_SELFTEST" ] + [ "ASHMEM" "ION" "ION_CMA_HEAP" "ANDROID" "ANDROID_BINDER_IPC" "ANDROID_BINDERFS" ] + ] + else {}; + bcachefs = + if bcachefs + then + { BCACHEFS_FS = module; } + // mapNY [ + [ "BCACHEFS_DEBUG" "BCACHEFS_TESTS" "DEBUG_CLOSURES" ] + [ "BCACHEFS_QUOTA" "BCACHEFS_POSIX_ACL" ] + ] + else {}; + + futex2 = { FUTEX2 = boolToKernel futex2; }; + winesync = { WINESYNC = boolToKernelMod winesync; }; + irqThreading = { FORCE_IRQ_THREADING = boolToKernel irqThreading; }; + randomTrustCPU = { RANDOM_TRUST_CPU = boolToKernel randomTrustCPU; }; + smtNice = { SMT_NICE = boolToKernel smtNice; }; + zenify = { ZENIFY = boolToKernel zenify; }; + }; + flattenedConfig = with lib; mapAttrs (_: head) (zipAttrs (attrValues tkgConfig)); + + patchNames = [ + "0002-clear-patches" + "0003-glitched-base" + ] + ++ lib.optional miscAdditions "0012-misc-additions" + ++ lib.optionals (mm == "5.12") [ + "0001-mm-Support-soft-dirty-flag-reset-for-VA-range" + "0002-mm-Support-soft-dirty-flag-read-with-reset" + ] + ++ ( + let + prjcRevisions = { + "5.10" = "2"; + "5.12" = "1"; + }; + map = { + muqss = [ + "0004-${mm}-ck1" + "0004-glitched-muqss" + ]; + upds = [ + "0005-v${mm}_undead-pds099o" + "0005-undead-glitched-pds" + ]; + pds = if mm == "5.4" + then [ + "0005-v${mm}_undead-pds099o" + "0005-glitched-pds" + ] + else [ + "0009-prjc_v${mm}-r${prjcRevisions.${mm}}" + "0005-glitched-pds" + ]; + bmq = if mm == "5.4" + then [ + "0009-bmq_v5.4-r2" + "0009-glitched-bmq" + ] + else [ + "0009-prjc_v${mm}-r${prjcRevisions.${mm}}" + "0009-glitched-bmq" + ]; + cacule = [ + "0003-cacule-${mm}" + "0003-glitched-cfs" + ]; + cfs = ["0003-glitched-cfs"]; + }; + in + if (builtins.hasAttr scheduler map) && (map.${scheduler} != {}) + then map.${scheduler} + else [] + ) + ++ lib.optional acsOverride "0006-add-acs-overrides_iommu" + ++ lib.optionals aggressiveOndemand ( + let map = rec { + muqss = "0004-glitched-ondemand-muqss"; + upds = "0005-undead-glitched-ondemand-pds"; + pds = if mm == "5.4" + then "0005-glitched-ondemand-pds" + else "0009-glitched-ondemand-bmq"; + bmq = if mm != "5.4" + then "0009-glitched-ondemand-bmq" + else {}; + }; in + if (builtins.hasAttr scheduler map) && (map.${scheduler} != {}) + then [map.${scheduler}] + else [] + ) + ++ lib.optional bcachefs "0008-${mm}-bcachefs" + ++ lib.optional fsync "0007-v${mm}-fsync" + ++ lib.optional futex2 "0007-v${mm}-futex2_interface" + ++ lib.optional winesync "0007-v${mm}-winesync" + ++ lib.optional zfsFix "0011-ZFS-fix"; + + toPatch = name: { + inherit name; + patch = "${tkgSource}/linux-tkg-patches/${mm}/${name}.patch"; + }; + tkgPatches = builtins.map (e: toPatch e) (lib.naturalSort patchNames); + + suffix = if builtins.stringLength localVersion != 0 then "-tkg-${localVersion}" else "-tkg"; +in buildLinux(args // rec { + version = "${mmp}-tkg"; + modDirVersion = version + suffix; + + isZen = zenify; + + ignoreConfigErrors = true; + structuredExtraConfig = with lib.kernel; builtins.mapAttrs (_: value: lib.mkForce value) ({ + LOCALVERSION = freeform suffix; + } // flattenedConfig + // extraConfig); + + kernelPatches = #args.kernelPatches + [{ + name = "patch-${mmp}"; + patch = kernelUrl "patch-${mmp}" "17d38hns5qfbw1pajpa5y38v86r49nqnw7a3pwsay5fapj69z8w4"; + }] + ++ tkgPatches; + src = kernelUrl "linux-${mm}.tar" "0rn3z942vjc7bixjw066rm6kcr0x0wzgxqfq1f6xd113pzrgc3bx"; +} // (args.argsOverride or {})) From b0cb801b4665ee5fc9699fa37200b4e9ebc297bd Mon Sep 17 00:00:00 2001 From: LavaDesu Date: Mon, 28 Jun 2021 08:52:16 +0700 Subject: [PATCH 0002/1107] oops - fix workflow --- .github/workflows/cachix.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/cachix.yml b/.github/workflows/cachix.yml index f5e3871..6bfa385 100644 --- a/.github/workflows/cachix.yml +++ b/.github/workflows/cachix.yml @@ -28,7 +28,7 @@ jobs: kernelVersion: [5.4, 5.10, 5.11] sched: [bmq, cfs, cacule, muqss, pds] include: - kernelVersion: 5.10 + - kernelVersion: 5.10 sched: upds steps: - uses: actions/checkout@v2.3.4 From 287352e41a66eadaa4cb8f4d007579d143bcbf3a Mon Sep 17 00:00:00 2001 From: LavaDesu Date: Mon, 28 Jun 2021 08:53:25 +0700 Subject: [PATCH 0003/1107] yaml is dumb --- .github/workflows/cachix.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/cachix.yml b/.github/workflows/cachix.yml index 6bfa385..d2c31e6 100644 --- a/.github/workflows/cachix.yml +++ b/.github/workflows/cachix.yml @@ -25,10 +25,10 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - kernelVersion: [5.4, 5.10, 5.11] + kernelVersion: ["5.4", "5.10", "5.11"] sched: [bmq, cfs, cacule, muqss, pds] include: - - kernelVersion: 5.10 + - kernelVersion: "5.10" sched: upds steps: - uses: actions/checkout@v2.3.4 From c37ff41ca3b55d586d29ec4691499626584915e4 Mon Sep 17 00:00:00 2001 From: LavaDesu Date: Mon, 28 Jun 2021 08:57:18 +0700 Subject: [PATCH 0004/1107] a --- .github/workflows/cachix.yml | 4 ++-- flake.nix | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/cachix.yml b/.github/workflows/cachix.yml index d2c31e6..c71c1b4 100644 --- a/.github/workflows/cachix.yml +++ b/.github/workflows/cachix.yml @@ -25,10 +25,10 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - kernelVersion: ["5.4", "5.10", "5.11"] + kernelVersion: ["54", "510", "511"] sched: [bmq, cfs, cacule, muqss, pds] include: - - kernelVersion: "5.10" + - kernelVersion: "510" sched: upds steps: - uses: actions/checkout@v2.3.4 diff --git a/flake.nix b/flake.nix index 125a58c..d93dc2f 100644 --- a/flake.nix +++ b/flake.nix @@ -29,7 +29,7 @@ } # For github workflow tests // builtins.listToAttrs (builtins.map (e: { - name = "linux_tkg-${e.scheduler}-${e.version}"; + name = "linux_tkg-${e.scheduler}-${pkgs.lib.stringAsChars (x: if x == "." then "" else x) e.version}"; value = callPackage ./packages/linux-tkg { inherit (e) scheduler version; kernelPatches = with pkgs.kernelPatches; [ @@ -41,7 +41,7 @@ scheduler = ["bmq" "cfs" "cacule" "muqss" "pds"]; version = ["5.4" "5.10" "5.11"]; })) // { - "linux_tkg-upds-5.10" = callPackage ./packages/linux-tkg { + "linux_tkg-upds-510" = callPackage ./packages/linux-tkg { version = "5.10"; scheduler = "upds"; kernelPatches = with pkgs.kernelPatches; [ From dfc2cdbd899321c92ffcc788d9f15750d22f00b4 Mon Sep 17 00:00:00 2001 From: LavaDesu Date: Mon, 28 Jun 2021 09:32:32 +0700 Subject: [PATCH 0005/1107] move sources into its own file also a bunch of misc changes --- .github/workflows/cachix.yml | 2 +- flake.nix | 2 +- packages/linux-tkg/default.nix | 72 ++++++++++++---------------------- packages/linux-tkg/sources.nix | 44 +++++++++++++++++++++ 4 files changed, 70 insertions(+), 50 deletions(-) create mode 100644 packages/linux-tkg/sources.nix diff --git a/.github/workflows/cachix.yml b/.github/workflows/cachix.yml index c71c1b4..a4f90ff 100644 --- a/.github/workflows/cachix.yml +++ b/.github/workflows/cachix.yml @@ -25,7 +25,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - kernelVersion: ["54", "510", "511"] + kernelVersion: ["54", "510", "512"] sched: [bmq, cfs, cacule, muqss, pds] include: - kernelVersion: "510" diff --git a/flake.nix b/flake.nix index d93dc2f..4babfd8 100644 --- a/flake.nix +++ b/flake.nix @@ -39,7 +39,7 @@ }; }) (pkgs.lib.cartesianProductOfSets { scheduler = ["bmq" "cfs" "cacule" "muqss" "pds"]; - version = ["5.4" "5.10" "5.11"]; + version = ["5.4" "5.10" "5.12"]; })) // { "linux_tkg-upds-510" = callPackage ./packages/linux-tkg { version = "5.10"; diff --git a/packages/linux-tkg/default.nix b/packages/linux-tkg/default.nix index 94c0c76..094791e 100644 --- a/packages/linux-tkg/default.nix +++ b/packages/linux-tkg/default.nix @@ -44,31 +44,7 @@ let tkg = "2da317c20ed6f70085b195639b9aad2cacf31ab5"; - majorVersion = - if lib.versions.major version == "5" - then "5" - else throw "Unsupported major version"; - minorVersion = lib.versions.minor version; - patchVersion = - if minorVersion == "4" then "128" - else if minorVersion == "10" then "46" - else if minorVersion == "12" then "13" - else throw "Unsupported minor version"; - - mmp = "${majorVersion}.${minorVersion}.${patchVersion}"; - mm = "${majorVersion}.${minorVersion}"; - - kernelUrl = name: sha256: builtins.fetchurl { - inherit sha256; - url = "https://cdn.kernel.org/pub/linux/kernel/v${majorVersion}.x/${name}.xz"; - }; - - tkgSource = fetchFromGitHub { - owner = "Frogging-Family"; - repo = "linux-tkg"; - rev = "2da317c20ed6f70085b195639b9aad2cacf31ab5"; - sha256 = "06a5fpafids8nc550pcsyvar2igphi6bpghqzl6cp48hg6p2g07w"; - }; + sources = import ./sources.nix { inherit fetchFromGitHub lib version; }; boolToKernel = bool: with lib.kernel; if bool then yes else no; boolToKernelMod = bool: with lib.kernel; if bool then module else no; @@ -105,10 +81,10 @@ let "5.4" = { TP_SMAPI = module; RAID6_USE_PREFER_GEN = yes; - RCU_BOOST_DELAY = freeform 0; + RCU_BOOST_DELAY = freeform "0"; }; }; - in base // (if builtins.hasAttr mm extras then extras.${mm} else {}); + in base // (if builtins.hasAttr version extras then extras.${version} else {}); debug = if debug @@ -154,7 +130,7 @@ let in if builtins.hasAttr scheduler schedConfigs then - if builtins.elem scheduler supportedSchedulers.${mm} + if builtins.elem scheduler supportedSchedulers.${version} then schedConfigs.${scheduler} else throw "Unsupported scheduler for kernel version" else throw "Unknown scheduler"; @@ -260,7 +236,7 @@ let "0003-glitched-base" ] ++ lib.optional miscAdditions "0012-misc-additions" - ++ lib.optionals (mm == "5.12") [ + ++ lib.optionals (version == "5.12") [ "0001-mm-Support-soft-dirty-flag-reset-for-VA-range" "0002-mm-Support-soft-dirty-flag-read-with-reset" ] @@ -272,33 +248,33 @@ let }; map = { muqss = [ - "0004-${mm}-ck1" + "0004-${version}-ck1" "0004-glitched-muqss" ]; upds = [ - "0005-v${mm}_undead-pds099o" + "0005-v${version}_undead-pds099o" "0005-undead-glitched-pds" ]; - pds = if mm == "5.4" + pds = if version == "5.4" then [ - "0005-v${mm}_undead-pds099o" + "0005-v${version}_undead-pds099o" "0005-glitched-pds" ] else [ - "0009-prjc_v${mm}-r${prjcRevisions.${mm}}" + "0009-prjc_v${version}-r${prjcRevisions.${version}}" "0005-glitched-pds" ]; - bmq = if mm == "5.4" + bmq = if version == "5.4" then [ "0009-bmq_v5.4-r2" "0009-glitched-bmq" ] else [ - "0009-prjc_v${mm}-r${prjcRevisions.${mm}}" + "0009-prjc_v${version}-r${prjcRevisions.${version}}" "0009-glitched-bmq" ]; cacule = [ - "0003-cacule-${mm}" + "0003-cacule-${version}" "0003-glitched-cfs" ]; cfs = ["0003-glitched-cfs"]; @@ -313,10 +289,10 @@ let let map = rec { muqss = "0004-glitched-ondemand-muqss"; upds = "0005-undead-glitched-ondemand-pds"; - pds = if mm == "5.4" + pds = if version == "5.4" then "0005-glitched-ondemand-pds" else "0009-glitched-ondemand-bmq"; - bmq = if mm != "5.4" + bmq = if version != "5.4" then "0009-glitched-ondemand-bmq" else {}; }; in @@ -324,21 +300,21 @@ let then [map.${scheduler}] else [] ) - ++ lib.optional bcachefs "0008-${mm}-bcachefs" - ++ lib.optional fsync "0007-v${mm}-fsync" - ++ lib.optional futex2 "0007-v${mm}-futex2_interface" - ++ lib.optional winesync "0007-v${mm}-winesync" + ++ lib.optional bcachefs "0008-${version}-bcachefs" + ++ lib.optional fsync "0007-v${version}-fsync" + ++ lib.optional futex2 "0007-v${version}-futex2_interface" + ++ lib.optional winesync "0007-v${version}-winesync" ++ lib.optional zfsFix "0011-ZFS-fix"; toPatch = name: { inherit name; - patch = "${tkgSource}/linux-tkg-patches/${mm}/${name}.patch"; + patch = "${sources.tkg}/linux-tkg-patches/${version}/${name}.patch"; }; tkgPatches = builtins.map (e: toPatch e) (lib.naturalSort patchNames); suffix = if builtins.stringLength localVersion != 0 then "-tkg-${localVersion}" else "-tkg"; in buildLinux(args // rec { - version = "${mmp}-tkg"; + version = "${sources.fullVersion}-tkg"; modDirVersion = version + suffix; isZen = zenify; @@ -351,9 +327,9 @@ in buildLinux(args // rec { kernelPatches = #args.kernelPatches [{ - name = "patch-${mmp}"; - patch = kernelUrl "patch-${mmp}" "17d38hns5qfbw1pajpa5y38v86r49nqnw7a3pwsay5fapj69z8w4"; + name = "patch-${version}"; + patch = sources.patchSrc; }] ++ tkgPatches; - src = kernelUrl "linux-${mm}.tar" "0rn3z942vjc7bixjw066rm6kcr0x0wzgxqfq1f6xd113pzrgc3bx"; + src = sources.kernelSrc; } // (args.argsOverride or {})) diff --git a/packages/linux-tkg/sources.nix b/packages/linux-tkg/sources.nix new file mode 100644 index 0000000..1619844 --- /dev/null +++ b/packages/linux-tkg/sources.nix @@ -0,0 +1,44 @@ +{ fetchFromGitHub, lib, version }: +let + vMap = { + "5.4" = { + version = "5.4.128"; + baseHash = "14glqppn90z79b36k4c76mv90q933i2bg54rgwlcl2v7n608jcxz"; + patchHash = "04ylr4f4amzviqljhc6i79dqhjmjx45shf0rply1v5zqlfndb459"; + }; + "5.10" = { + version = "5.10.46"; + baseHash = "0hyav21vzz5v1kgb455pcz9ncg5qqzxmp60na290scwq7vj9kpyw"; + patchHash = "0jl31aayxyns3pkvm9mycvwakg2i45win9nfbirhcz7z5gfsa7fg"; + }; + "5.12" = { + version = "5.12.13"; + baseHash = "0rn3z942vjc7bixjw066rm6kcr0x0wzgxqfq1f6xd113pzrgc3bx"; + patchHash = "17d38hns5qfbw1pajpa5y38v86r49nqnw7a3pwsay5fapj69z8w4"; + }; + }; + + tkg = fetchFromGitHub { + owner = "Frogging-Family"; + repo = "linux-tkg"; + rev = "2da317c20ed6f70085b195639b9aad2cacf31ab5"; + sha256 = "06a5fpafids8nc550pcsyvar2igphi6bpghqzl6cp48hg6p2g07w"; + }; + + ver = + if builtins.hasAttr version vMap + then vMap.${version} + else throw "Unsupported version"; +in rec { + inherit tkg; + + fullVersion = ver.version; + kernelSrc = builtins.fetchurl { + url = "https://cdn.kernel.org/pub/linux/kernel/v${lib.versions.major version}.x/linux-${version}.tar.xz"; + sha256 = ver.baseHash; + }; + patchSrc = builtins.fetchurl { + url = "https://cdn.kernel.org/pub/linux/kernel/v${lib.versions.major version}.x/patch-${fullVersion}.xz"; + sha256 = ver.patchHash; + }; +} From df5bfd14d6a73b5977c2fc3b2931fea3317b654c Mon Sep 17 00:00:00 2001 From: LavaDesu Date: Mon, 28 Jun 2021 09:36:05 +0700 Subject: [PATCH 0006/1107] fix --- packages/linux-tkg/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/linux-tkg/default.nix b/packages/linux-tkg/default.nix index 094791e..374b677 100644 --- a/packages/linux-tkg/default.nix +++ b/packages/linux-tkg/default.nix @@ -140,8 +140,8 @@ let base = mapBoolToKernel false (builtins.map (e: "RQ_${lib.toUpper e}") types); in if (scheduler == "muqss") then - if (builtins.elem type types) - then base // { "RQ_${lib.toUpper type}" = yes; } + if (builtins.elem runqueueSharing types) + then base // { "RQ_${lib.toUpper runqueueSharing}" = yes; } else throw "Unknown runqueueSharing type" else {}; From 264b62ca6a8ca12f51c14a2b5e45b496a237fe7a Mon Sep 17 00:00:00 2001 From: LavaDesu Date: Mon, 28 Jun 2021 10:53:51 +0700 Subject: [PATCH 0007/1107] use pre-patched kernel source instead of patching ourselves nix strips FHS before patching, causing the patch for some versions to fail --- packages/linux-tkg/default.nix | 9 +-------- packages/linux-tkg/sources.nix | 21 +++++++-------------- 2 files changed, 8 insertions(+), 22 deletions(-) diff --git a/packages/linux-tkg/default.nix b/packages/linux-tkg/default.nix index 374b677..f3c04ea 100644 --- a/packages/linux-tkg/default.nix +++ b/packages/linux-tkg/default.nix @@ -42,8 +42,6 @@ , ... } @ args: let - tkg = "2da317c20ed6f70085b195639b9aad2cacf31ab5"; - sources = import ./sources.nix { inherit fetchFromGitHub lib version; }; boolToKernel = bool: with lib.kernel; if bool then yes else no; @@ -325,11 +323,6 @@ in buildLinux(args // rec { } // flattenedConfig // extraConfig); - kernelPatches = #args.kernelPatches - [{ - name = "patch-${version}"; - patch = sources.patchSrc; - }] - ++ tkgPatches; + kernelPatches = tkgPatches; src = sources.kernelSrc; } // (args.argsOverride or {})) diff --git a/packages/linux-tkg/sources.nix b/packages/linux-tkg/sources.nix index 1619844..8a30019 100644 --- a/packages/linux-tkg/sources.nix +++ b/packages/linux-tkg/sources.nix @@ -3,26 +3,23 @@ let vMap = { "5.4" = { version = "5.4.128"; - baseHash = "14glqppn90z79b36k4c76mv90q933i2bg54rgwlcl2v7n608jcxz"; - patchHash = "04ylr4f4amzviqljhc6i79dqhjmjx45shf0rply1v5zqlfndb459"; + hash = "1arrpskxkkl6vb06d4y4xvfy1355mjk5ac5sp66657kbh6xswm1v"; }; "5.10" = { version = "5.10.46"; - baseHash = "0hyav21vzz5v1kgb455pcz9ncg5qqzxmp60na290scwq7vj9kpyw"; - patchHash = "0jl31aayxyns3pkvm9mycvwakg2i45win9nfbirhcz7z5gfsa7fg"; + hash = "058lvk0hc6qk3l485kda7cxkdrjk1kd0f75cp7pmnckbkjij54an"; }; "5.12" = { version = "5.12.13"; - baseHash = "0rn3z942vjc7bixjw066rm6kcr0x0wzgxqfq1f6xd113pzrgc3bx"; - patchHash = "17d38hns5qfbw1pajpa5y38v86r49nqnw7a3pwsay5fapj69z8w4"; + hash = "0mfjkncsa7vq13689dzzwms6wzsaj347qm1vf7k82nb3wp6myj5g"; }; }; tkg = fetchFromGitHub { owner = "Frogging-Family"; repo = "linux-tkg"; - rev = "2da317c20ed6f70085b195639b9aad2cacf31ab5"; - sha256 = "06a5fpafids8nc550pcsyvar2igphi6bpghqzl6cp48hg6p2g07w"; + rev = "c93cfdd20da1cf3b0860895c278b5a4676ccb057"; + sha256 = "0xpkdjq2ickhb8pqzqv5avjmrg3qyzryy8qv1wr9dxpkx197swdx"; }; ver = @@ -34,11 +31,7 @@ in rec { fullVersion = ver.version; kernelSrc = builtins.fetchurl { - url = "https://cdn.kernel.org/pub/linux/kernel/v${lib.versions.major version}.x/linux-${version}.tar.xz"; - sha256 = ver.baseHash; - }; - patchSrc = builtins.fetchurl { - url = "https://cdn.kernel.org/pub/linux/kernel/v${lib.versions.major version}.x/patch-${fullVersion}.xz"; - sha256 = ver.patchHash; + url = "https://cdn.kernel.org/pub/linux/kernel/v${lib.versions.major version}.x/linux-${fullVersion}.tar.xz"; + sha256 = ver.hash; }; } From bd0c58c121c0bd51427c6d4b8779ceec379413dd Mon Sep 17 00:00:00 2001 From: LavaDesu Date: Mon, 28 Jun 2021 11:05:28 +0700 Subject: [PATCH 0008/1107] more fix --- .github/workflows/cachix.yml | 2 +- packages/linux-tkg/default.nix | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/cachix.yml b/.github/workflows/cachix.yml index a4f90ff..04a17c5 100644 --- a/.github/workflows/cachix.yml +++ b/.github/workflows/cachix.yml @@ -18,7 +18,7 @@ jobs: with: name: lava authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}' - - run: nix build -L .#linux-lava + - run: nix build -L .#linux_lava linux_tkg: name: Build Linux-tkg diff --git a/packages/linux-tkg/default.nix b/packages/linux-tkg/default.nix index f3c04ea..0760d95 100644 --- a/packages/linux-tkg/default.nix +++ b/packages/linux-tkg/default.nix @@ -18,9 +18,9 @@ , tickless ? 2 , enableAnbox ? false -, bcachefs ? false -, futex2 ? true -, winesync ? true +, bcachefs ? (version == "5.10" || version == "5.12") +, futex2 ? (lib.versionAtLeast version "5.10") +, winesync ? (lib.versionAtLeast version "5.12") , irqThreading ? false , randomTrustCPU ? false , smtNice ? true From 06ec8c63c018cc3471ed7b3dca183124c342ead8 Mon Sep 17 00:00:00 2001 From: LavaDesu Date: Mon, 28 Jun 2021 13:31:18 +0700 Subject: [PATCH 0009/1107] disable zfsFix --- packages/linux-tkg/default.nix | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/linux-tkg/default.nix b/packages/linux-tkg/default.nix index 0760d95..ececaff 100644 --- a/packages/linux-tkg/default.nix +++ b/packages/linux-tkg/default.nix @@ -35,7 +35,8 @@ , aggressiveOndemand ? true , fsync ? true , miscAdditions ? true -, zfsFix ? (lib.versionOlder version "5.11") +# XXX: This patch is pretty broken +, zfsFix ? false # (lib.versionOlder version "5.11") , localVersion ? "" From fdae40c7efa024db600999c53f28f7ac794addc6 Mon Sep 17 00:00:00 2001 From: LavaDesu Date: Mon, 28 Jun 2021 13:45:07 +0700 Subject: [PATCH 0010/1107] aa --- packages/linux-tkg/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/linux-tkg/default.nix b/packages/linux-tkg/default.nix index ececaff..96e23cf 100644 --- a/packages/linux-tkg/default.nix +++ b/packages/linux-tkg/default.nix @@ -234,7 +234,7 @@ let "0002-clear-patches" "0003-glitched-base" ] - ++ lib.optional miscAdditions "0012-misc-additions" + ++ lib.optional ((lib.versionAtLeast version "5.10") && miscAdditions) "0012-misc-additions" ++ lib.optionals (version == "5.12") [ "0001-mm-Support-soft-dirty-flag-reset-for-VA-range" "0002-mm-Support-soft-dirty-flag-read-with-reset" From 49eec3c14930ad4445b18225b2491f16ce8e4b92 Mon Sep 17 00:00:00 2001 From: LavaDesu Date: Mon, 28 Jun 2021 14:11:15 +0700 Subject: [PATCH 0011/1107] more more fixes --- packages/linux-tkg/default.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/linux-tkg/default.nix b/packages/linux-tkg/default.nix index 96e23cf..28a1753 100644 --- a/packages/linux-tkg/default.nix +++ b/packages/linux-tkg/default.nix @@ -309,12 +309,12 @@ let inherit name; patch = "${sources.tkg}/linux-tkg-patches/${version}/${name}.patch"; }; - tkgPatches = builtins.map (e: toPatch e) (lib.naturalSort patchNames); + tkgPatches = builtins.map (e: toPatch e) patchNames; suffix = if builtins.stringLength localVersion != 0 then "-tkg-${localVersion}" else "-tkg"; in buildLinux(args // rec { - version = "${sources.fullVersion}-tkg"; - modDirVersion = version + suffix; + version = sources.fullVersion + suffix; + modDirVersion = version; isZen = zenify; From 94a3281cbe678b404ce7aeab263fa194ed4b0001 Mon Sep 17 00:00:00 2001 From: LavaDesu Date: Fri, 2 Jul 2021 07:21:55 +0700 Subject: [PATCH 0012/1107] switch back to home-manager master --- flake.lock | 11 +++++------ flake.nix | 2 +- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/flake.lock b/flake.lock index d59f3ff..89477ae 100644 --- a/flake.lock +++ b/flake.lock @@ -7,16 +7,15 @@ ] }, "locked": { - "lastModified": 1624718580, - "narHash": "sha256-hzt3zC4lm7XvvEISpaJirotBOo7XYdeI3cVslT/BvMw=", - "owner": "LavaDesu", + "lastModified": 1625162737, + "narHash": "sha256-IzKTw2u/EKVr6TCQYylSAcOnrVRpir3wG3MUHj2LsTc=", + "owner": "nix-community", "repo": "home-manager", - "rev": "c52a96d07de8930de256ffeffd82314757f7a5da", + "rev": "7df6656b113ce0d39c8b7d30915cafe046e1d64e", "type": "github" }, "original": { - "owner": "LavaDesu", - "ref": "aa", + "owner": "nix-community", "repo": "home-manager", "type": "github" } diff --git a/flake.nix b/flake.nix index f1585df..a3f1c8a 100644 --- a/flake.nix +++ b/flake.nix @@ -1,7 +1,7 @@ { inputs = { nixpkgs = { url = "github:NixOS/nixpkgs/nixos-unstable"; }; - home-manager = { url = "github:LavaDesu/home-manager/aa"; }; + home-manager = { url = "github:nix-community/home-manager"; }; secrets = { url = "github:LavaDesu/flakes-secrets"; }; home-manager.inputs.nixpkgs.follows = "nixpkgs"; From fa42005ff8a63e52bd51803fa805c13fdb1df518 Mon Sep 17 00:00:00 2001 From: LavaDesu Date: Sat, 3 Jul 2021 10:50:22 +0700 Subject: [PATCH 0013/1107] add polybar wm-restack --- users/rin/polybar.bspwm.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/users/rin/polybar.bspwm.nix b/users/rin/polybar.bspwm.nix index 27fe0cb..021a70d 100644 --- a/users/rin/polybar.bspwm.nix +++ b/users/rin/polybar.bspwm.nix @@ -18,6 +18,7 @@ bottom = 5; }; override-redirect = true; + wm-restack = "bspwm"; font = [ "NotoSans:style=Regular:size=11:antialias=true;2" From 41f125d4ca4f2cefb93ca365b9ba3beb708e8f85 Mon Sep 17 00:00:00 2001 From: LavaDesu Date: Sat, 3 Jul 2021 13:59:02 +0700 Subject: [PATCH 0014/1107] add eslint --- users/rin/neovim.nix | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/users/rin/neovim.nix b/users/rin/neovim.nix index 982264d..3319776 100644 --- a/users/rin/neovim.nix +++ b/users/rin/neovim.nix @@ -80,10 +80,14 @@ in { " disable empty line tildes set fcs=eob:\ - let g:coc_global_extensions = ['coc-tsserver', 'coc-rust-analyzer', 'coc-flutter'] + let g:coc_global_extensions = ['coc-eslint', 'coc-tsserver', 'coc-rust-analyzer', 'coc-flutter'] ''; }; xdg.configFile."nvim/coc-settings.json".text = builtins.toJSON { + "eslint.enable" = true; + "eslint.options" = { + configFile = "./.eslintrc.json"; + }; "rust-analyzer.lens.enable" = false; "rust-analyzer.inlayHints.enable" = false; "rust-analyzer.serverPath" = pkgs.rust-analyzer + "/bin/rust-analyzer"; From 80bc8db0a98020f87c9f40a13692ae14d721df8c Mon Sep 17 00:00:00 2001 From: LavaDesu Date: Sun, 4 Jul 2021 12:54:48 +0700 Subject: [PATCH 0015/1107] remove ale and vim-javascript --- users/rin/neovim.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/users/rin/neovim.nix b/users/rin/neovim.nix index 3319776..836e7f5 100644 --- a/users/rin/neovim.nix +++ b/users/rin/neovim.nix @@ -19,11 +19,11 @@ in { plugins = with pkgs.vimPlugins; [ # nerdtree # vim-fugitive - ale + # ale coc-nvim dart-vim-plugin vim-airline - vim-javascript + # vim-javascript vim-material vim-nix vim-repeat From 450fd2f3551d94970289699ab73ca8538e09d6f2 Mon Sep 17 00:00:00 2001 From: LavaDesu Date: Sun, 4 Jul 2021 14:15:19 +0700 Subject: [PATCH 0016/1107] bump nixpkgs - r299942.09c38c29f2c --- flake.lock | 6 +++--- flake.nix | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/flake.lock b/flake.lock index 89477ae..9b3aaa2 100644 --- a/flake.lock +++ b/flake.lock @@ -22,11 +22,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1624271441, - "narHash": "sha256-26QNDCdRE5mPOWYJrPGpVzgrJ3ZxqvWOONfeMsjryz4=", + "lastModified": 1625281901, + "narHash": "sha256-DkZDtTIPzhXATqIps2ifNFpnI+PTcfMYdcrx/oFm00Q=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "7e567a3d092b7de69cdf5deaeb8d9526de230916", + "rev": "09c38c29f2c719cd76ca17a596c2fdac9e186ceb", "type": "github" }, "original": { diff --git a/flake.nix b/flake.nix index a3f1c8a..f574ebf 100644 --- a/flake.nix +++ b/flake.nix @@ -29,7 +29,7 @@ ) ) ++ [(self: super: customPackages super)]; - revCount = "297098"; + revCount = "299942"; base = { config, ... }: { system = { configurationRevision = nixpkgs.lib.mkIf (self ? rev) self.rev; From e379ff4799befe02e07e2602976d23906b0bc0e8 Mon Sep 17 00:00:00 2001 From: LavaDesu Date: Sun, 4 Jul 2021 14:10:44 +0700 Subject: [PATCH 0017/1107] separate kernel sources into a file, and bump - 5.13.0 much easier to update also slightly modified config: - use 2000hz tickless - disable ftrace --- packages/linux-lava/default.nix | 80 ++++++--------------------------- packages/linux-lava/sources.nix | 51 +++++++++++++++++++++ 2 files changed, 65 insertions(+), 66 deletions(-) create mode 100644 packages/linux-lava/sources.nix diff --git a/packages/linux-lava/default.nix b/packages/linux-lava/default.nix index f57ea08..09777b1 100644 --- a/packages/linux-lava/default.nix +++ b/packages/linux-lava/default.nix @@ -1,32 +1,16 @@ { buildLinux, + callPackage, kernelPatches, lib, ... } @ args: + let - major = "5"; - minor = "12"; - patch = "13"; - tkg = "2da317c20ed6f70085b195639b9aad2cacf31ab5"; - - mm = "${major}.${minor}"; - mmp = "${major}.${minor}.${patch}"; - - kernelUrl = name: sha256: builtins.fetchurl { - inherit sha256; - url = "https://cdn.kernel.org/pub/linux/kernel/v${major}.x/${name}.xz"; - }; - - tkgPatch = name: sha256: { - inherit name; - patch = builtins.fetchurl { - inherit sha256; - url = "https://raw.githubusercontent.com/Frogging-Family/linux-tkg/${tkg}/linux-tkg-patches/${mm}/${name}.patch"; - }; - }; + sources = callPackage ./sources.nix {}; in buildLinux (args // { - version = "${mmp}-tkg-Lava"; + inherit (sources) src kernelPatches; + version = "${sources.version}-tkg-Lava"; isZen = true; # TODO: # some stuff is set in pkgs/os-specific/linux/kernel/common-config.nix @@ -38,17 +22,17 @@ in buildLinux (args // { MHASWELL = yes; WINESYNC = module; - # timers + # tickless timers HZ_PERIODIC = no; NO_HZ = yes; NO_HZ_COMMON = yes; NO_HZ_FULL = yes; + NO_HZ_FULL_NODEF = yes; NO_HZ_IDLE = no; CONTEXT_TRACKING = yes; - CONTEXT_TRACKING_FORCE = yes; - # HZ_100 = yes; - HZ_1000 = yes; - HZ_1000_NODEF = yes; + CONTEXT_TRACKING_FORCE = no; + HZ_2000 = yes; + HZ_2000_NODEF = yes; # preempt PREEMPT = yes; @@ -58,11 +42,7 @@ in buildLinux (args // { PREEMPT_DYNAMIC = yes; # scheduler - # SCHED_ALT = yes; - # SCHED_PDS = yes; CACULE_SCHED = yes; - - # cacule stuff SCHED_AUTOGROUP = yes; BSD_PROCESS_ACCT = no; TASK_XACCT = no; @@ -79,6 +59,10 @@ in buildLinux (args // { USE_PERCPU_NUMA_NODE_ID = no; ACPI_NUMA = no; + # disable ftrace + FUNCTION_TRACER = no; + FUNCTION_GRAPH_TRACER = no; + # disable misc debugging SLUB_DEBUG = no; PM_DEBUG = no; @@ -90,40 +74,4 @@ in buildLinux (args // { DEBUG_PREEMPT = no; }; ignoreConfigErrors = true; - - src = kernelUrl "linux-${mm}.tar" "0rn3z942vjc7bixjw066rm6kcr0x0wzgxqfq1f6xd113pzrgc3bx"; - kernelPatches = [ - # Kernel version patch - { - name = "patch-${patch}"; - patch = kernelUrl "patch-${mmp}" "17d38hns5qfbw1pajpa5y38v86r49nqnw7a3pwsay5fapj69z8w4"; - } - - # AMD SI manual clocking - { - name = "si-clock"; - patch = ./si-manual-clocking.patch; - } - - # Graysky gcc patches - { - name = "graysky-gcc"; - patch = builtins.fetchurl { - url = "https://raw.githubusercontent.com/graysky2/kernel_gcc_patch/d2e7942c19ee568638d3795cf52db5274a90ce0a/more-uarches-for-kernel-5.8+.patch"; - sha256 = "16jbknjlg12jxbj8cjkk01djvr01n9zz7qlzxppcqizmz55vk0wh"; - }; - } - - # TK-Glitch patches - ( tkgPatch "0002-clear-patches" "1h1gx6rq2c961d36z1szqv9xpq1xgz2bhqjsyb03jjdrdzlcv9rm" ) - ( tkgPatch "0003-cacule-${mm}" "1rgdk1x514xsjwcjjcdmggbaj6biql5p41skn98ysqbjaw7k22ib" ) - ( tkgPatch "0003-glitched-base" "1dg177i3y54z5nadc5678hm67angram2vlr314mpxv3jgsh7vj8s" ) - ( tkgPatch "0003-glitched-cfs" "1cm4s72pymxnh37da84qrzvrwbbwagk46m1xsk99ir7cjb1l1zay" ) - # ( tkgPatch "0005-glitched-pds" "0833awp8n9ngyl5spx8znwyw1lj3nacp8vg7ffysw0j5r8akv9pw" ) - ( tkgPatch "0007-v${mm}-fsync" "0mplwdglw58bmkkxix4ccwgax3r02gahax9042dx33mybdnbl0mk" ) - ( tkgPatch "0007-v${mm}-futex2_interface" "1j29zyx2s85scfhbprgb9cs11rp50glbzczl4plphli8wds342pw" ) - ( tkgPatch "0007-v${mm}-winesync" "1av2k86ns0zc3lmgbfdch1z2a808brp2jvsfl4cwwlwwb51qzipp" ) - # ( tkgPatch "0009-prjc_v${mm}-r1" "1z731jiwyc7z4d5hzd6szrxnvw0iygbqx82y2anzm32n22731dqv" ) - ( tkgPatch "0012-misc-additions" "092ws9v1snk61i6x3gbqm5m803zd81wykkdxizn7knvy2r611cbz") - ]; } // (args.argsOverride or {})) diff --git a/packages/linux-lava/sources.nix b/packages/linux-lava/sources.nix new file mode 100644 index 0000000..e52a5d3 --- /dev/null +++ b/packages/linux-lava/sources.nix @@ -0,0 +1,51 @@ +{ fetchFromGitHub, lib }: +let + version = "5.13.0"; + kernelHash = "1nc9didbjlycs9h8xahny1gwl8m8clylybnza6gl663myfbslsrz"; + kernelPatchHash = ""; + tkgRev = "1137522351b2044de4ac9edc6675b3dcb3de504a"; + tkgHash = "118hvwjjc71gh8jsyswpbap90fmqczcknxdf7bvyn7cgacaix7bq"; + + tkgPatches = [ + "0001-mm-Support-soft-dirty-flag-reset-for-VA-range" + "0002-clear-patches" + "0002-mm-Support-soft-dirty-flag-read-with-reset" + "0003-cacule-${mm}" + "0003-glitched-base" + "0003-glitched-cfs" + #"0007-v${mm}-fsync" + "0007-v${mm}-futex2_interface" + "0007-v${mm}-winesync" + "0012-misc-additions" + ]; + + + patch = path: { + name = "patch-${path}"; + patch = path; + }; + tkgSrc = fetchFromGitHub { + owner = "Frogging-Family"; + repo = "linux-tkg"; + rev = tkgRev; + sha256 = tkgHash; + }; + mm = lib.versions.majorMinor version; +in { + inherit version; + + src = builtins.fetchurl { + url = "https://cdn.kernel.org/pub/linux/kernel/v${lib.versions.major version}.x/linux-${mm}.tar.xz"; + sha256 = kernelHash; + }; + + kernelPatches = [(patch ./si-manual-clocking.patch)] + # ++ [(builtins.fetchurl { + # url = "https://cdn.kernel.org/pub/linux/kernel/v${lib.versions.major version}.x/patch${version}.xz"; + # sha256 = kernelPatchHash; + # })] + ++ builtins.map (name: { + inherit name; + patch = "${tkgSrc}/linux-tkg-patches/${mm}/${name}.patch"; + }) tkgPatches; +} From 3cc5c5271a2f70ce85dc3e37ddba3a8425b26257 Mon Sep 17 00:00:00 2001 From: LavaDesu Date: Sun, 4 Jul 2021 18:29:26 +0700 Subject: [PATCH 0018/1107] bump discord - 0.0.126 --- overlays/discord.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/overlays/discord.nix b/overlays/discord.nix index a80f48b..d64a3c1 100644 --- a/overlays/discord.nix +++ b/overlays/discord.nix @@ -1,9 +1,9 @@ self: super: { discord-canary = super.discord-canary.override rec { - version = "0.0.125"; + version = "0.0.126"; src = builtins.fetchurl { url = "https://dl-canary.discordapp.net/apps/linux/${version}/discord-canary-${version}.tar.gz"; - sha256 = "0ly5a6l7rvl54mc39xma14jrcrf11q3ndnkkr16by5hy3palmz9g"; + sha256 = "0apj1c4my17ca452wdga2zb82iqsbljbbg2fylfdvslx286r7dhj"; }; }; } From d00655275500d8f8e4d612869f5ac5779e2db1c7 Mon Sep 17 00:00:00 2001 From: LavaDesu Date: Sun, 4 Jul 2021 21:25:20 +0700 Subject: [PATCH 0019/1107] simplify flake inputs --- flake.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/flake.nix b/flake.nix index f574ebf..17a28b4 100644 --- a/flake.nix +++ b/flake.nix @@ -1,8 +1,8 @@ { inputs = { - nixpkgs = { url = "github:NixOS/nixpkgs/nixos-unstable"; }; - home-manager = { url = "github:nix-community/home-manager"; }; - secrets = { url = "github:LavaDesu/flakes-secrets"; }; + nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; + home-manager.url = "github:nix-community/home-manager"; + secrets.url = "github:LavaDesu/flakes-secrets"; home-manager.inputs.nixpkgs.follows = "nixpkgs"; }; From 9e6fd047494decb55f49a52da85a0f42d7fb8719 Mon Sep 17 00:00:00 2001 From: LavaDesu Date: Sun, 4 Jul 2021 21:28:03 +0700 Subject: [PATCH 0020/1107] various neovim configuration changes - use material.vim instead of vim-material - manage all coc extensions with nixpkgs - delete commented out plugins - new plugins (excl. old coc extensions): - coc-json - coc-yaml - nerdtree - new lsps: - rnix-lsp - deleted plugins (incl. old coc extensions): - coc-flutter - dart-vim-plugin --- users/rin/home.nix | 1 + users/rin/neovim.nix | 36 +++++++++++++++++++++--------------- 2 files changed, 22 insertions(+), 15 deletions(-) diff --git a/users/rin/home.nix b/users/rin/home.nix index d866e69..4d933b2 100644 --- a/users/rin/home.nix +++ b/users/rin/home.nix @@ -20,6 +20,7 @@ neofetch pamixer pavucontrol + rnix-lsp tor-browser-bundle-bin transcrypt transmission-remote-gtk diff --git a/users/rin/neovim.nix b/users/rin/neovim.nix index 836e7f5..33ad5de 100644 --- a/users/rin/neovim.nix +++ b/users/rin/neovim.nix @@ -3,10 +3,10 @@ let vim-material = pkgs.vimUtils.buildVimPlugin { name = "vim-material"; src = pkgs.fetchFromGitHub { - owner = "hzchirs"; - repo = "vim-material"; - rev = "05461c967b861ef532c44d5348555febac94b0d5"; - sha256 = "1w59zqrx3scqsrg1a43497xybc3m4zm00kwfqpvjfw6qrpk2zb3f"; + owner = "kaicataldo"; + repo = "material.vim"; + rev = "7dfa4bbf1fe43fcebcd836ef4f3b1342b4ea69be"; + sha256 = "1ihakmh07j47rzy76242zbipcgdn4yh5bivz09469hr1jj2snyj3"; }; }; in { @@ -17,13 +17,15 @@ in { vimdiffAlias = true; plugins = with pkgs.vimPlugins; [ - # nerdtree - # vim-fugitive - # ale coc-nvim - dart-vim-plugin + coc-eslint + coc-json + coc-rust-analyzer + coc-tsserver + coc-yaml + + nerdtree vim-airline - # vim-javascript vim-material vim-nix vim-repeat @@ -48,12 +50,12 @@ in { set expandtab " theming - set termguicolors hi MatchParen cterm=underline ctermbg=none ctermfg=white - let g:material_style='oceanic' + set termguicolors let g:airline_theme='material' - set background=dark - colorscheme vim-material + let g:material_terminal_italics = 1 + let g:material_theme_style = 'ocean' + colorscheme material " using tab for trigger completion function! s:check_back_space() abort @@ -79,11 +81,15 @@ in { " disable empty line tildes set fcs=eob:\ - - let g:coc_global_extensions = ['coc-eslint', 'coc-tsserver', 'coc-rust-analyzer', 'coc-flutter'] ''; }; xdg.configFile."nvim/coc-settings.json".text = builtins.toJSON { + languageserver = { + nix = { + command = "rnix-lsp"; + filetypes = [ "nix" ]; + }; + }; "eslint.enable" = true; "eslint.options" = { configFile = "./.eslintrc.json"; From 5ce07a047a605a2ffe4949471d950d5064dbc84e Mon Sep 17 00:00:00 2001 From: LavaDesu Date: Mon, 5 Jul 2021 10:40:52 +0700 Subject: [PATCH 0021/1107] use neovim nightly --- flake.lock | 77 ++++++++++++++++++++++++++++++++++++++++++++ flake.nix | 5 ++- users/rin/neovim.nix | 1 + 3 files changed, 82 insertions(+), 1 deletion(-) diff --git a/flake.lock b/flake.lock index 9b3aaa2..db42f85 100644 --- a/flake.lock +++ b/flake.lock @@ -1,5 +1,36 @@ { "nodes": { + "flake-compat": { + "flake": false, + "locked": { + "lastModified": 1606424373, + "narHash": "sha256-oq8d4//CJOrVj+EcOaSXvMebvuTkmBJuT5tzlfewUnQ=", + "owner": "edolstra", + "repo": "flake-compat", + "rev": "99f1c2157fba4bfe6211a321fd0ee43199025dbf", + "type": "github" + }, + "original": { + "owner": "edolstra", + "repo": "flake-compat", + "type": "github" + } + }, + "flake-utils": { + "locked": { + "lastModified": 1610051610, + "narHash": "sha256-U9rPz/usA1/Aohhk7Cmc2gBrEEKRzcW4nwPWMPwja4Y=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "3982c9903e93927c2164caa727cd3f6a0e6d14cc", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, "home-manager": { "inputs": { "nixpkgs": [ @@ -20,6 +51,51 @@ "type": "github" } }, + "neovim-flake": { + "inputs": { + "flake-utils": "flake-utils", + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "dir": "contrib", + "lastModified": 1625382879, + "narHash": "sha256-pi9EfFYaAdzCJuar24CT+nhkS29FCg2nufai1Qb0mZA=", + "owner": "neovim", + "repo": "neovim", + "rev": "490615612ed5ec587c8023de28db495b3181de30", + "type": "github" + }, + "original": { + "dir": "contrib", + "owner": "neovim", + "repo": "neovim", + "type": "github" + } + }, + "neovim-nightly": { + "inputs": { + "flake-compat": "flake-compat", + "neovim-flake": "neovim-flake", + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1625386273, + "narHash": "sha256-72a9jmmR5LDU68jiDzQuwme8DuwGgbfCoco0wIjzCq4=", + "owner": "nix-community", + "repo": "neovim-nightly-overlay", + "rev": "85ac1e60a0d8ec5bff474219bf64f2c4b320f9c1", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "neovim-nightly-overlay", + "type": "github" + } + }, "nixpkgs": { "locked": { "lastModified": 1625281901, @@ -39,6 +115,7 @@ "root": { "inputs": { "home-manager": "home-manager", + "neovim-nightly": "neovim-nightly", "nixpkgs": "nixpkgs", "secrets": "secrets" } diff --git a/flake.nix b/flake.nix index 17a28b4..b184ea7 100644 --- a/flake.nix +++ b/flake.nix @@ -2,9 +2,11 @@ inputs = { nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; home-manager.url = "github:nix-community/home-manager"; + neovim-nightly.url = "github:nix-community/neovim-nightly-overlay"; secrets.url = "github:LavaDesu/flakes-secrets"; home-manager.inputs.nixpkgs.follows = "nixpkgs"; + neovim-nightly.inputs.nixpkgs.follows = "nixpkgs"; }; outputs = inputs: with inputs; @@ -27,7 +29,8 @@ (path: nixpkgs.lib.hasSuffix ".nix" path) # Checks file extension (getPaths ./overlays) ) - ) ++ [(self: super: customPackages super)]; + ) ++ [(self: super: customPackages super)] + ++ [inputs.neovim-nightly.overlay]; revCount = "299942"; base = { config, ... }: { diff --git a/users/rin/neovim.nix b/users/rin/neovim.nix index 33ad5de..d9bd639 100644 --- a/users/rin/neovim.nix +++ b/users/rin/neovim.nix @@ -15,6 +15,7 @@ in { viAlias = true; vimAlias = true; vimdiffAlias = true; + package = pkgs.neovim-nightly; plugins = with pkgs.vimPlugins; [ coc-nvim From 3f121e3608ae70ca0aecba30dee903ff2ead58fd Mon Sep 17 00:00:00 2001 From: LavaDesu Date: Mon, 5 Jul 2021 11:24:16 +0700 Subject: [PATCH 0022/1107] add nvim-treesitter with nix and typescript --- users/rin/neovim.nix | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/users/rin/neovim.nix b/users/rin/neovim.nix index d9bd639..a62f4ba 100644 --- a/users/rin/neovim.nix +++ b/users/rin/neovim.nix @@ -34,6 +34,10 @@ in { lf-vim vim-floaterm + (nvim-treesitter.withPlugins (p: with p; [ + tree-sitter-nix + tree-sitter-typescript + ])) ]; withNodeJs = true; @@ -82,6 +86,12 @@ in { " disable empty line tildes set fcs=eob:\ + + lua < Date: Mon, 5 Jul 2021 13:41:16 +0700 Subject: [PATCH 0023/1107] switch back to vim-material --- users/rin/neovim.nix | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/users/rin/neovim.nix b/users/rin/neovim.nix index a62f4ba..0d848c5 100644 --- a/users/rin/neovim.nix +++ b/users/rin/neovim.nix @@ -3,10 +3,10 @@ let vim-material = pkgs.vimUtils.buildVimPlugin { name = "vim-material"; src = pkgs.fetchFromGitHub { - owner = "kaicataldo"; - repo = "material.vim"; - rev = "7dfa4bbf1fe43fcebcd836ef4f3b1342b4ea69be"; - sha256 = "1ihakmh07j47rzy76242zbipcgdn4yh5bivz09469hr1jj2snyj3"; + owner = "hzchirs"; + repo = "vim-material"; + rev = "05461c967b861ef532c44d5348555febac94b0d5"; + sha256 = "1w59zqrx3scqsrg1a43497xybc3m4zm00kwfqpvjfw6qrpk2zb3f"; }; }; in { @@ -58,9 +58,8 @@ in { hi MatchParen cterm=underline ctermbg=none ctermfg=white set termguicolors let g:airline_theme='material' - let g:material_terminal_italics = 1 - let g:material_theme_style = 'ocean' - colorscheme material + let g:material_style='oceanic' + colorscheme vim-material " using tab for trigger completion function! s:check_back_space() abort From b1e160b367bbabb71eb7ff5250b6ca6d7c3af96c Mon Sep 17 00:00:00 2001 From: LavaDesu Date: Mon, 5 Jul 2021 13:41:34 +0700 Subject: [PATCH 0024/1107] remove lf-vim and vim-floaterm --- users/rin/neovim.nix | 3 --- 1 file changed, 3 deletions(-) diff --git a/users/rin/neovim.nix b/users/rin/neovim.nix index 0d848c5..b3866d0 100644 --- a/users/rin/neovim.nix +++ b/users/rin/neovim.nix @@ -32,8 +32,6 @@ in { vim-repeat vim-surround - lf-vim - vim-floaterm (nvim-treesitter.withPlugins (p: with p; [ tree-sitter-nix tree-sitter-typescript @@ -76,7 +74,6 @@ in { inoremap coc#refresh() " various aliases - nnoremap :Lf nnoremap r :source $MYVIMRC command! -nargs=0 Sw w !doas tee % > /dev/null From ce9156620fbb375d1cc9d072873f5f541a0962e9 Mon Sep 17 00:00:00 2001 From: LavaDesu Date: Mon, 5 Jul 2021 13:48:41 +0700 Subject: [PATCH 0025/1107] add ctrlp-vim --- users/rin/neovim.nix | 2 ++ 1 file changed, 2 insertions(+) diff --git a/users/rin/neovim.nix b/users/rin/neovim.nix index b3866d0..c860867 100644 --- a/users/rin/neovim.nix +++ b/users/rin/neovim.nix @@ -25,6 +25,7 @@ in { coc-tsserver coc-yaml + ctrlp-vim nerdtree vim-airline vim-material @@ -74,6 +75,7 @@ in { inoremap coc#refresh() " various aliases + nnoremap :NERDTreeToggle nnoremap r :source $MYVIMRC command! -nargs=0 Sw w !doas tee % > /dev/null From 60deb2da8d6b9cd69b83a58f4933f3b34965dd46 Mon Sep 17 00:00:00 2001 From: LavaDesu Date: Mon, 5 Jul 2021 13:50:54 +0700 Subject: [PATCH 0026/1107] set cursorline --- users/rin/neovim.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/users/rin/neovim.nix b/users/rin/neovim.nix index c860867..b76fdf5 100644 --- a/users/rin/neovim.nix +++ b/users/rin/neovim.nix @@ -44,6 +44,7 @@ in { " configuration syntax enable set relativenumber number + set cursorline set noswapfile set hlsearch set ignorecase From e2408b449c4007a86de3758f77d01760e9bbddb8 Mon Sep 17 00:00:00 2001 From: LavaDesu Date: Mon, 5 Jul 2021 15:02:04 +0700 Subject: [PATCH 0027/1107] revert to cascadia-code 2102.25 i really can't handle the cursive anymore it's literally unreadable --- overlays/cascadia-code.nix | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 overlays/cascadia-code.nix diff --git a/overlays/cascadia-code.nix b/overlays/cascadia-code.nix new file mode 100644 index 0000000..7cfcf64 --- /dev/null +++ b/overlays/cascadia-code.nix @@ -0,0 +1,12 @@ +self: super: { + cascadia-code = let version = "2102.25"; in super.fetchzip { + name = "cascadia-code-${version}"; + url = "https://github.com/microsoft/cascadia-code/releases/download/v${version}/CascadiaCode-${version}.zip"; + sha256 = "14qhawcf1jmv68zdfbi2zfqdw4cf8fpk7plxzphmkqsp7hlw9pzx"; + postFetch = '' + mkdir -p $out/share/fonts/ + unzip -j $downloadedFile \*.otf -d $out/share/fonts/opentype + unzip -j $downloadedFile \*.ttf -d $out/share/fonts/truetype + ''; + }; +} From 294702c3306935986c600f7b2b9e9ce4bfc57eea Mon Sep 17 00:00:00 2001 From: LavaDesu Date: Mon, 5 Jul 2021 15:03:57 +0700 Subject: [PATCH 0028/1107] switch from material and airline to tokyonight and lualine --- users/rin/neovim.nix | 30 ++++++++++++++++-------------- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/users/rin/neovim.nix b/users/rin/neovim.nix index b76fdf5..703c4ce 100644 --- a/users/rin/neovim.nix +++ b/users/rin/neovim.nix @@ -1,12 +1,12 @@ { config, pkgs, ... }: let - vim-material = pkgs.vimUtils.buildVimPlugin { - name = "vim-material"; + tokyonight-nvim = pkgs.vimUtils.buildVimPlugin { + name = "tokyonight-nvim"; src = pkgs.fetchFromGitHub { - owner = "hzchirs"; - repo = "vim-material"; - rev = "05461c967b861ef532c44d5348555febac94b0d5"; - sha256 = "1w59zqrx3scqsrg1a43497xybc3m4zm00kwfqpvjfw6qrpk2zb3f"; + owner = "folke"; + repo = "tokyonight.nvim"; + rev = "0ead86afe390603f9bd688103d7a5fc6724a828e"; + sha256 = "1l6hscamapmqjn1kc2hrpynwwrljdlp84g27282wfvc2i0kpj884"; }; }; in { @@ -26,9 +26,9 @@ in { coc-yaml ctrlp-vim + lualine-nvim nerdtree - vim-airline - vim-material + tokyonight-nvim vim-nix vim-repeat vim-surround @@ -55,11 +55,8 @@ in { set expandtab " theming - hi MatchParen cterm=underline ctermbg=none ctermfg=white - set termguicolors - let g:airline_theme='material' - let g:material_style='oceanic' - colorscheme vim-material + let g:tokyonight_style='night' + colorscheme tokyonight " using tab for trigger completion function! s:check_back_space() abort @@ -87,9 +84,14 @@ in { set fcs=eob:\ lua < Date: Mon, 5 Jul 2021 15:05:01 +0700 Subject: [PATCH 0029/1107] add kitty --- users/rin/alacritty.nix | 2 +- users/rin/home.nix | 1 + users/rin/kitty.nix | 18 ++++++++++++++++++ users/rin/picom.nix | 2 ++ 4 files changed, 22 insertions(+), 1 deletion(-) create mode 100644 users/rin/kitty.nix diff --git a/users/rin/alacritty.nix b/users/rin/alacritty.nix index bd814dd..bf37c56 100644 --- a/users/rin/alacritty.nix +++ b/users/rin/alacritty.nix @@ -8,7 +8,7 @@ }; font = { normal = { - family = "CascadiaCode"; + family = "CascadiaCodePL"; style = "Regular"; }; size = 8.6; diff --git a/users/rin/home.nix b/users/rin/home.nix index 4d933b2..d88a513 100644 --- a/users/rin/home.nix +++ b/users/rin/home.nix @@ -38,6 +38,7 @@ ./xdg.nix ./alacritty.nix + ./kitty.nix ./mpv.nix ./neovim.nix ./npm.nix diff --git a/users/rin/kitty.nix b/users/rin/kitty.nix new file mode 100644 index 0000000..35851ca --- /dev/null +++ b/users/rin/kitty.nix @@ -0,0 +1,18 @@ +{ config, pkgs, ... }: { + programs.kitty = { + enable = true; + font = { + package = pkgs.cascadia-code; + name = "Cascadia Code PL"; + size = 13; + }; + settings = { + font_features = "-ss01 +ss19"; + enable_audio_bell = false; + }; + extraConfig = builtins.readFile (builtins.fetchurl { + url = "https://raw.githubusercontent.com/folke/tokyonight.nvim/main/extras/kitty_tokyonight_night.conf"; + sha256 = "0mgjkmn4grr7rrxc5rrs1n0cghf03gp0v55hf3phll6czjavjldf"; + }); + }; +} diff --git a/users/rin/picom.nix b/users/rin/picom.nix index 7cf8349..dfce8c1 100644 --- a/users/rin/picom.nix +++ b/users/rin/picom.nix @@ -7,6 +7,7 @@ blurExclude = [ (builtins.concatStringsSep " && " [ "class_g != 'Alacritty'" + "class_g != 'kitty'" #"class_g != 'Polybar'" "class_g != 'URxvt'" ]) @@ -17,6 +18,7 @@ opacityRule = [ "80:class_g = 'Alacritty' && !focused" + "92:class_g = 'kitty' && !focused" ]; vSync = true; From 25d6a3572294b43c96e7ea3349f11e0bc746edf7 Mon Sep 17 00:00:00 2001 From: LavaDesu Date: Wed, 7 Jul 2021 08:28:21 +0700 Subject: [PATCH 0030/1107] add js and yaml tree-sitter plugins --- users/rin/neovim.nix | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/users/rin/neovim.nix b/users/rin/neovim.nix index 703c4ce..2552f46 100644 --- a/users/rin/neovim.nix +++ b/users/rin/neovim.nix @@ -23,7 +23,6 @@ in { coc-json coc-rust-analyzer coc-tsserver - coc-yaml ctrlp-vim lualine-nvim @@ -34,8 +33,10 @@ in { vim-surround (nvim-treesitter.withPlugins (p: with p; [ + tree-sitter-javascript tree-sitter-nix tree-sitter-typescript + tree-sitter-yaml ])) ]; withNodeJs = true; @@ -53,6 +54,7 @@ in { set clipboard^=unnamed set tabstop=8 softtabstop=0 expandtab shiftwidth=4 smarttab set expandtab + let g:yaml_recommended_style=0 " theming let g:tokyonight_style='night' From 1b1ecd98182d8f15ff3c93245033e68f14320fc9 Mon Sep 17 00:00:00 2001 From: LavaDesu Date: Wed, 7 Jul 2021 08:29:57 +0700 Subject: [PATCH 0031/1107] add pnpm and use nodejs v16 --- users/rin/home.nix | 3 +++ users/rin/npm.nix | 2 -- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/users/rin/home.nix b/users/rin/home.nix index d88a513..55aa5bf 100644 --- a/users/rin/home.nix +++ b/users/rin/home.nix @@ -18,6 +18,7 @@ lf mps-youtube neofetch + nodejs-16_x pamixer pavucontrol rnix-lsp @@ -30,6 +31,8 @@ (winetricks.override { wine = wine-osu; }) xorg.xgamma youtube-dl + + nodePackages_latest.pnpm ]; }; diff --git a/users/rin/npm.nix b/users/rin/npm.nix index db86429..815cd46 100644 --- a/users/rin/npm.nix +++ b/users/rin/npm.nix @@ -1,6 +1,4 @@ { config, pkgs, ... }: { - home.packages = [ pkgs.nodejs ]; - xdg.configFile."npm/npmrc".text = '' cache=${config.xdg.dataHome}/npm/cache prefix=${config.xdg.dataHome}/npm From 9a6c7b2b3e6f9c9a9cb98bc2767fa185cb1431c5 Mon Sep 17 00:00:00 2001 From: LavaDesu Date: Wed, 7 Jul 2021 19:52:44 +0700 Subject: [PATCH 0032/1107] add coc-rename mapping --- users/rin/neovim.nix | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/users/rin/neovim.nix b/users/rin/neovim.nix index 2552f46..53c36d9 100644 --- a/users/rin/neovim.nix +++ b/users/rin/neovim.nix @@ -76,7 +76,8 @@ in { " various aliases nnoremap :NERDTreeToggle - nnoremap r :source $MYVIMRC + nnoremap rs :source $MYVIMRC + nmap rn (coc-rename) command! -nargs=0 Sw w !doas tee % > /dev/null " disable read-only warning From 1da5f5f443e4c57a97a5fc5cdac7d1bf3291f394 Mon Sep 17 00:00:00 2001 From: LavaDesu Date: Wed, 7 Jul 2021 19:53:20 +0700 Subject: [PATCH 0033/1107] remove alacritty --- users/rin/home.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/users/rin/home.nix b/users/rin/home.nix index 55aa5bf..65f9ab8 100644 --- a/users/rin/home.nix +++ b/users/rin/home.nix @@ -40,7 +40,7 @@ ./theming.nix ./xdg.nix - ./alacritty.nix + # ./alacritty.nix ./kitty.nix ./mpv.nix ./neovim.nix From 3c8155a2c48e8b08ab0bf3b773b68091178549e4 Mon Sep 17 00:00:00 2001 From: LavaDesu Date: Sat, 10 Jul 2021 01:09:36 +0700 Subject: [PATCH 0034/1107] bump kernel - 5.13.1 --- packages/linux-lava/sources.nix | 25 ++++++++++++++++--------- 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/packages/linux-lava/sources.nix b/packages/linux-lava/sources.nix index e52a5d3..bda931c 100644 --- a/packages/linux-lava/sources.nix +++ b/packages/linux-lava/sources.nix @@ -1,10 +1,10 @@ { fetchFromGitHub, lib }: let - version = "5.13.0"; + version = "5.13.1"; kernelHash = "1nc9didbjlycs9h8xahny1gwl8m8clylybnza6gl663myfbslsrz"; - kernelPatchHash = ""; - tkgRev = "1137522351b2044de4ac9edc6675b3dcb3de504a"; - tkgHash = "118hvwjjc71gh8jsyswpbap90fmqczcknxdf7bvyn7cgacaix7bq"; + kernelPatchHash = "0yaaap7z4j452q99139cajvflc6if0dm4yjhzzif9bpzd0s0fmmk"; + tkgRev = "1f9d4f458cfbd1a661fc973338e67477e0e9126c"; + tkgHash = "1jyc8vnhvfjq45gz93k50x1xsk772gbcm82i1d2jr36a562pskbc"; tkgPatches = [ "0001-mm-Support-soft-dirty-flag-reset-for-VA-range" @@ -30,6 +30,14 @@ let rev = tkgRev; sha256 = tkgHash; }; + kernelPatchSrc = { + name = "patch"; + patch = builtins.fetchurl { + url = "https://cdn.kernel.org/pub/linux/kernel/v${lib.versions.major version}.x/patch-${version}.xz"; + sha256 = kernelPatchHash; + }; + }; + mm = lib.versions.majorMinor version; in { inherit version; @@ -39,11 +47,10 @@ in { sha256 = kernelHash; }; - kernelPatches = [(patch ./si-manual-clocking.patch)] - # ++ [(builtins.fetchurl { - # url = "https://cdn.kernel.org/pub/linux/kernel/v${lib.versions.major version}.x/patch${version}.xz"; - # sha256 = kernelPatchHash; - # })] + kernelPatches = [ + kernelPatchSrc + (patch ./si-manual-clocking.patch) + ] ++ builtins.map (name: { inherit name; patch = "${tkgSrc}/linux-tkg-patches/${mm}/${name}.patch"; From c087b37ab6c446c5e4902ba450af6fc660e474a3 Mon Sep 17 00:00:00 2001 From: LavaDesu Date: Sat, 10 Jul 2021 01:14:22 +0700 Subject: [PATCH 0035/1107] bump nixpkgs - r301044.87807e64a5e --- flake.lock | 6 +++--- flake.nix | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/flake.lock b/flake.lock index db42f85..c870f08 100644 --- a/flake.lock +++ b/flake.lock @@ -98,11 +98,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1625281901, - "narHash": "sha256-DkZDtTIPzhXATqIps2ifNFpnI+PTcfMYdcrx/oFm00Q=", + "lastModified": 1625697353, + "narHash": "sha256-/v85RkZ0Z+lxipkG2sjYNRINktc8VySbLQmPbirY0hQ=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "09c38c29f2c719cd76ca17a596c2fdac9e186ceb", + "rev": "87807e64a5ef5206b745a40af118c7be8db73681", "type": "github" }, "original": { diff --git a/flake.nix b/flake.nix index b184ea7..9e6a357 100644 --- a/flake.nix +++ b/flake.nix @@ -32,7 +32,7 @@ ) ++ [(self: super: customPackages super)] ++ [inputs.neovim-nightly.overlay]; - revCount = "299942"; + revCount = "301044"; base = { config, ... }: { system = { configurationRevision = nixpkgs.lib.mkIf (self ? rev) self.rev; From 54a5ac7099e8e5570b6a008658896f2b047bdb61 Mon Sep 17 00:00:00 2001 From: LavaDesu Date: Sat, 10 Jul 2021 01:15:05 +0700 Subject: [PATCH 0036/1107] bump home-manager - 06ee8ec8dfc --- flake.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/flake.lock b/flake.lock index c870f08..5796e1e 100644 --- a/flake.lock +++ b/flake.lock @@ -38,11 +38,11 @@ ] }, "locked": { - "lastModified": 1625162737, - "narHash": "sha256-IzKTw2u/EKVr6TCQYylSAcOnrVRpir3wG3MUHj2LsTc=", + "lastModified": 1625694413, + "narHash": "sha256-goRLk1I/OMclS9i17g932wyHyjiKI+htbuFIWIkzTbw=", "owner": "nix-community", "repo": "home-manager", - "rev": "7df6656b113ce0d39c8b7d30915cafe046e1d64e", + "rev": "06ee8ec8dfc4554c374052cd7b7083765748af99", "type": "github" }, "original": { From 4bba3359b4452bfd1737db7644509d7e3049f09f Mon Sep 17 00:00:00 2001 From: LavaDesu Date: Sat, 10 Jul 2021 01:15:44 +0700 Subject: [PATCH 0037/1107] bump neovim-nightly - ad6fda0e81c --- flake.lock | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/flake.lock b/flake.lock index 5796e1e..318fd44 100644 --- a/flake.lock +++ b/flake.lock @@ -60,11 +60,11 @@ }, "locked": { "dir": "contrib", - "lastModified": 1625382879, - "narHash": "sha256-pi9EfFYaAdzCJuar24CT+nhkS29FCg2nufai1Qb0mZA=", + "lastModified": 1625818518, + "narHash": "sha256-ZF/gzwCQ/r6Yiq4fZe7DT/pQio6pO8HfJhB0Z+DJgn8=", "owner": "neovim", "repo": "neovim", - "rev": "490615612ed5ec587c8023de28db495b3181de30", + "rev": "1c416892879de6b78038f2cc2f1487eff46abb60", "type": "github" }, "original": { @@ -83,11 +83,11 @@ ] }, "locked": { - "lastModified": 1625386273, - "narHash": "sha256-72a9jmmR5LDU68jiDzQuwme8DuwGgbfCoco0wIjzCq4=", + "lastModified": 1625818601, + "narHash": "sha256-Yp/wapoOHrypGvqWppoB3Yu5w7IZvjVn4ppMfmjbWxA=", "owner": "nix-community", "repo": "neovim-nightly-overlay", - "rev": "85ac1e60a0d8ec5bff474219bf64f2c4b320f9c1", + "rev": "ad6fda0e81cd8dab6326dc1a45b11024ebcda5c2", "type": "github" }, "original": { From d900a50eaa321f09b36ee3ac942e41913d320f0f Mon Sep 17 00:00:00 2001 From: LavaDesu Date: Sat, 10 Jul 2021 07:33:17 +0700 Subject: [PATCH 0038/1107] fix systemctl autocomplete --- users/rin/zsh.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/users/rin/zsh.nix b/users/rin/zsh.nix index 1921aa6..4ac8d0a 100644 --- a/users/rin/zsh.nix +++ b/users/rin/zsh.nix @@ -108,6 +108,7 @@ in rec { enableCompletion = true; initExtraBeforeCompInit = '' + fpath+=(/run/current-system/sw/share/zsh/site-functions) zstyle ':completion:*' completer _complete zstyle ':completion:*' matcher-list "" 'm:{[:lower:][:upper:]-_}={[:upper:][:lower:]_-}' '+l:|=* r:|=*' zstyle ':completion:*' menu select From 34ce4697845cd18800c0d42f391a93abaa8c7561 Mon Sep 17 00:00:00 2001 From: LavaDesu Date: Sat, 10 Jul 2021 08:11:49 +0700 Subject: [PATCH 0039/1107] add png and jpeg mimeapps --- users/rin/xdg.nix | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/users/rin/xdg.nix b/users/rin/xdg.nix index 1515e08..2f14461 100644 --- a/users/rin/xdg.nix +++ b/users/rin/xdg.nix @@ -17,8 +17,9 @@ let "application/x-extension-xhtml" "application/x-extension-xht" ] // { - # XXX: this thing found it unwritable so it just deletes it and rewrite??? "x-scheme-handler/tg" = "userapp-Kotatogram Desktop-CHJI40.desktop"; + "image/png" = "feh.desktop"; + "image/jpeg" = "feh.desktop"; }; in { xdg = { From ce0954fc61346b8776bea8edd9cb48f6a0d4f5ba Mon Sep 17 00:00:00 2001 From: LavaDesu Date: Sat, 10 Jul 2021 09:00:21 +0700 Subject: [PATCH 0040/1107] add snapper --- hosts/winter/default.nix | 1 + hosts/winter/hardware-configuration.nix | 6 ++++++ hosts/winter/snapper.nix | 18 ++++++++++++++++++ 3 files changed, 25 insertions(+) create mode 100644 hosts/winter/snapper.nix diff --git a/hosts/winter/default.nix b/hosts/winter/default.nix index d7c8030..b587f5f 100644 --- a/hosts/winter/default.nix +++ b/hosts/winter/default.nix @@ -20,6 +20,7 @@ ./networking.nix ./packages.nix ./security.nix + ./snapper.nix ../../users/rin ]; diff --git a/hosts/winter/hardware-configuration.nix b/hosts/winter/hardware-configuration.nix index fee857b..faac99d 100644 --- a/hosts/winter/hardware-configuration.nix +++ b/hosts/winter/hardware-configuration.nix @@ -42,6 +42,12 @@ options = [ "autodefrag" "compress=zstd:3" "nossd" "nossd_spread" "relatime" "subvolid=260" ]; }; + fileSystems."/home/.snapshots" = + { device = "/dev/disk/by-uuid/8f0ba28e-5dff-4a4e-8db0-aa72cc90cb5d"; + fsType = "btrfs"; + options = [ "autodefrag" "compress=zstd:3" "nossd" "nossd_spread" "relatime" "subvolid=319" ]; + }; + fileSystems."/root" = { device = "/dev/disk/by-uuid/8f0ba28e-5dff-4a4e-8db0-aa72cc90cb5d"; fsType = "btrfs"; diff --git a/hosts/winter/snapper.nix b/hosts/winter/snapper.nix new file mode 100644 index 0000000..2bb55f0 --- /dev/null +++ b/hosts/winter/snapper.nix @@ -0,0 +1,18 @@ +{ config, lib, ... }: { + services.snapper = { + configs.home = { + fstype = "btrfs"; + subvolume = "/home"; + extraConfig = lib.concatStringsSep "\n" (lib.mapAttrsToList (k: v: "${k}=${v}") { + TIMELINE_CLEANUP = "yes"; + TIMELINE_CREATE = "yes"; + TIMELINE_MIN_AGE = "1800"; + TIMELINE_LIMIT_HOURLY = "5"; + TIMELINE_LIMIT_DAILY = "7"; + TIMELINE_LIMIT_WEEKLY = "0"; + TIMELINE_LIMIT_MONTHLY = "0"; + TIMELINE_LIMIT_YEARLY = "0"; + }); + }; + }; +} From afa16aafccf7a1b8f810d006193d3ac9fc3b7520 Mon Sep 17 00:00:00 2001 From: LavaDesu Date: Sun, 11 Jul 2021 11:21:09 +0700 Subject: [PATCH 0041/1107] slightly increase opacity of kitty when unfocused --- users/rin/picom.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/users/rin/picom.nix b/users/rin/picom.nix index dfce8c1..7f95dfb 100644 --- a/users/rin/picom.nix +++ b/users/rin/picom.nix @@ -18,7 +18,7 @@ opacityRule = [ "80:class_g = 'Alacritty' && !focused" - "92:class_g = 'kitty' && !focused" + "95:class_g = 'kitty' && !focused" ]; vSync = true; From 2bc503a79152ac48cc36b6a40812350dd9bc4615 Mon Sep 17 00:00:00 2001 From: LavaDesu Date: Sun, 11 Jul 2021 11:48:02 +0700 Subject: [PATCH 0042/1107] move windowManager.i3 packages to home-manager oh my god i just realised my rofi configuration was ignored --- hosts/winter/gui.nix | 14 -------------- users/rin/home.nix | 4 ++++ users/rin/rofi.nix | 2 ++ 3 files changed, 6 insertions(+), 14 deletions(-) diff --git a/hosts/winter/gui.nix b/hosts/winter/gui.nix index 15cb649..6ad91dc 100644 --- a/hosts/winter/gui.nix +++ b/hosts/winter/gui.nix @@ -42,19 +42,5 @@ }; }; xkbOptions = "caps:escape"; - windowManager.i3 = { - enable = true; - package = pkgs.i3-gaps; - extraPackages = with pkgs; [ - dunst - feh - lxappearance - maim - picom - polybar - rofi - xclip - ]; - }; }; } diff --git a/users/rin/home.nix b/users/rin/home.nix index 65f9ab8..2f9e019 100644 --- a/users/rin/home.nix +++ b/users/rin/home.nix @@ -8,6 +8,7 @@ brave discord-canary element-desktop + feh ffmpeg gnome.file-roller ghidra-bin @@ -16,6 +17,8 @@ inkscape kotatogram-desktop lf + lxappearance + maim mps-youtube neofetch nodejs-16_x @@ -29,6 +32,7 @@ vlc wine-osu (winetricks.override { wine = wine-osu; }) + xclip xorg.xgamma youtube-dl diff --git a/users/rin/rofi.nix b/users/rin/rofi.nix index 6ec88d0..f32e183 100644 --- a/users/rin/rofi.nix +++ b/users/rin/rofi.nix @@ -1,7 +1,9 @@ { config, ... }: { programs.rofi = { + enable = true; font = "Open Sans 10"; scrollbar = false; + terminal = "kitty"; #theme = builtins.fetchUrl {}; }; } From e3c0bc48ab0a65978ee516c2ed01747f7905ead6 Mon Sep 17 00:00:00 2001 From: LavaDesu Date: Sun, 11 Jul 2021 13:54:48 +0700 Subject: [PATCH 0043/1107] add rust and toml tree-sitter plugins --- users/rin/neovim.nix | 2 ++ 1 file changed, 2 insertions(+) diff --git a/users/rin/neovim.nix b/users/rin/neovim.nix index 53c36d9..4bb0941 100644 --- a/users/rin/neovim.nix +++ b/users/rin/neovim.nix @@ -35,6 +35,8 @@ in { (nvim-treesitter.withPlugins (p: with p; [ tree-sitter-javascript tree-sitter-nix + tree-sitter-rust + tree-sitter-toml tree-sitter-typescript tree-sitter-yaml ])) From 927488c5a90e00d22147929b3eff0734686e009f Mon Sep 17 00:00:00 2001 From: LavaDesu Date: Mon, 12 Jul 2021 09:46:15 +0700 Subject: [PATCH 0044/1107] move zsh.sessionVariables to home.sessionVariables --- users/rin/home.nix | 26 ++++++++++++++++++++++++++ users/rin/zsh.nix | 25 ------------------------- 2 files changed, 26 insertions(+), 25 deletions(-) diff --git a/users/rin/home.nix b/users/rin/home.nix index 2f9e019..d9821c3 100644 --- a/users/rin/home.nix +++ b/users/rin/home.nix @@ -38,6 +38,32 @@ nodePackages_latest.pnpm ]; + + sessionVariables = { + PATH = builtins.concatStringsSep ":" [ + "${config.home.homeDirectory}/.local/bin" + "${config.xdg.dataHome}/npm/bin" + "$PATH" + ]; + + XAUTHORITY = "$XDG_RUNTIME_DIR/Xauthority"; + EDITOR = "nvim"; + + _JAVA_OPTIONS = "-Djava.util.prefs.userRoot=${config.xdg.configHome}/java"; + CARGO_HOME = "${config.xdg.dataHome}/cargo"; + DIRENV_LOG_FORMAT = ""; + GNUPGHOME = "${config.xdg.dataHome}/gnupg"; + GTK2_RC_FILES = "${config.xdg.configHome}/gtk-2.0/gtkrc"; + LESSHISTFILE = "-"; + NODE_REPL_HISTORY="${config.xdg.dataHome}/nodejs/repl_history"; + NPM_CONFIG_USERCONFIG = "${config.xdg.configHome}/npm/npmrc"; + PUB_CACHE = "${config.xdg.cacheHome}/dart"; + WGETRC = "${config.xdg.configHome}/wgetrc"; + XINITRC = "${config.xdg.configHome}/xorg/xinitrc"; + + WINEPREFIX = "${config.xdg.dataHome}/wine64"; + WINEARCH = "win64"; + }; }; imports = [ diff --git a/users/rin/zsh.nix b/users/rin/zsh.nix index 4ac8d0a..3a2e8cb 100644 --- a/users/rin/zsh.nix +++ b/users/rin/zsh.nix @@ -116,31 +116,6 @@ in rec { zmodload zsh/complist ''; - sessionVariables = { - PATH = builtins.concatStringsSep ":" [ - "${config.home.homeDirectory}/.local/bin" - "${config.xdg.dataHome}/npm/bin" - "$PATH" - ]; - - XAUTHORITY = "$XDG_RUNTIME_DIR/Xauthority"; - EDITOR = "nvim"; - - _JAVA_OPTIONS = "-Djava.util.prefs.userRoot=${config.xdg.configHome}/java"; - CARGO_HOME = "${config.xdg.dataHome}/cargo"; - DIRENV_LOG_FORMAT = ""; - GNUPGHOME = "${config.xdg.dataHome}/gnupg"; - GTK2_RC_FILES = "${config.xdg.configHome}/gtk-2.0/gtkrc"; - LESSHISTFILE = "-"; - NODE_REPL_HISTORY="${config.xdg.dataHome}/nodejs/repl_history"; - NPM_CONFIG_USERCONFIG = "${config.xdg.configHome}/npm/npmrc"; - PUB_CACHE = "${config.xdg.cacheHome}/dart"; - WGETRC = "${config.xdg.configHome}/wgetrc"; - XINITRC = "${config.xdg.configHome}/xorg/xinitrc"; - - WINEPREFIX = "${config.xdg.dataHome}/wine64"; - WINEARCH = "win64"; - }; localVariables = { PS1 = "%B%{$fg[red]%}[%{$fg[yellow]%}%n%{$fg[green]%}@%{$fg[blue]%}%M %{$fg[magenta]%}%~%{$fg[red]%}]%{$reset_color%}$%b "; ZSH_AUTOSUGGEST_STRATEGY = ["completion"]; From 4f7670e690085afe00da6a45cfa112c6203e86f6 Mon Sep 17 00:00:00 2001 From: LavaDesu Date: Mon, 12 Jul 2021 10:03:53 +0700 Subject: [PATCH 0045/1107] fix zsh vim-mode delay when exiting insert --- users/rin/zsh.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/users/rin/zsh.nix b/users/rin/zsh.nix index 3a2e8cb..cab44aa 100644 --- a/users/rin/zsh.nix +++ b/users/rin/zsh.nix @@ -117,6 +117,7 @@ in rec { ''; localVariables = { + KEYTIMEOUT = "1"; PS1 = "%B%{$fg[red]%}[%{$fg[yellow]%}%n%{$fg[green]%}@%{$fg[blue]%}%M %{$fg[magenta]%}%~%{$fg[red]%}]%{$reset_color%}$%b "; ZSH_AUTOSUGGEST_STRATEGY = ["completion"]; ZSH_AUTOSUGGEST_USE_ASYNC = true; From 044bdc3ed918ea1387b602bd707f3f647c10769e Mon Sep 17 00:00:00 2001 From: LavaDesu Date: Mon, 12 Jul 2021 10:09:38 +0700 Subject: [PATCH 0046/1107] add pure --- users/rin/zsh.nix | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/users/rin/zsh.nix b/users/rin/zsh.nix index cab44aa..c217acb 100644 --- a/users/rin/zsh.nix +++ b/users/rin/zsh.nix @@ -118,7 +118,7 @@ in rec { localVariables = { KEYTIMEOUT = "1"; - PS1 = "%B%{$fg[red]%}[%{$fg[yellow]%}%n%{$fg[green]%}@%{$fg[blue]%}%M %{$fg[magenta]%}%~%{$fg[red]%}]%{$reset_color%}$%b "; + #PS1 = "%B%{$fg[red]%}[%{$fg[yellow]%}%n%{$fg[green]%}@%{$fg[blue]%}%M %{$fg[magenta]%}%~%{$fg[red]%}]%{$reset_color%}$%b "; ZSH_AUTOSUGGEST_STRATEGY = ["completion"]; ZSH_AUTOSUGGEST_USE_ASYNC = true; ZSH_AUTOSUGGEST_BUFFER_MAX_SIZE = 40; @@ -132,7 +132,7 @@ in rec { autoload -U colors && colors ''; initExtra = lib.concatStringsSep "\n" [ - # pure + pure cursorShape direnv genAbbrs @@ -167,15 +167,15 @@ in rec { sha256 = "0m102makrfz1ibxq8rx77nngjyhdqrm8hsrr9342zzhq1nf4wxxc"; }; } - # { - # name = "pure"; - # src = pkgs.fetchFromGitHub { - # owner = "sindresorhus"; - # repo = "pure"; - # rev = "43aafe0b4dc05174c57ee623c03c64400e832ece"; - # sha256 = "0dadhbmq9ijk9nvkg936axgp12x2v2wppxqvlzn095d6v9nikc9p"; - # }; - # } + { + name = "pure"; + src = pkgs.fetchFromGitHub { + owner = "sindresorhus"; + repo = "pure"; + rev = "43aafe0b4dc05174c57ee623c03c64400e832ece"; + sha256 = "0qfs7rvpyd8jb7x4ziqrkh0b6g9ldds8sn6qbqgrir80vdk90gpa"; + }; + } ]; }; } From 835b7895dcf782a21c9fbf397ccbfe48c910d93b Mon Sep 17 00:00:00 2001 From: LavaDesu Date: Mon, 12 Jul 2021 11:22:28 +0700 Subject: [PATCH 0047/1107] add keybinding to switch bspwm nodes --- users/rin/sxhkd.nix | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/users/rin/sxhkd.nix b/users/rin/sxhkd.nix index e96d8b4..2f6dbfc 100644 --- a/users/rin/sxhkd.nix +++ b/users/rin/sxhkd.nix @@ -35,6 +35,10 @@ in rec { "super + {h,j,k,l}" = "bspc node -f {west,south,north,east}"; "super + {Left,Down,Up,Right}" = "bspc node -f {west,south,north,east}"; + # Switch windows + "super + shift + {h,j,k,l}" = "bspc node -s {west,south,north,east}"; + "super + shift + {Left,Down,Up,Right}" = "bspc node -s {west,south,north,east}"; + # Move focused window "super + shift + {1-9,0}" = "bspc node -d ^{1-9,10}"; From 112011f7667f7a00c46c64efa29afd7ef9f9d5b8 Mon Sep 17 00:00:00 2001 From: LavaDesu Date: Wed, 14 Jul 2021 07:40:27 +0700 Subject: [PATCH 0048/1107] use flakes' revCount as part of the system version also disabled dirty rebuilds --- flake.nix | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/flake.nix b/flake.nix index 9e6a357..444c364 100644 --- a/flake.nix +++ b/flake.nix @@ -32,13 +32,16 @@ ) ++ [(self: super: customPackages super)] ++ [inputs.neovim-nightly.overlay]; - revCount = "301044"; base = { config, ... }: { - system = { - configurationRevision = nixpkgs.lib.mkIf (self ? rev) self.rev; + system = rec { + configurationRevision = + if self ? rev + then self.rev + else throw "Refusing to build from a dirty Git tree!"; nixos = rec { version = config.system.nixos.release + versionSuffix; - versionSuffix = ".${nixpkgs.lib.substring 0 8 (nixpkgs.lastModifiedDate or nixpkgs.lastModified or "19700101")}.r${revCount}-${nixpkgs.lib.substring 0 11 (nixpkgs.rev or "dirty")}"; + versionSuffix = "-${config.system.name}.r${builtins.toString self.revCount}.${self.shortRev}"; + #versionSuffix = ".${nixpkgs.lib.substring 0 8 (nixpkgs.lastModifiedDate or nixpkgs.lastModified or "19700101")}.r${revCount}-${nixpkgs.lib.substring 0 11 (nixpkgs.rev or "dirty")}"; }; }; nix.registry.nixpkgs.flake = nixpkgs; From de251c5fddaa6a1fcba5ee1fc73a949fddb9ddc6 Mon Sep 17 00:00:00 2001 From: LavaDesu Date: Wed, 14 Jul 2021 07:42:25 +0700 Subject: [PATCH 0049/1107] switch to nixpkgs master --- flake.lock | 7 +++---- flake.nix | 2 +- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/flake.lock b/flake.lock index 318fd44..ec87e45 100644 --- a/flake.lock +++ b/flake.lock @@ -98,16 +98,15 @@ }, "nixpkgs": { "locked": { - "lastModified": 1625697353, - "narHash": "sha256-/v85RkZ0Z+lxipkG2sjYNRINktc8VySbLQmPbirY0hQ=", + "lastModified": 1626221774, + "narHash": "sha256-in6vs5BcFs1XTC6NS7K8KtyYMB58ks5LtXV2LjOT4Dc=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "87807e64a5ef5206b745a40af118c7be8db73681", + "rev": "a22d0fb4cf1dbee4ccf2fdc10e9f53aaafdb1128", "type": "github" }, "original": { "owner": "NixOS", - "ref": "nixos-unstable", "repo": "nixpkgs", "type": "github" } diff --git a/flake.nix b/flake.nix index 444c364..cf0aa95 100644 --- a/flake.nix +++ b/flake.nix @@ -1,6 +1,6 @@ { inputs = { - nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; + nixpkgs.url = "github:NixOS/nixpkgs"; home-manager.url = "github:nix-community/home-manager"; neovim-nightly.url = "github:nix-community/neovim-nightly-overlay"; secrets.url = "github:LavaDesu/flakes-secrets"; From ebbb84b3b54dda39728bd5722833760b1a05b083 Mon Sep 17 00:00:00 2001 From: LavaDesu Date: Wed, 14 Jul 2021 07:43:37 +0700 Subject: [PATCH 0050/1107] use nixpkgs' tokyonight-nvim --- users/rin/neovim.nix | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/users/rin/neovim.nix b/users/rin/neovim.nix index 4bb0941..a96b203 100644 --- a/users/rin/neovim.nix +++ b/users/rin/neovim.nix @@ -1,15 +1,4 @@ -{ config, pkgs, ... }: -let - tokyonight-nvim = pkgs.vimUtils.buildVimPlugin { - name = "tokyonight-nvim"; - src = pkgs.fetchFromGitHub { - owner = "folke"; - repo = "tokyonight.nvim"; - rev = "0ead86afe390603f9bd688103d7a5fc6724a828e"; - sha256 = "1l6hscamapmqjn1kc2hrpynwwrljdlp84g27282wfvc2i0kpj884"; - }; - }; -in { +{ config, pkgs, ... }: { programs.neovim = { enable = true; viAlias = true; From 6028b2c3b55255c661398bc34836323040b6df1d Mon Sep 17 00:00:00 2001 From: LavaDesu Date: Wed, 14 Jul 2021 10:50:29 +0700 Subject: [PATCH 0051/1107] add vim ft in zsh.nix --- users/rin/zsh.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/users/rin/zsh.nix b/users/rin/zsh.nix index c217acb..047bcb2 100644 --- a/users/rin/zsh.nix +++ b/users/rin/zsh.nix @@ -1,3 +1,4 @@ +# vim: ft=nix { config, pkgs, ... }: let lib = pkgs.lib; From ced0bbf2a9cd85db8f8074a8a70d4120937404b4 Mon Sep 17 00:00:00 2001 From: LavaDesu Date: Wed, 14 Jul 2021 10:55:11 +0700 Subject: [PATCH 0052/1107] bump home-manager --- flake.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/flake.lock b/flake.lock index ec87e45..18da90e 100644 --- a/flake.lock +++ b/flake.lock @@ -38,11 +38,11 @@ ] }, "locked": { - "lastModified": 1625694413, - "narHash": "sha256-goRLk1I/OMclS9i17g932wyHyjiKI+htbuFIWIkzTbw=", + "lastModified": 1626073055, + "narHash": "sha256-vocByfpVu6m9zvtJugDvmd6/9iT2HJuG4tmDICKd0lI=", "owner": "nix-community", "repo": "home-manager", - "rev": "06ee8ec8dfc4554c374052cd7b7083765748af99", + "rev": "775cb20bd4af7781fbf336fb201df02ee3d544bb", "type": "github" }, "original": { From 1432ea461ccbfd730f3f21a08b15640c223eb97a Mon Sep 17 00:00:00 2001 From: LavaDesu Date: Wed, 14 Jul 2021 11:02:42 +0700 Subject: [PATCH 0053/1107] flake-managed zsh plugins --- flake.lock | 70 ++++++++++++++++++++++++++++++++++++++++++++++- flake.nix | 8 ++++++ users/rin/zsh.nix | 49 ++++++++------------------------- 3 files changed, 88 insertions(+), 39 deletions(-) diff --git a/flake.lock b/flake.lock index 18da90e..53c62fb 100644 --- a/flake.lock +++ b/flake.lock @@ -116,7 +116,11 @@ "home-manager": "home-manager", "neovim-nightly": "neovim-nightly", "nixpkgs": "nixpkgs", - "secrets": "secrets" + "secrets": "secrets", + "zsh-abbr": "zsh-abbr", + "zsh-fast-syntax-highlighting": "zsh-fast-syntax-highlighting", + "zsh-history-substring-search": "zsh-history-substring-search", + "zsh-pure": "zsh-pure" } }, "secrets": { @@ -133,6 +137,70 @@ "repo": "flakes-secrets", "type": "github" } + }, + "zsh-abbr": { + "flake": false, + "locked": { + "lastModified": 1619965311, + "narHash": "sha256-+oOk2ePd4/OjmRP245Kb5ku/R1PAQCI6IJth7GbcnwQ=", + "owner": "olets", + "repo": "zsh-abbr", + "rev": "99af0455b7b86ff3894a4bcf73380be2d595fa54", + "type": "github" + }, + "original": { + "owner": "olets", + "repo": "zsh-abbr", + "type": "github" + } + }, + "zsh-fast-syntax-highlighting": { + "flake": false, + "locked": { + "lastModified": 1621022231, + "narHash": "sha256-rHdOnA0Y/i/ISDlriGrGDXr5rD2nZ4T7iuG7PFUVIFQ=", + "owner": "zdharma", + "repo": "fast-syntax-highlighting", + "rev": "817916dfa907d179f0d46d8de355e883cf67bd97", + "type": "github" + }, + "original": { + "owner": "zdharma", + "repo": "fast-syntax-highlighting", + "type": "github" + } + }, + "zsh-history-substring-search": { + "flake": false, + "locked": { + "lastModified": 1557707754, + "narHash": "sha256-Ptxik1r6anlP7QTqsN1S2Tli5lyRibkgGlVlwWZRG3k=", + "owner": "zsh-users", + "repo": "zsh-history-substring-search", + "rev": "0f80b8eb3368b46e5e573c1d91ae69eb095db3fb", + "type": "github" + }, + "original": { + "owner": "zsh-users", + "repo": "zsh-history-substring-search", + "type": "github" + } + }, + "zsh-pure": { + "flake": false, + "locked": { + "lastModified": 1626016475, + "narHash": "sha256-6j6QZtsA5ZgfXthYjXRrND2zAJwZx0/6WRI1f3c+2mE=", + "owner": "sindresorhus", + "repo": "pure", + "rev": "f4c6d79ba2417d63c8008b6acce628631fd462ec", + "type": "github" + }, + "original": { + "owner": "sindresorhus", + "repo": "pure", + "type": "github" + } } }, "root": "root", diff --git a/flake.nix b/flake.nix index cf0aa95..0918311 100644 --- a/flake.nix +++ b/flake.nix @@ -7,6 +7,12 @@ home-manager.inputs.nixpkgs.follows = "nixpkgs"; neovim-nightly.inputs.nixpkgs.follows = "nixpkgs"; + + # zsh plugins + zsh-abbr = { url = "github:olets/zsh-abbr"; flake = false; }; + zsh-history-substring-search = { url = "github:zsh-users/zsh-history-substring-search"; flake = false; }; + zsh-fast-syntax-highlighting = { url = "github:zdharma/fast-syntax-highlighting"; flake = false; }; + zsh-pure = { url = "github:sindresorhus/pure"; flake = false; }; }; outputs = inputs: with inputs; @@ -52,6 +58,7 @@ home-manager = { useGlobalPkgs = true; useUserPackages = true; + extraSpecialArgs = { inherit inputs; }; }; }; in @@ -65,6 +72,7 @@ ./hosts/winter secrets.nixosModules.winter ]; + specialArgs = { inherit inputs; }; }; packages.x86_64-linux = customPackages nixpkgs.legacyPackages.x86_64-linux; }; diff --git a/users/rin/zsh.nix b/users/rin/zsh.nix index 047bcb2..e66fcab 100644 --- a/users/rin/zsh.nix +++ b/users/rin/zsh.nix @@ -1,8 +1,13 @@ # vim: ft=nix -{ config, pkgs, ... }: +{ config, inputs, pkgs, ... }: let lib = pkgs.lib; + pluginFromInput = name: { + inherit name; + src = inputs.${name}; + }; + abbrs = { e = "$EDITOR"; rs = "source ~/.config/zsh/.zshrc"; @@ -140,43 +145,11 @@ in rec { viExtraNav ]; - plugins = [ - { - name = "zsh-abbr"; - src = pkgs.fetchFromGitHub { - owner = "olets"; - repo = "zsh-abbr"; - rev = "99af0455b7b86ff3894a4bcf73380be2d595fa54"; - sha256 = "014zvikfqqcv40x24h60ad3vyjz6kf9f7xhkk6iz7qyxwgcs90zs"; - }; - } - { - name = "zsh-history-substring-search"; - src = pkgs.fetchFromGitHub { - owner = "zsh-users"; - repo = "zsh-history-substring-search"; - rev = "0f80b8eb3368b46e5e573c1d91ae69eb095db3fb"; - sha256 = "0y8va5kc2ram38hbk2cibkk64ffrabfv1sh4xm7pjspsba9n5p1y"; - }; - } - { - name = "fast-syntax-highlighting"; - src = pkgs.fetchFromGitHub { - owner = "zdharma"; - repo = "fast-syntax-highlighting"; - rev = "817916dfa907d179f0d46d8de355e883cf67bd97"; - sha256 = "0m102makrfz1ibxq8rx77nngjyhdqrm8hsrr9342zzhq1nf4wxxc"; - }; - } - { - name = "pure"; - src = pkgs.fetchFromGitHub { - owner = "sindresorhus"; - repo = "pure"; - rev = "43aafe0b4dc05174c57ee623c03c64400e832ece"; - sha256 = "0qfs7rvpyd8jb7x4ziqrkh0b6g9ldds8sn6qbqgrir80vdk90gpa"; - }; - } + plugins = builtins.map (e: pluginFromInput e) [ + "zsh-abbr" + "zsh-history-substring-search" + "zsh-fast-syntax-highlighting" + "zsh-pure" ]; }; } From ac5e26ecda95bda0f8832dce0a6dbcef08485d56 Mon Sep 17 00:00:00 2001 From: LavaDesu Date: Wed, 14 Jul 2021 13:41:54 +0700 Subject: [PATCH 0054/1107] disallow dirty git trees --- flake.nix | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/flake.nix b/flake.nix index 0918311..f5b6ac4 100644 --- a/flake.nix +++ b/flake.nix @@ -38,12 +38,10 @@ ) ++ [(self: super: customPackages super)] ++ [inputs.neovim-nightly.overlay]; - base = { config, ... }: { + base = if !(self ? rev) then throw "Dirty git tree detected." else + { config, ... }: { system = rec { - configurationRevision = - if self ? rev - then self.rev - else throw "Refusing to build from a dirty Git tree!"; + configurationRevision = self.rev; nixos = rec { version = config.system.nixos.release + versionSuffix; versionSuffix = "-${config.system.name}.r${builtins.toString self.revCount}.${self.shortRev}"; From 84f9815ebb8d0f95bec93f2fb990c7c1bb6fd3e2 Mon Sep 17 00:00:00 2001 From: LavaDesu Date: Thu, 15 Jul 2021 08:39:09 +0700 Subject: [PATCH 0055/1107] disallow ssh root login and password auth --- hosts/winter/security.nix | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/hosts/winter/security.nix b/hosts/winter/security.nix index 78748e5..0cfde8e 100644 --- a/hosts/winter/security.nix +++ b/hosts/winter/security.nix @@ -1,6 +1,11 @@ { config, pkgs, ... }: { networking.firewall.enable = false; - services.openssh.enable = true; + + services.openssh = { + enable = true; + permitRootLogin = "no"; + passwordAuthentication = false; + }; security = { polkit.enable = true; From 5008989f2ebc49ce4b1cc6937e8d2cb599fe4d11 Mon Sep 17 00:00:00 2001 From: LavaDesu Date: Thu, 15 Jul 2021 09:46:28 +0700 Subject: [PATCH 0056/1107] set snapper cleanup interval to 1h --- hosts/winter/snapper.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/hosts/winter/snapper.nix b/hosts/winter/snapper.nix index 2bb55f0..6883355 100644 --- a/hosts/winter/snapper.nix +++ b/hosts/winter/snapper.nix @@ -1,5 +1,6 @@ { config, lib, ... }: { services.snapper = { + cleanupInterval = "1h"; configs.home = { fstype = "btrfs"; subvolume = "/home"; From 38f13494a2dbee3845e22786267104cb51234e50 Mon Sep 17 00:00:00 2001 From: LavaDesu Date: Thu, 15 Jul 2021 08:49:41 +0700 Subject: [PATCH 0057/1107] set polybar title font style to bold --- users/rin/polybar.bspwm.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/users/rin/polybar.bspwm.nix b/users/rin/polybar.bspwm.nix index 021a70d..5ec7de9 100644 --- a/users/rin/polybar.bspwm.nix +++ b/users/rin/polybar.bspwm.nix @@ -21,7 +21,7 @@ wm-restack = "bspwm"; font = [ - "NotoSans:style=Regular:size=11:antialias=true;2" + "NotoSans:style=SemiBold:size=11:antialias=true;2" "NotoSans:size=11:antialias=true;2" "MaterialIcons:size=17:antialias=true;6" From 57f5f73554eac8342052b30f125700ce12069c69 Mon Sep 17 00:00:00 2001 From: LavaDesu Date: Thu, 15 Jul 2021 10:08:13 +0700 Subject: [PATCH 0058/1107] make h:m time in polybar bold --- users/rin/polybar.bspwm.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/users/rin/polybar.bspwm.nix b/users/rin/polybar.bspwm.nix index 5ec7de9..88ced08 100644 --- a/users/rin/polybar.bspwm.nix +++ b/users/rin/polybar.bspwm.nix @@ -85,8 +85,8 @@ "module/datetime" = { type = "internal/date"; date = { - text = "%{T2}%%{F#fff}%H:%M%%{F-}"; - alt = "%{T2}%%{F#ccc}%A, %d %B %Y %%{F#fff}%H:%M%%{F#666}:%%{F#ccc}%S%%{F-}"; + text = "%{T1}%%{F#fff}%H:%M%%{F-}"; + alt = "%{T2}%%{F#ccc}%A, %d %B %Y %{T1}%%{F#fff}%H:%M%%{F#666}:%{T2}%%{F#ccc}%S%%{F-}"; }; format = { padding = 4; From e5e4fc385c075fb18f18f55ba88ee2e185094e70 Mon Sep 17 00:00:00 2001 From: LavaDesu Date: Thu, 15 Jul 2021 13:39:48 +0700 Subject: [PATCH 0059/1107] merge hm-base into base --- flake.nix | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/flake.nix b/flake.nix index f5b6ac4..2cdb338 100644 --- a/flake.nix +++ b/flake.nix @@ -50,9 +50,7 @@ }; nix.registry.nixpkgs.flake = nixpkgs; nixpkgs.overlays = overlays; - }; - hm-base = { home-manager = { useGlobalPkgs = true; useUserPackages = true; @@ -66,12 +64,12 @@ modules = [ base home-manager.nixosModules.home-manager - hm-base ./hosts/winter secrets.nixosModules.winter ]; specialArgs = { inherit inputs; }; }; + packages.x86_64-linux = customPackages nixpkgs.legacyPackages.x86_64-linux; }; } From c8647160f39f02d3a24cec14c7c3dbfccf6924b5 Mon Sep 17 00:00:00 2001 From: LavaDesu Date: Thu, 15 Jul 2021 13:46:11 +0700 Subject: [PATCH 0060/1107] remove unnecessary rec --- flake.nix | 2 +- users/rin/sxhkd.nix | 3 +-- users/rin/zsh.nix | 2 +- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/flake.nix b/flake.nix index 2cdb338..7ca353a 100644 --- a/flake.nix +++ b/flake.nix @@ -40,7 +40,7 @@ base = if !(self ? rev) then throw "Dirty git tree detected." else { config, ... }: { - system = rec { + system = { configurationRevision = self.rev; nixos = rec { version = config.system.nixos.release + versionSuffix; diff --git a/users/rin/sxhkd.nix b/users/rin/sxhkd.nix index 2f6dbfc..b208461 100644 --- a/users/rin/sxhkd.nix +++ b/users/rin/sxhkd.nix @@ -2,8 +2,7 @@ let super = "Mod4"; alt = "Mod1"; - -in rec { +in { services.sxhkd = { enable = true; keybindings = { diff --git a/users/rin/zsh.nix b/users/rin/zsh.nix index e66fcab..1e22632 100644 --- a/users/rin/zsh.nix +++ b/users/rin/zsh.nix @@ -96,7 +96,7 @@ let bindkey -M vicmd 'k' history-substring-search-up bindkey -M vicmd 'j' history-substring-search-down ''; -in rec { +in { programs.zsh = { enable = true; dotDir = ".config/zsh"; From 7cd76b2b63131260de70276a42930756dd763f0d Mon Sep 17 00:00:00 2001 From: LavaDesu Date: Thu, 15 Jul 2021 13:46:01 +0700 Subject: [PATCH 0061/1107] add enableGUI option, with conditional modules depending on it --- flake.nix | 10 ++++++++-- users/rin/home.nix | 48 ++++++++++++++++++++++++---------------------- 2 files changed, 33 insertions(+), 25 deletions(-) diff --git a/flake.nix b/flake.nix index 7ca353a..6372738 100644 --- a/flake.nix +++ b/flake.nix @@ -54,7 +54,10 @@ home-manager = { useGlobalPkgs = true; useUserPackages = true; - extraSpecialArgs = { inherit inputs; }; + extraSpecialArgs = { + inherit inputs; + enableGUI = true; + }; }; }; in @@ -67,7 +70,10 @@ ./hosts/winter secrets.nixosModules.winter ]; - specialArgs = { inherit inputs; }; + specialArgs = { + inherit inputs; + enableGUI = true; + }; }; packages.x86_64-linux = customPackages nixpkgs.legacyPackages.x86_64-linux; diff --git a/users/rin/home.nix b/users/rin/home.nix index d9821c3..21d6beb 100644 --- a/users/rin/home.nix +++ b/users/rin/home.nix @@ -1,42 +1,43 @@ -{ config, pkgs, ... }: rec { +{ config, enableGUI, lib, pkgs, ... }: { home = { username = "rin"; homeDirectory = "/home/rin"; stateVersion = "21.05"; packages = with pkgs; [ appimage-run - brave - discord-canary - element-desktop - feh ffmpeg - gnome.file-roller - ghidra-bin - gimp gnupg - inkscape - kotatogram-desktop lf - lxappearance - maim mps-youtube neofetch nodejs-16_x pamixer - pavucontrol rnix-lsp - tor-browser-bundle-bin transcrypt - transmission-remote-gtk unrar - vlc wine-osu (winetricks.override { wine = wine-osu; }) - xclip - xorg.xgamma youtube-dl nodePackages_latest.pnpm + ] ++ lib.optionals enableGUI [ + brave + discord-canary + element-desktop + feh + gnome.file-roller + ghidra-bin + gimp + inkscape + kotatogram-desktop + lxappearance + maim + pavucontrol + tor-browser-bundle-bin + transmission-remote-gtk + vlc + xclip + xorg.xgamma ]; sessionVariables = { @@ -67,17 +68,18 @@ }; imports = [ + ./neovim.nix + ./npm.nix + ./zsh.nix + ] ++ lib.optionals enableGUI [ ./theming.nix ./xdg.nix # ./alacritty.nix ./kitty.nix ./mpv.nix - ./neovim.nix - ./npm.nix ./rofi.nix # ./urxvt.nix - ./zsh.nix ./dunst.nix ./picom.nix @@ -91,7 +93,7 @@ ]; programs = { - feh.enable = true; + feh.enable = enableGUI; direnv = { enable = true; @@ -123,7 +125,7 @@ clipmenu.enable = false; gpg-agent = { enable = true; - pinentryFlavor = "gnome3"; + pinentryFlavor = if enableGUI then "gnome3" else "tty"; }; }; From c8010af175bf3e95554cb14e6aa8938696d63a8e Mon Sep 17 00:00:00 2001 From: LavaDesu Date: Thu, 15 Jul 2021 14:54:02 +0700 Subject: [PATCH 0062/1107] drop unused modules and packages in user removed modules: - alacritty.nix - i3.nix - polybar.i3.nix (polybar.bspwm.nix is now renamed to just polybar.nix) - urxvt.nix removed packages: - appimage-run - ghidra-bin - inkscape - lf - mps-youtube - vlc --- users/rin/alacritty.nix | 38 --- users/rin/home.nix | 12 +- users/rin/i3.nix | 233 --------------- users/rin/polybar.i3.nix | 291 ------------------- users/rin/{polybar.bspwm.nix => polybar.nix} | 0 users/rin/urxvt.nix | 23 -- 6 files changed, 1 insertion(+), 596 deletions(-) delete mode 100644 users/rin/alacritty.nix delete mode 100644 users/rin/i3.nix delete mode 100644 users/rin/polybar.i3.nix rename users/rin/{polybar.bspwm.nix => polybar.nix} (100%) delete mode 100644 users/rin/urxvt.nix diff --git a/users/rin/alacritty.nix b/users/rin/alacritty.nix deleted file mode 100644 index bf37c56..0000000 --- a/users/rin/alacritty.nix +++ /dev/null @@ -1,38 +0,0 @@ -{ config, ... }: { - programs.alacritty = { - enable = true; - settings = { - scrolling = { - history = 10000; - multiplier = 3; - }; - font = { - normal = { - family = "CascadiaCodePL"; - style = "Regular"; - }; - size = 8.6; - }; - window = { - dynamic_title = true; - padding = { - x = 5; - y = 0; - }; - }; - # TODO: how - # hints.enabled = [{ - # command = "xdg-open"; - # post_processing = true; - # mouse = { - # enabled = true; - # mods = "Control"; - # }; - # }]; - - colors.primary.background = "#000000"; - background_opacity = 0.65; - draw_bold_text_with_bright_colors = true; - }; - }; -} diff --git a/users/rin/home.nix b/users/rin/home.nix index 21d6beb..b11d753 100644 --- a/users/rin/home.nix +++ b/users/rin/home.nix @@ -4,11 +4,8 @@ homeDirectory = "/home/rin"; stateVersion = "21.05"; packages = with pkgs; [ - appimage-run ffmpeg gnupg - lf - mps-youtube neofetch nodejs-16_x pamixer @@ -26,16 +23,13 @@ element-desktop feh gnome.file-roller - ghidra-bin gimp - inkscape kotatogram-desktop lxappearance maim pavucontrol tor-browser-bundle-bin transmission-remote-gtk - vlc xclip xorg.xgamma ]; @@ -75,21 +69,17 @@ ./theming.nix ./xdg.nix - # ./alacritty.nix ./kitty.nix ./mpv.nix ./rofi.nix - # ./urxvt.nix ./dunst.nix ./picom.nix - ./polybar.bspwm.nix - # ./polybar.i3.nix + ./polybar.nix ./xorg.nix ./sxhkd.nix ./bspwm.nix - # ./i3.nix ]; programs = { diff --git a/users/rin/i3.nix b/users/rin/i3.nix deleted file mode 100644 index 4c7cbc2..0000000 --- a/users/rin/i3.nix +++ /dev/null @@ -1,233 +0,0 @@ -{ config, pkgs, ... }: -let - super = "Mod4"; - alt = "Mod1"; - - mkGapsMode = mode: { - "plus" = "gaps ${mode} current plus 5"; - "minus" = "gaps ${mode} current minus 5"; - "0" = "gaps ${mode} current set 0"; - "Shift+plus" = "gaps ${mode} all plus 5"; - "Shift+minus" = "gaps ${mode} all minus 5"; - "Shift+0" = "gaps ${mode} all set 0"; - "Return" = "mode gapsMode"; - "Escape" = "mode default"; - }; - genGapsModes = modes: builtins.listToAttrs (builtins.map (mode: { - name = mode; - value = mkGapsMode mode; - }) modes); - genColors = states: builtins.listToAttrs (builtins.map (state: { - name = state; - value = { - background = "#2f343f"; - border = "#2f343f"; - childBorder = "#2f343f"; - indicator = "#2f343f"; - text = "#d8dee8"; - }; - }) states); - -in rec { - xsession.windowManager.i3 = { - enable = true; - package = pkgs.i3-gaps; - - config = { - startup = [ - { - # HACK: what is this lol - command = "systemctl --user restart polybar"; - always = true; - notification = false; - } - { - command = "feh --no-fehbg --bg-fill ${config.xdg.configHome}/xorg/wallpaper.png"; - always = true; - notification = false; - } - ]; - - fonts = { - names = [ - "Open Sans" - "HanaMinA" - "HanaMinB" - ]; - style = "Regular"; - size = 8.0; - }; - - floating = { - titlebar = false; - modifier = super; - border = 0; - }; - - window.border = 0; - bars = []; - - gaps = { - smartGaps = true; - inner = 5; - }; - - colors = genColors [ - "focused" - "focusedInactive" - "unfocused" - "urgent" - "placeholder" - ] // { background = "#2f343f"; }; - #colors.focused.background = "#1d242f"; - - modifier = super; - keybindings = { - # Rofi (App launcher) - "${super}+Return" = "exec rofi -lines 12 -padding 18 -width 60 -location 0 -show drun -sidebar-mode -columns 3 -font 'Noto Sans 8'"; - - # Printscreen - "Print" = "exec maim -us | tee ~/Pictures/Screenshots/$(date +%s)c.png | xclip -selection clipboard -t image/png"; - "Shift+Print" = "exec maim -u | tee ~/Pictures/Screenshots/$(date +%s).png | xclip -selection clipboard -t image/png"; - - # Quick-kill picom - "${super}+p" = "exec systemctl --user stop picom"; - "${super}+Shift+p" = "exec systemctl --user restart picom"; - - # Volume - "XF86AudioRaiseVolume" = "exec pamixer -i 5%"; - "XF86AudioLowerVolume" = "exec pamixer -d 5%"; - "XF86AudioMute" = "exec pamixer -t"; - - # Brightness - "XF86MonBrightnessUp" = "exec light -A 10"; - "XF86MonBrightnessDown" = "exec light -U 10"; - "Shift+XF86MonBrightnessUp" = "exec light -A 1"; - "Shift+XF86MonBrightnessDown" = "exec light -U 1"; - "Ctrl+XF86MonBrightnessUp" = "exec xgamma -gamma 1.3"; - "Ctrl+XF86MonBrightnessDown" = "exec xgamma -gamma 1"; - - # Music control - # "XF86AudioNext" = "exec mpc next"; - # "XF86AudioPrev" = "exec mpc prev"; - # "XF86AudioPlay" = "exec mpc toggle"; - # "XF86AudioStop" = "exec mpc stop"; - - # Kill focused window - "${super}+c" = "kill"; - "${alt}+F4" = "kill"; - - # Change focus - "${super}+Left" = "focus left"; - "${super}+Down" = "focus down"; - "${super}+Up" = "focus up"; - "${super}+Right" = "focus right"; - "${super}+h" = "focus left"; - "${super}+j" = "focus down"; - "${super}+k" = "focus up"; - "${super}+l" = "focus right"; - - # Move focused window - "${super}+Shift+Left" = "move left"; - "${super}+Shift+Down" = "move down"; - "${super}+Shift+Up" = "move up"; - "${super}+Shift+Right" = "move right"; - "${super}+Shift+h" = "move left"; - "${super}+Shift+j" = "move down"; - "${super}+Shift+k" = "move up"; - "${super}+Shift+l" = "move right"; - - # Change split modes - "${super}+b" = "split h"; - "${super}+v" = "split v"; - "${super}+s" = "layout toggle split"; - "${super}+w" = "layout tabbed"; - - # Enter fullscreen - "${super}+f" = "fullscreen toggle"; - - # Toggle floating windows - "${super}+space" = "floating toggle"; - - # Restart / Exit i3 - "${super}+Shift+r" = "restart"; - "${super}+q" = "exec i3-nagbar -m 'Exit?' -b 'Yes' 'i3-msg exit'"; - - # Modes - "${super}+r" = "mode Resize"; - "${super}+Shift+g" = "mode Gaps"; - - # Workspace switching - "${super}+1" = "workspace number $ws1"; - "${super}+2" = "workspace number $ws2"; - "${super}+3" = "workspace number $ws3"; - "${super}+4" = "workspace number $ws4"; - "${super}+5" = "workspace number $ws5"; - "${super}+6" = "workspace number $ws6"; - "${super}+7" = "workspace number $ws7"; - "${super}+8" = "workspace number $ws8"; - "${super}+9" = "workspace number $ws9"; - "${super}+0" = "workspace number $ws10"; - "${alt}+Control+Left" = "workspace prev"; - "${alt}+Control+Right" = "workspace next"; - "${alt}+Control+h" = "workspace prev"; - "${alt}+Control+l" = "workspace next"; - - "${super}+Shift+1" = "move container to workspace number $ws1"; - "${super}+Shift+2" = "move container to workspace number $ws2"; - "${super}+Shift+3" = "move container to workspace number $ws3"; - "${super}+Shift+4" = "move container to workspace number $ws4"; - "${super}+Shift+5" = "move container to workspace number $ws5"; - "${super}+Shift+6" = "move container to workspace number $ws6"; - "${super}+Shift+7" = "move container to workspace number $ws7"; - "${super}+Shift+8" = "move container to workspace number $ws8"; - "${super}+Shift+9" = "move container to workspace number $ws9"; - "${super}+Shift+0" = "move container to workspace number $ws10"; - }; - - modes = { - "Resize" = { - "Left" = "resize shrink width 5 px or 5 ppt"; - "Down" = "resize grow height 5 px or 5 ppt"; - "Up" = "resize shrink height 5 px or 5 ppt"; - "Right" = "resize grow width 5 px or 5 ppt"; - "Return" = "mode default"; - }; - "Gaps" = { - "o" = "mode Outer"; - "i" = "mode Inner"; - "h" = "mode Horizontal"; - "v" = "mode Vertical"; - "t" = "mode Top"; - "r" = "mode Right"; - "b" = "mode Bottom"; - "l" = "mode Left"; - "Return" = "mode Gaps"; - "Escape" = "mode default"; - }; - } // genGapsModes [ - "Outer" - "Inner" - "Horizontal" - "Vertical" - "Top" - "Right" - "Bottom" - "Left" - ]; - }; - - extraConfig = '' - set $ws1 "1:code" - set $ws2 "2:web" - set $ws3 "3:discord" - set $ws4 "4:game" - set $ws5 "5" - set $ws6 "6" - set $ws7 "7" - set $ws8 "8:steam" - set $ws9 "9:spotify" - set $ws10 "10:term" - ''; - }; -} diff --git a/users/rin/polybar.i3.nix b/users/rin/polybar.i3.nix deleted file mode 100644 index 215db94..0000000 --- a/users/rin/polybar.i3.nix +++ /dev/null @@ -1,291 +0,0 @@ -{ config, ... }: -let - memoryBar = { - width = 20; - foreground = [ - "#aaff77" - "#aaff77" - "#fba922" - "#ff5555" - ]; - indicator = { - text = "|"; - font = 6; - foreground = "#fff"; - }; - fill = { - text = "─"; - font = 6; - }; - empty = { - text = "─"; - font = 6; - foreground = "#444444"; - }; - }; - formatRampCoreload = text: color: { - inherit text; - font = 2; - foreground = color; - }; -in { - services.polybar = { - enable = true; - script = builtins.readFile ./scripts/polybar.sh; - settings = rec { - _base = { - monitor = "eDP-1"; - width = "100%"; - height = 22; - background = "#00"; - foreground = "#fff"; - line = { - color = "#00"; - size = 1; - }; - - enable-ipc = true; - }; - - "bar/top" = _base // { - spacing = 2; - padding = { - right = 5; - bottom = 5; - left = 5; - }; - - font = [ - "NotoSans-Regular:size=8.2;2" - "MaterialIcons:size=10;1" - "FontAwesome:size=10;3" - "NotoSans-Regular:size=10;2" - "MaterialIcons:size=12;4" - "FontAwesome5Brands:style=Solid:pixelsize=10;1" - "HanaMinA:size=9.8;1" - "HanaMinB:size=9.8;1" - ]; - - # enable-ipc = true; - modules = { - # left = "previous playpause next spotify"; - left = "title"; - right = "datetime"; - }; - }; - - "bar/bottom" = _base // { - bottom = true; - - spacing = 3; - padding = { - top = 5; - right = 5; - }; - module.margin = { - left = 2; - right = 2; - }; - - font = [ - "NotoSans-Regular:size=8.2;1" - "unifont:size=6;1" - "FontAwesome:size=10;1" - "NotoSans-Regular:size=10;1" - "MaterialIcons:size=12;4" - "FontAwesome5Brands:style=Solid:pixelsize=10;1" - ]; - - modules = { - left = "i3"; - right = "fs cpu memory swap wifi"; - }; - - tray = { - position = "right"; - padding = 2; - scale = 1.1; - }; - }; - - "module/i3" = { - type = "internal/i3"; - - format = " "; - strip.wsnumbers = true; - wrapping.scroll = false; - - ws.icon = { - text = [ - "1:code;" - "2:web;" - "3:discord;%{T6}" - "4:game;" - "8:steam;" - "9:spotify;" - "10:term;" - ]; - default = ""; - }; - - label = { - mode = { - text = "%mode%"; - padding = 5; - }; - - dimmed.underline = _base.background; - - focused = { - text = "%icon%"; - foreground = "#fff"; - background = "#773f3f3f"; - underline = "#c9665e"; - font = 4; - padding = 4; - }; - - unfocused = { - text = "%icon%"; - foreground = "#fff"; - background = "#00"; - underline = "#00"; - font = 4; - padding = 4; - }; - - visible = { - text = "%index%"; - underline = "#555555"; - padding = 4; - }; - - urgent = { - text = "%icon%"; - foreground = "#00"; - background = "#bd2c40"; - underline = "#9b0a20"; - font = 4; - padding = 4; - }; - }; - }; - - "module/cpu" = { - type = "internal/cpu"; - interval = 0.5; - label = "CPU %percentage%%"; - format = { - text = "