diff --git a/user/home/Voronind.nix b/user/home/Voronind.nix index 0f38d394..f3d40b19 100644 --- a/user/home/Voronind.nix +++ b/user/home/Voronind.nix @@ -17,6 +17,7 @@ in { ".editorconfig".source = ./module/Editorconfig; ".parallel/will-cite".text = ""; "app/bin".source = ./module/bin; + "media/template".source = ./module/template; }; # Directories. diff --git a/user/home/module/template/Android.nix b/user/home/module/template/Android.nix new file mode 100644 index 00000000..39d9c8a1 --- /dev/null +++ b/user/home/module/template/Android.nix @@ -0,0 +1,59 @@ +{ + description = "Android dev environment."; + + inputs = { + nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; + }; + + outputs = { self, nixpkgs } @inputs: let + system = "x86_64-linux"; + lib = nixpkgs.lib; + pkgs = import nixpkgs { + system = system; + config = { + allowUnfree = true; + android_sdk.accept_license = true; + }; + }; + jdk = pkgs.jdk11; + buildTools = "31.0.0"; + androidComposition = pkgs.androidenv.composeAndroidPackages { + abiVersions = [ "armeabi-v7a" "arm64-v8a" ]; + buildToolsVersions = [ buildTools ]; + cmdLineToolsVersion = "8.0"; + includeEmulator = false; + includeNDK = false; + includeSources = false; + includeSystemImages = false; + platformToolsVersion = "34.0.5"; + platformVersions = [ "31" ]; + toolsVersion = "26.1.1"; + useGoogleAPIs = false; + useGoogleTVAddOns = false; + # cmakeVersions = [ "3.10.2" ]; + # emulatorVersion = "30.3.4"; + # includeExtras = [ "extras;google;gcm" ]; + # ndkVersions = ["22.0.7026061"]; + # systemImageTypes = [ "google_apis_playstore" ]; + }; + androidSdk = androidComposition.androidsdk; + in { + devShells.${system} = { + default = pkgs.mkShell rec { + nativeBuildInputs = with pkgs; [ + android-tools + androidSdk + glibc + gnumake + jdk + ]; + buildInputs = with pkgs; []; + + GRADLE_OPTS = "-Dorg.gradle.project.android.aapt2FromMavenOverride=${androidSdk}/libexec/android-sdk/build-tools/${buildTools}/aapt2"; + JAVA_HOME = "${jdk}"; + LD_LIBRARY_PATH = "${lib.makeLibraryPath buildInputs}"; + ANDROID_SDK_ROOT = "${androidSdk}/libexec/android-sdk/"; + }; + }; + }; +} diff --git a/user/home/module/template/Blank.nix b/user/home/module/template/Blank.nix new file mode 100644 index 00000000..ebcae41f --- /dev/null +++ b/user/home/module/template/Blank.nix @@ -0,0 +1,20 @@ +{ + description = ""; + + inputs = { + nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; + }; + + outputs = { self, nixpkgs } @inputs: let + system = "x86_64-linux"; + lib = nixpkgs.lib; + pkgs = nixpkgs.legacyPackages.${system}; + in { + devShells.${system} = { + default = pkgs.mkShell rec { + nativeBuildInputs = with pkgs; [ ]; + buildInputs = with pkgs; [ ]; + }; + }; + }; +} diff --git a/user/home/module/template/FHSEnv.nix b/user/home/module/template/FHSEnv.nix new file mode 100644 index 00000000..92f38098 --- /dev/null +++ b/user/home/module/template/FHSEnv.nix @@ -0,0 +1,20 @@ +{ + description = ""; + + inputs = { + nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; + }; + + outputs = { self, nixpkgs } @inputs: let + system = "x86_64-linux"; + lib = nixpkgs.lib; + pkgs = nixpkgs.legacyPackages.${system}; + in { + devShells.${system} = { + default = with pkgs; (buildFHSEnv { + name = "FHSEnv"; + targetPkgs = pkgs: with pkgs; [ ]; + }).env; + }; + }; +} diff --git a/user/home/module/template/Latex.nix b/user/home/module/template/Latex.nix new file mode 100644 index 00000000..cee148a4 --- /dev/null +++ b/user/home/module/template/Latex.nix @@ -0,0 +1,53 @@ +{ + description = "LuaLaTeX build env."; + + inputs = { + nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; + }; + + outputs = { self, nixpkgs } @inputs: let + system = "x86_64-linux"; + lib = nixpkgs.lib; + pkgs = nixpkgs.legacyPackages.${system}; + tex = (pkgs.texlive.combine { + inherit (pkgs.texlive) scheme-basic + amsmath + babel + capt-of + catchfile + collection-fontsextra + cyrillic + dvipng + dvisvgm + environ + etoolbox + fancyhdr + fontspec + geometry + hyperref + listofitems + luacode + luatexbase + montserrat + parskip + pgf + tcolorbox + tocloft + ulem + wrapfig + xcolor; + + #(setq org-latex-compiler "lualatex") + #(setq org-preview-latex-default-process 'dvisvgm) + }); + in { + devShells.${system} = { + default = pkgs.mkShell rec { + nativeBuildInputs = with pkgs; [ + tex + ]; + buildInputs = with pkgs; [ ]; + }; + }; + }; +} diff --git a/user/home/module/template/Rust.nix b/user/home/module/template/Rust.nix new file mode 100644 index 00000000..a50c097d --- /dev/null +++ b/user/home/module/template/Rust.nix @@ -0,0 +1,37 @@ +{ + description = "Rust shell env."; + + inputs = { + nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; + }; + + outputs = { self, nixpkgs } @inputs: let + system = "x86_64-linux"; + pkgs = nixpkgs.legacyPackages.${system}; + lib = nixpkgs.lib; + in { + devShell.${system} = pkgs.mkShell rec { + nativeBuildInputs = with pkgs; [ + cargo + rustc + rust-analyzer + rustfmt + + cmake + pkg-config + fontconfig + ]; + buildInputs = with pkgs; [ + libxkbcommon + wayland + libGL + xorg.libX11 + xorg.libXrandr + xorg.libXinerama + xorg.libXcursor + xorg.libXi + ]; + LD_LIBRARY_PATH = "${lib.makeLibraryPath buildInputs}"; + }; + }; +}