]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Add nix flake with development environment shell and direnv. (#16047)
authorVera Aguilera Puerto <6766154+Zumorica@users.noreply.github.com>
Tue, 9 May 2023 15:28:12 +0000 (17:28 +0200)
committerGitHub <noreply@github.com>
Tue, 9 May 2023 15:28:12 +0000 (17:28 +0200)
Use with nix-direnv, `nix-shell` or `nix develop`.

.envrc [new file with mode: 0644]
.gitignore
flake.lock [new file with mode: 0644]
flake.nix [new file with mode: 0644]
shell.nix [new file with mode: 0644]

diff --git a/.envrc b/.envrc
new file mode 100644 (file)
index 0000000..3550a30
--- /dev/null
+++ b/.envrc
@@ -0,0 +1 @@
+use flake
index 97a5911fdbcae1ae057a8c15d899f8d89bfaf7fc..42c93e1fc35603bb1b86e42ca8f8ae6abbbc3639 100644 (file)
@@ -302,3 +302,6 @@ Resources/MapImages
 /Content.Docfx/*site
 
 *.bak
+
+# Direnv stuff
+.direnv/
diff --git a/flake.lock b/flake.lock
new file mode 100644 (file)
index 0000000..12bc679
--- /dev/null
@@ -0,0 +1,61 @@
+{
+  "nodes": {
+    "flake-utils": {
+      "inputs": {
+        "systems": "systems"
+      },
+      "locked": {
+        "lastModified": 1681202837,
+        "narHash": "sha256-H+Rh19JDwRtpVPAWp64F+rlEtxUWBAQW28eAi3SRSzg=",
+        "owner": "numtide",
+        "repo": "flake-utils",
+        "rev": "cfacdce06f30d2b68473a46042957675eebb3401",
+        "type": "github"
+      },
+      "original": {
+        "owner": "numtide",
+        "repo": "flake-utils",
+        "type": "github"
+      }
+    },
+    "nixpkgs": {
+      "locked": {
+        "lastModified": 1683293859,
+        "narHash": "sha256-4BTV7T76XwAfnHJ0z6hR0tk2LFxoXf40JfKzmMb2xfY=",
+        "owner": "NixOS",
+        "repo": "nixpkgs",
+        "rev": "ef47d4daa93372ae33c0b249d392e90408e06b96",
+        "type": "github"
+      },
+      "original": {
+        "owner": "NixOS",
+        "ref": "release-22.11",
+        "repo": "nixpkgs",
+        "type": "github"
+      }
+    },
+    "root": {
+      "inputs": {
+        "flake-utils": "flake-utils",
+        "nixpkgs": "nixpkgs"
+      }
+    },
+    "systems": {
+      "locked": {
+        "lastModified": 1681028828,
+        "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
+        "owner": "nix-systems",
+        "repo": "default",
+        "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
+        "type": "github"
+      },
+      "original": {
+        "owner": "nix-systems",
+        "repo": "default",
+        "type": "github"
+      }
+    }
+  },
+  "root": "root",
+  "version": 7
+}
diff --git a/flake.nix b/flake.nix
new file mode 100644 (file)
index 0000000..2f0e7b9
--- /dev/null
+++ b/flake.nix
@@ -0,0 +1,13 @@
+{
+
+  inputs.nixpkgs.url = "github:NixOS/nixpkgs/release-22.11";
+  inputs.flake-utils.url = "github:numtide/flake-utils";
+
+  outputs = { self, nixpkgs, flake-utils, ... }:
+    flake-utils.lib.simpleFlake {
+      inherit self nixpkgs;
+      name = "space-station-14-devshell";
+      shell = ./shell.nix;
+    };
+
+}
diff --git a/shell.nix b/shell.nix
new file mode 100644 (file)
index 0000000..8879b0c
--- /dev/null
+++ b/shell.nix
@@ -0,0 +1,31 @@
+{ pkgs ? import <nixpkgs> {} }:
+
+let
+  dependencies = with pkgs; [
+    dotnetCorePackages.sdk_7_0
+    glfw
+    SDL2
+    libGL
+    openal
+    freetype
+    fluidsynth
+    soundfont-fluid
+    gtk3
+    pango
+    cairo
+    atk
+    zlib
+    glib
+    gdk-pixbuf
+  ];
+in pkgs.mkShell {
+  name = "space-station-14-devshell";
+  buildInputs = [ pkgs.gtk3 ];
+  inputsFrom = dependencies;
+  shellHook = ''
+    export GLIBC_TUNABLES=glibc.rtld.dynamic_sort=1
+    export ROBUST_SOUNDFONT_OVERRIDE=${pkgs.soundfont-fluid}/share/soundfonts/FluidR3_GM2-2.sf2
+    export XDG_DATA_DIRS=$GSETTINGS_SCHEMAS_PATH
+    export LD_LIBRARY_PATH=${pkgs.lib.makeLibraryPath dependencies}
+  '';
+}