From b7de76fe52f4c3dd0477607a07180f08d5a2116b Mon Sep 17 00:00:00 2001 From: Maciej Jur Date: Sat, 27 Jul 2024 16:13:48 +0200 Subject: [PATCH] refactor --- nixos/msi/home.nix | 9 ++------- nixos/msi/modules/js.nix | 11 +++++++++++ nixos/msi/modules/xdg.nix | 12 ++++++++++++ 3 files changed, 25 insertions(+), 7 deletions(-) create mode 100644 nixos/msi/modules/js.nix create mode 100644 nixos/msi/modules/xdg.nix diff --git a/nixos/msi/home.nix b/nixos/msi/home.nix index 9fccb6f..1ec691c 100644 --- a/nixos/msi/home.nix +++ b/nixos/msi/home.nix @@ -2,10 +2,12 @@ { imports = [ + ./modules/xdg.nix ./modules/gaming.nix ./modules/ghci ./modules/lean.nix ./modules/ocaml.nix + ./modules/js.nix ]; home = { @@ -29,13 +31,6 @@ ]; }; - xdg.mimeApps.defaultApplications = { - "text/html" = ["firefox-devedition.desktop"]; - "text/xml" = ["firefox-devedition.desktop"]; - "x-scheme-handler/http" = ["firefox-devedition.desktop"]; - "x-scheme-handler/https" = ["firefox-devedition.desktop"]; - }; - programs = { # default shell fish = { diff --git a/nixos/msi/modules/js.nix b/nixos/msi/modules/js.nix new file mode 100644 index 0000000..afe118e --- /dev/null +++ b/nixos/msi/modules/js.nix @@ -0,0 +1,11 @@ +{ pkgs, config, ... }: + +{ + home.sessionVariables = { + npm_config_prefix = "${config.xdg.cacheHome}/npm"; + }; + + home.packages = with pkgs; [ + nodejs + ]; +} diff --git a/nixos/msi/modules/xdg.nix b/nixos/msi/modules/xdg.nix new file mode 100644 index 0000000..454d968 --- /dev/null +++ b/nixos/msi/modules/xdg.nix @@ -0,0 +1,12 @@ +{ ... }: +let + firefox = "firefox-devedition.desktop"; +in +{ + xdg.mimeApps.defaultApplications = { + "text/html" = [firefox]; + "text/xml" = [firefox]; + "x-scheme-handler/http" = [firefox]; + "x-scheme-handler/https" = [firefox]; + }; +}