From 53cd96dcfd858c9eeafd86784870cee48e3eba52 Mon Sep 17 00:00:00 2001 From: Grimmauld Date: Wed, 29 May 2024 09:47:17 +0200 Subject: [PATCH] factorio overlay --- common/gaming.nix | 6 ++++-- common/graphics/fonts.nix | 2 +- common/hardware/laptop.nix | 2 +- common/tooling/git.nix | 6 ++++++ common/tooling/python.nix | 16 +++++++++------- common/tooling/rust.nix | 4 +--- fake_flake.nix | 14 +++++++++----- modules/auth.nix | 13 ++++++++----- nix/sources.json | 14 +++++++------- overlays/default.nix | 1 + overlays/factorio.nix | 9 +++++++++ overlays/glibc-eac.nix | 12 ++++++------ 12 files changed, 62 insertions(+), 37 deletions(-) create mode 100644 overlays/factorio.nix diff --git a/common/gaming.nix b/common/gaming.nix index 918f33c..80c587d 100644 --- a/common/gaming.nix +++ b/common/gaming.nix @@ -6,7 +6,7 @@ }: let inherit (config.grimmShared) enable gaming; - inherit (lib) mkIf getExe mkEnableOption; + inherit (lib) mkIf getExe mkEnableOption optional; in { config = mkIf (enable && gaming) { @@ -45,6 +45,8 @@ in prismlauncher mangohud the-powder-toy + factorio + pactorio (symlinkJoin { name = "osu"; paths = [ @@ -54,7 +56,7 @@ in osu-lazer-bin ]; }) - ]; + ] ++ optional (factorio.passthru.updateScript != null) factorio; }; options.grimmShared.gaming = mkEnableOption "enables steam, heroic, prism and gamemoded"; diff --git a/common/graphics/fonts.nix b/common/graphics/fonts.nix index 2a07d57..740a6e9 100644 --- a/common/graphics/fonts.nix +++ b/common/graphics/fonts.nix @@ -14,7 +14,7 @@ in noto-fonts noto-fonts-cjk font-awesome -# noto-fonts-emoji + # noto-fonts-emoji noto-fonts-monochrome-emoji roboto liberation_ttf diff --git a/common/hardware/laptop.nix b/common/hardware/laptop.nix index fd67361..3adeeb9 100644 --- a/common/hardware/laptop.nix +++ b/common/hardware/laptop.nix @@ -65,7 +65,7 @@ in "sd_mod" ]; loader.systemd-boot.enable = true; -# extraModulePackages = [ config.boot.kernelPackages.ddcci-driver ]; + # extraModulePackages = [ config.boot.kernelPackages.ddcci-driver ]; kernelModules = [ "ddcci_backlight" "i2c-dev" diff --git a/common/tooling/git.nix b/common/tooling/git.nix index bacf5a0..d0f9982 100644 --- a/common/tooling/git.nix +++ b/common/tooling/git.nix @@ -47,6 +47,12 @@ in push.autoSetupRemote = true; core.autocrlf = "input"; commit.gpgsign = true; + core.excludesfile = (pkgs.writeText ".gitignore" '' + .idea + .obsidian + *~ + result + ''); pull.rebase = true; include.path = "${pkgs.delta.src}/themes.gitconfig"; diff --git a/common/tooling/python.nix b/common/tooling/python.nix index 4d36058..7ffa025 100644 --- a/common/tooling/python.nix +++ b/common/tooling/python.nix @@ -35,13 +35,15 @@ in programs.xonsh = { enable = true; - config = '' - execx($(${getExe pkgs.starship} init xonsh)) - '' + concatLines ( - mapAttrsToList ( - name: value: "aliases[\"${name}\"] = '''${value}'''" - ) config.environment.shellAliases - ); + config = + '' + execx($(${getExe pkgs.starship} init xonsh)) + '' + + concatLines ( + mapAttrsToList ( + name: value: "aliases[\"${name}\"] = '''${value}'''" + ) config.environment.shellAliases + ); # package = pkgs.xonsh.wrapper.override { extraPackages = pyLibs; }; }; diff --git a/common/tooling/rust.nix b/common/tooling/rust.nix index 80058fa..39555fb 100644 --- a/common/tooling/rust.nix +++ b/common/tooling/rust.nix @@ -25,9 +25,7 @@ in ] ++ optionals graphical [ jetbrains.clion ]; - grimmShared.tooling.nvim.plugins = with pkgs.vimPlugins; [ - rustaceanvim - ]; + grimmShared.tooling.nvim.plugins = with pkgs.vimPlugins; [ rustaceanvim ]; grimmShared.tooling.lang_servers = [ { diff --git a/fake_flake.nix b/fake_flake.nix index 5e599ab..dec3424 100644 --- a/fake_flake.nix +++ b/fake_flake.nix @@ -103,11 +103,15 @@ in in { hostPlatform = system; - pkgs = if (nixpkgs_patches != []) then (import (applyPatches { - name = "nixpkgs-patched"; - inherit src; - patches = map fetchpatch nixpkgs_patches; - }) { inherit config; }) else unpatched; + pkgs = + if (nixpkgs_patches != [ ]) then + (import (applyPatches { + name = "nixpkgs-patched"; + inherit src; + patches = map fetchpatch nixpkgs_patches; + }) { inherit config; }) + else + unpatched; overlays = [ (import ( diff --git a/modules/auth.nix b/modules/auth.nix index 106cd65..f6ddad7 100644 --- a/modules/auth.nix +++ b/modules/auth.nix @@ -75,11 +75,14 @@ in in { enable = true; - urlList = [ "ldap:///" "ldapi:///" ]; + urlList = [ + "ldap:///" + "ldapi:///" + ]; -# declarativeContents = { -# "${localDc}" = import ./ldapConf.nix { inherit localDc; }; -# }; + # declarativeContents = { + # "${localDc}" = import ./ldapConf.nix { inherit localDc; }; + # }; settings = { attrs = { @@ -105,7 +108,7 @@ in olcSuffix = localDc; olcRootDN = "cn=admin,${localDc}"; -# olcRootPW.path = config.age.secrets.openldap_admin.path; + # olcRootPW.path = config.age.secrets.openldap_admin.path; olcRootPW = "{SSHA}D1U1E6Xz07DGYLjke1YcCsVF6ddSLyLr"; olcAccess = [ diff --git a/nix/sources.json b/nix/sources.json index e5b5235..4f3edc2 100644 --- a/nix/sources.json +++ b/nix/sources.json @@ -29,10 +29,10 @@ "homepage": "https://nyx.chaotic.cx", "owner": "chaotic-cx", "repo": "nyx", - "rev": "f3685d816317958caf2bce128f80d02fee65b163", - "sha256": "1nklhkwfsyxilyzls6rw2cw9sdhlni5jnq4llj1m2w2ggw83d0wv", + "rev": "651cfaba624e7bf0876fbd528f3fa8f1b0c0c614", + "sha256": "0annk8pgx69r8jnnmxcf6n79hwm4dnxj6q0qyqwgjh0g26sa958k", "type": "tarball", - "url": "https://github.com/chaotic-cx/nyx/archive/f3685d816317958caf2bce128f80d02fee65b163.tar.gz", + "url": "https://github.com/chaotic-cx/nyx/archive/651cfaba624e7bf0876fbd528f3fa8f1b0c0c614.tar.gz", "url_template": "https://github.com///archive/.tar.gz" }, "glibc-eac": { @@ -56,7 +56,7 @@ "lix-pkg": { "branch": "main", "repo": "https://git.lix.systems/lix-project/lix.git", - "rev": "2b397c66297bab65c2b5719367a414f9a2efb7e7", + "rev": "ec5039653d6281f8bbe6158758aa721a1061082a", "type": "git" }, "nixos-mailserver": { @@ -83,10 +83,10 @@ "homepage": null, "owner": "NixOS", "repo": "nixpkgs", - "rev": "5710852ba686cc1fd0d3b8e22b3117d43ba374c2", - "sha256": "1rai87jwpfly0bpkhiaq56n3rvzhb15h72n61s42q1mpnw3vf4zh", + "rev": "bfb7a882678e518398ce9a31a881538679f6f092", + "sha256": "0zyny8h62hqfix4mrk6nf3qdvmhs49v9pkrnq80q28ji4j2qhd73", "type": "tarball", - "url": "https://github.com/NixOS/nixpkgs/archive/5710852ba686cc1fd0d3b8e22b3117d43ba374c2.tar.gz", + "url": "https://github.com/NixOS/nixpkgs/archive/bfb7a882678e518398ce9a31a881538679f6f092.tar.gz", "url_template": "https://github.com///archive/.tar.gz" } } diff --git a/overlays/default.nix b/overlays/default.nix index 053b029..6a6de7b 100644 --- a/overlays/default.nix +++ b/overlays/default.nix @@ -31,5 +31,6 @@ ./confwhich.nix ./rfindup.nix ./glibc-eac.nix + ./factorio.nix ]; } diff --git a/overlays/factorio.nix b/overlays/factorio.nix new file mode 100644 index 0000000..a977a87 --- /dev/null +++ b/overlays/factorio.nix @@ -0,0 +1,9 @@ +{ lib, prev, ... }: +let + loginFile = ./factorioLogin.nix; +in +{ + factorio = prev.factorio.override ( + { } // lib.optionalAttrs (builtins.pathExists loginFile) (import loginFile) + ); +} diff --git a/overlays/glibc-eac.nix b/overlays/glibc-eac.nix index 301eb0b..ea29097 100644 --- a/overlays/glibc-eac.nix +++ b/overlays/glibc-eac.nix @@ -1,12 +1,12 @@ -{ prev, ... }: let +{ prev, ... }: +let nivSources = import ../nix/sources.nix; - glibc_patches = [ - "rogue_company_reverts.patch" - ]; + glibc_patches = [ "rogue_company_reverts.patch" ]; in { - glibc-eac = prev.glibc.overrideAttrs(old: { - patches = ( + glibc-eac = prev.glibc.overrideAttrs (old: { + patches = + ( let oldPatches = old.patches or [ ]; in