From 77e9e90c6de12ed7167bf3c6ffd079cd8af8b4e7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Krop=C3=A1=C4=8Dek?= Date: Thu, 19 Sep 2024 17:30:03 +0200 Subject: [PATCH] first version --- flake.nix | 1 + hosts/base/default.nix | 1 - hosts/work-ntb/default.nix | 8 ++++++- modules/dev/default.nix | 43 ------------------------------------ nixosModules/default.nix | 6 +++++ nixosModules/dev/default.nix | 29 ++++++++++++++++++++++++ nixosModules/dev/go.nix | 0 nixosModules/dev/ide.nix | 23 +++++++++++++++++++ nixosModules/dev/python.nix | 24 ++++++++++++++++++++ 9 files changed, 90 insertions(+), 45 deletions(-) delete mode 100644 modules/dev/default.nix create mode 100644 nixosModules/default.nix create mode 100644 nixosModules/dev/default.nix create mode 100644 nixosModules/dev/go.nix create mode 100644 nixosModules/dev/ide.nix create mode 100644 nixosModules/dev/python.nix diff --git a/flake.nix b/flake.nix index 2056ddd..bd33dcd 100644 --- a/flake.nix +++ b/flake.nix @@ -19,6 +19,7 @@ work-ntb = nixpkgs.lib.nixosSystem { system = "x86_64-linux"; modules = [ + ./nixosModules ./hosts/work-ntb inputs.nix-flatpak.nixosModules.nix-flatpak inputs.home-manager.nixosModules.home-manager diff --git a/hosts/base/default.nix b/hosts/base/default.nix index b909cf9..65a57f6 100644 --- a/hosts/base/default.nix +++ b/hosts/base/default.nix @@ -8,7 +8,6 @@ imports = [ # Include the results of the hardware scan. ../${hostname}/hardware-configuration.nix - ../../modules/dev ]; # Bootloader. diff --git a/hosts/work-ntb/default.nix b/hosts/work-ntb/default.nix index eb6b9eb..c57f037 100644 --- a/hosts/work-ntb/default.nix +++ b/hosts/work-ntb/default.nix @@ -4,7 +4,13 @@ ]; # My own modules configuration - krop.devtools.installIDE = true; + krop = { + ide = { + enable = true; + install-pycharm = true; + }; + python.install-older = true; + }; home-manager = { extraSpecialArgs = { inherit inputs; }; diff --git a/modules/dev/default.nix b/modules/dev/default.nix deleted file mode 100644 index e4f5078..0000000 --- a/modules/dev/default.nix +++ /dev/null @@ -1,43 +0,0 @@ -{ config, pkgs, lib, ... }@inputs: -let - cfg = config.krop.devtools; -in { - options.krop.devtools = { - installIDE = lib.mkOption { - type = lib.types.bool; - default = false; - example = true; - description = "Whether to install the ides"; - }; - installTools = lib.mkOption { - type = lib.types.bool; - default = true; - example = true; - description = "Whether to install the most used tools"; - }; - }; - config = let - ides = with pkgs; [ - jetbrains.pycharm-professional - zed-editor - vscodium - ]; - languages = with pkgs; [ - python3 - python311 - python310 - poetry - ]; - tools = with pkgs; [ - lazygit - lazydocker - micro-with-wl-clipboard - albert - openssl_3_3 - ]; - in { - environment.systemPackages = languages - ++ (lib.optionals cfg.installIDE ides) - ++ (lib.optionals cfg.installTools tools); - }; -} diff --git a/nixosModules/default.nix b/nixosModules/default.nix new file mode 100644 index 0000000..02090d4 --- /dev/null +++ b/nixosModules/default.nix @@ -0,0 +1,6 @@ +{...}: +{ + imports = [ + ./dev + ]; +} \ No newline at end of file diff --git a/nixosModules/dev/default.nix b/nixosModules/dev/default.nix new file mode 100644 index 0000000..cfa59e3 --- /dev/null +++ b/nixosModules/dev/default.nix @@ -0,0 +1,29 @@ +{ config, pkgs, lib, ... }@inputs: +let + cfg = config.krop.devtools; +in { + imports = [ + ./python.nix + ./ide.nix + ]; + options.krop.devtools = { + installTools = lib.mkOption { + type = lib.types.bool; + default = true; + example = true; + description = "Whether to install the most used tools"; + }; + }; + + config = let + tools = with pkgs; [ + lazygit + lazydocker + micro-with-wl-clipboard + albert + openssl_3_3 + ]; + in { + environment.systemPackages = tools; + }; +} diff --git a/nixosModules/dev/go.nix b/nixosModules/dev/go.nix new file mode 100644 index 0000000..e69de29 diff --git a/nixosModules/dev/ide.nix b/nixosModules/dev/ide.nix new file mode 100644 index 0000000..fc29d37 --- /dev/null +++ b/nixosModules/dev/ide.nix @@ -0,0 +1,23 @@ +{ config, pkgs, lib, ... }: +let + cfg = config.krop.ide; +in { + options.krop.ide = { + enable = lib.mkOption { + type = lib.types.bool; + default = lib.mkOptionDefault true; + example = true; + }; + install-pycharm = lib.mkOption { + type = lib.types.bool; + default = lib.mkOptionDefault false; + example = true; + }; + }; + config = lib.mkIf cfg.enable { + environment.systemPackages = with pkgs; [ + zed-editor + vscodium + ] ++ lib.optionals cfg.install-pycharm [pkgs.jetbrains.pycharm-professional]; + }; +} \ No newline at end of file diff --git a/nixosModules/dev/python.nix b/nixosModules/dev/python.nix new file mode 100644 index 0000000..50e188b --- /dev/null +++ b/nixosModules/dev/python.nix @@ -0,0 +1,24 @@ +{ config, pkgs, lib, ... }: +let + cfg = config.krop.python; +in { + options.krop.python = { + enable = lib.mkOption { + type = lib.types.bool; + default = lib.mkOptionDefault false; + example = true; + }; + install-older = lib.mkOption { + type = lib.types.bool; + default = lib.mkOptionDefault true; + example = true; + }; + }; + + config = lib.mkIf cfg.enable { + environment.systemPackages = with pkgs; [ + python3 + poetry + ] ++ lib.optionals cfg.install-older [python311 python310]; + }; +} \ No newline at end of file