diff --git a/hosts/zilch/default.nix b/hosts/zilch/default.nix index 2d03c453..5b533dea 100755 --- a/hosts/zilch/default.nix +++ b/hosts/zilch/default.nix @@ -113,10 +113,6 @@ }; go.enable = true; java.enable = true; - javascript = { - deno.enable = true; - node.enable = true; - }; lisp = { clojure.enable = true; guile.enable = true; @@ -130,6 +126,14 @@ }; rust.enable = true; vcs.enable = true; + web = { + enable = true; + javascript = { + deno.enable = true; + node.enable = true; + }; + php.enable = true; + }; }; drivers = { veikk.enable = true; }; @@ -189,7 +193,7 @@ ] # My custom packages. - ++ (with pkgs.nur.foo-dogsquared; [ segno ]); + ++ (with pkgs.nur.foo-dogsquared; [ julia-bin license-cli openring segno ]); # Setting up the shell environment. my.env = { diff --git a/modules/desktop/audio.nix b/modules/desktop/audio.nix index 9ffb4b19..5345ba1e 100755 --- a/modules/desktop/audio.nix +++ b/modules/desktop/audio.nix @@ -21,11 +21,11 @@ in { config = mkIf cfg.enable { # Enable JACK for the most serious audio applications. - services.jack = { - jackd.enable = true; - alsa.enable = false; - loopback = { enable = true; }; - }; + # services.jack = { + # jackd.enable = true; + # alsa.enable = false; + # loopback = { enable = true; }; + # }; hardware.pulseaudio.package = pkgs.pulseaudio.override { jackaudioSupport = true; }; diff --git a/modules/dev/default.nix b/modules/dev/default.nix index abb96059..8521365e 100755 --- a/modules/dev/default.nix +++ b/modules/dev/default.nix @@ -10,12 +10,12 @@ ./gamedev.nix ./go.nix ./java.nix - ./javascript.nix ./lisp.nix ./math.nix ./perl.nix ./python.nix ./rust.nix ./vcs.nix + ./web.nix ]; } diff --git a/modules/dev/javascript.nix b/modules/dev/javascript.nix deleted file mode 100755 index a1948c1d..00000000 --- a/modules/dev/javascript.nix +++ /dev/null @@ -1,37 +0,0 @@ -# JavaScript, the poster boy of hated languages... -# I think it's pretty great, when it works. -# Otherwise, it is a disaster from its syntax and the massive ecosystem among others. -# Since I use/experiment with the ecosystem so stuff like Node and Deno are combined into one module file. -{ config, options, lib, pkgs, ... }: - -with lib; -let cfg = config.modules.dev.javascript; -in { - options.modules.dev.javascript = let - mkBoolOption = bool: - mkOption { - type = types.bool; - default = bool; - }; - in { - deno.enable = mkBoolOption false; - node.enable = mkBoolOption false; - }; - - config = { - my.packages = with pkgs; - (if cfg.deno.enable then - [ - deno # The Deltarune of Node. - ] - else - [ ]) ++ - - (if cfg.node.enable then - [ - nodejs # The JavaScript framework/runtime where you don't have to kill someone for bad code. :) - ] - else - [ ]); - }; -} diff --git a/modules/dev/python.nix b/modules/dev/python.nix index cd1ff350..187fd574 100755 --- a/modules/dev/python.nix +++ b/modules/dev/python.nix @@ -16,30 +16,37 @@ in { in { enable = mkBoolOption false; math.enable = mkBoolOption false; + pkg = mkOption { + type = types.package; + default = pkgs.python37; + }; }; config = mkIf cfg.enable { - my.packages = with pkgs; - [ - (python37.withPackages (p: - with python3Packages; - [ - beautifulsoup4 # How soups are beautiful again? - requests # The requests for your often-asked questions. - pip # Named after a certain mouse that lives in a barnyard and its ability to keep track of dependencies. - pytools # It's the little things that counts. - pytest # Try to make a good grade or else. - poetry # It rhymes... - scrapy # Create an extractor from a box of scraps. - setuptools # Setup your stuff. - ] + assertions = [{ + assertion = versionAtLeast cfg.pkg.version "3"; + message = "Python version should be only 3 and above."; + }]; + my.packages = with pkgs; [ + (cfg.pkg.withPackages (p: + with python3Packages; + [ + beautifulsoup4 # How soups are beautiful again? + requests # The requests for your often-asked questions. + pytools # It's the little things that counts. + pytest # Try to make a good grade or else. + poetry # It rhymes... + scrapy # Create an extractor from a box of scraps. + setuptools # Setup your stuff. + ] - ++ (if cfg.math.enable then [ - numpy # Numbers are also good, right? - sympy # When will you notice that math is good? - ] else - [ ]))) - ]; + ++ (if cfg.math.enable then [ + numpy # Numbers are also good, right? + sympy # When will you notice that math is good? + ] else + [ ]))) + python3Packages.pip # Named after a certain animal that lives in a barnyard. + ]; }; } diff --git a/modules/dev/web.nix b/modules/dev/web.nix new file mode 100755 index 00000000..9e02fbe7 --- /dev/null +++ b/modules/dev/web.nix @@ -0,0 +1,50 @@ +# Web development, the poster boy of hated programming subsets... +# I think it's pretty great, when it works. +# Otherwise, it is a disaster from the massive ecosystem among others. +# Since I use/experiment with the ecosystem so stuff like Node and Deno are combined into one module file. +{ config, options, lib, pkgs, ... }: + +with lib; +let cfg = config.modules.dev.web; +in { + options.modules.dev.web = let + mkBoolOption = bool: + mkOption { + type = types.bool; + default = bool; + }; + in { + enable = mkBoolOption false; + javascript = { + enable = mkBoolOption false; + deno.enable = mkBoolOption false; + node.enable = mkBoolOption false; + }; + php.enable = mkBoolOption false; + }; + + config = mkIf cfg.enable { + my.packages = with pkgs; + [ caddy ] ++ (if cfg.javascript.deno.enable then + [ + deno # The Deltarune of Node. + ] + else + [ ]) ++ + + (if cfg.javascript.node.enable then + [ + nodejs # The JavaScript framework/runtime where you don't have to kill someone for bad code. :) + ] + else + [ ]) ++ + + (if cfg.php.enable then [ + php # Behold, the most hated language (at least in my experience). + phpPackages.composer # Composes PHP projects prematurely. + phpPackages.phpcs # Quality control tool. + phpPackages.php-cs-fixer # Fixes your incorrectly formatted dirt. + ] else + [ ]); + }; +} diff --git a/modules/editors/emacs.nix b/modules/editors/emacs.nix index 0cb169a9..3ff63dc7 100755 --- a/modules/editors/emacs.nix +++ b/modules/editors/emacs.nix @@ -5,6 +5,7 @@ with lib; let + cfg = config.modules.editors.emacs; emacsOrgProtocolDesktopEntry = pkgs.makeDesktopItem { name = "org-protocol"; desktopName = "Org-Protocol"; @@ -27,10 +28,9 @@ in { }; }; - config = mkIf config.modules.editors.emacs.enable { + config = mkIf cfg.enable { my.packages = with pkgs; [ - ((emacsPackagesNgGen config.modules.editors.emacs.pkg).emacsWithPackages - (epkgs: [ epkgs.vterm ])) + ((emacsPackagesNgGen cfg.pkg).emacsWithPackages (epkgs: [ epkgs.vterm ])) emacsOrgProtocolDesktopEntry diff --git a/packages/default.nix b/packages/default.nix index e864927a..ef2234e1 100755 --- a/packages/default.nix +++ b/packages/default.nix @@ -1,11 +1,10 @@ [ (self: super: with super; { - # Add packages from the unstable channel with `pkgs.unstable.$PKG`. veikk-linux-driver = (callPackage ./veikk-driver.nix { kernel = pkgs.linux_5_8; }); nur.foo-dogsquared = import (fetchTarball - "https://github.com/foo-dogsquared/nur-packages/archive/develop.tar.gz") { + "https://github.com/foo-dogsquared/nur-packages/archive/master.tar.gz") { inherit pkgs; }; })