瀏覽代碼

Refactoring

Johan Rong 2 月之前
父節點
當前提交
647511e8e7

+ 0 - 7
home/features/application/helix.nix

@@ -1,7 +0,0 @@
-{ pkgs, lib, ... }:
-{
-  programs.helix = {
-    enable = true;
-  };
-
-}

+ 0 - 31
home/flavors/application/development/default.nix

@@ -1,31 +0,0 @@
-{ pkgs, lib, ... }:
-{
-  imports = [
-
-  ];
-
-  home.packages = with pkgs; [
-    jetbrains.idea
-    jetbrains.rust-rover
-    jetbrains.rider
-    ninja
-    godot-mono
-    gdb
-    flatpak-xdg-utils
-    vscode
-    cargo
-    rustc
-    rustfmt
-    rustPlatform.rustLibSrc
-    rust-analyzer
-    lua51Packages.lua
-    google-cloud-sdk
-    dotnetCorePackages.sdk_9_0_1xx
-  ];
-
-  programs.direnv = {
-    enable = true;
-    enableBashIntegration = true; 
-    nix-direnv.enable = true; 
-  };
-}

+ 0 - 21
home/flavors/application/workstation/default.nix

@@ -1,21 +0,0 @@
-{ pkgs, lib, ... }:
-{
-  imports = [
-    ../../../features/application/helix.nix
-  ];
-
-  home.packages = with pkgs; [
-    spotify
-    feishin
-    kdePackages.kdenlive
-    kdePackages.ark
-    kdePackages.dolphin
-    obsidian
-    vlc
-    inkscape
-    f3d
-    chromium
-    mediawriter
-    tailscale
-  ];
-}

+ 16 - 8
hosts/dellaptop/configuration.nix

@@ -13,9 +13,10 @@ in
     ../../nixos/hardware/bluetooth
     ../../nixos/flavors/desktop/hyprland
     ../../nixos/flavors/desktop/hyprland/greeter-default.nix
-    ../../nixos/features/system/basic.nix
-    ../../nixos/features/system/users.nix
-    ../../nixos/features/system/gaming.nix
+    ../../nixos/flavors/application/workstation
+    ../../nixos/flavors/application/development
+    ../../nixos/flavors/application/gaming
+    ../../nixos/flavors/application/school
   ];
 
   boot.kernelParams = [
@@ -29,14 +30,21 @@ in
 
   networking.hostName = hosts.dellaptop.hostname;
 
-  hardware.nvidia.prime = {
-    offload = {
+  hardware.nvidia = {
+    powerManagement = {
       enable = true;
-      enableOffloadCmd = true;
+      finegrained = true;
     };
 
-    intelBusId = "PCI:0:2:0";
-    nvidiaBusId = "PCI:2:0:0";
+    prime = {
+      offload = {
+        enable = true;
+        enableOffloadCmd = true;
+      };
+
+      intelBusId = "PCI:0:2:0";
+      nvidiaBusId = "PCI:2:0:0";
+    };
   };
 
   boot.loader.systemd-boot.enable = true;

+ 0 - 2
hosts/dellaptop/home.nix

@@ -5,8 +5,6 @@ in
 {
   imports = [
     ../../home/flavors/desktop/hyprland
-    ../../home/flavors/application/workstation
-    ../../home/flavors/application/development
   ];
 
   news.display = "silent";

+ 4 - 2
hosts/nixstation/configuration.nix

@@ -13,9 +13,11 @@ in
     ../../nixos/hardware/bluetooth
     ../../nixos/flavors/desktop/hyprland
     ../../nixos/flavors/desktop/hyprland/greeter-default.nix
-    ../../nixos/features/system/basic.nix
+    ../../nixos/flavors/application/workstation
+    ../../nixos/flavors/application/development
+    ../../nixos/flavors/application/gaming
+    ../../nixos/flavors/application/school
     ../../nixos/features/system/users.nix
-    ../../nixos/features/system/gaming.nix
   ];
 
   nixpkgs.config.allowUnfree = true;

+ 0 - 2
hosts/nixstation/home.nix

@@ -5,8 +5,6 @@ in
 {
   imports = [
     ../../home/flavors/desktop/hyprland
-    ../../home/flavors/application/workstation
-    ../../home/flavors/application/development
   ];
 
   news.display = "silent";

+ 17 - 0
nixos/flavors/application/development/default.nix

@@ -0,0 +1,17 @@
+{ pkgs, lib, ... }:
+{
+  environment.systemPackages = with pkgs; [
+    jetbrains.idea
+    jetbrains.rust-rover
+    jetbrains.rider
+    vscode
+    gdb
+    onefetch
+  ];
+
+  programs.direnv = {
+    enable = true;
+    enableBashIntegration = true; 
+    nix-direnv.enable = true; 
+  };
+}

+ 0 - 0
nixos/features/system/gaming.nix → nixos/flavors/application/gaming/default.nix


+ 11 - 0
nixos/flavors/application/school/default.nix

@@ -0,0 +1,11 @@
+{ config, pkgs, inputs, ... }:
+
+{
+  environment.systemPackages = with pkgs; [];
+
+  services.flatpak = {
+    packages = [
+      "org.geogebra.GeoGebra"
+    ];
+  };
+}

+ 8 - 35
nixos/features/system/basic.nix → nixos/flavors/application/workstation/default.nix

@@ -1,10 +1,7 @@
 { config, pkgs, inputs, ... }:
 
 {
-  environment.systemPackages = let
-    #moose = inputs.moose.packages.${pkgs.system}.default;
-  in 
-  with pkgs; [
+  environment.systemPackages = with pkgs; [
     lf
     jq
     gh
@@ -15,12 +12,9 @@
     htop
     unzip
     seatd
-    libgcc
-    gnumake
     gparted
     dnsmasq
     pciutils
-    onefetch
     python315
     playerctl
     p7zip-rar
@@ -28,20 +22,21 @@
     pkg-config
     kdePackages.qt6ct
     lxqt.lxqt-policykit
-    neovim
-    emacs
     google-fonts
     ffmpeg_7-full
-    libGL
     discord
     proton-vpn
-    wireguard-tools
     cups-pk-helper
     dgop
     cava
     powertop
-
-    #moose
+    spotify
+    feishin
+    obsidian
+    inkscape
+    f3d
+    chromium
+    mediawriter
   ];
 
   services.flatpak = {
@@ -49,7 +44,6 @@
     packages = [
       "com.github.tchx84.Flatseal"
       "com.dec05eba.gpu_screen_recorder"
-      "org.geogebra.GeoGebra"
     ];
   };
 
@@ -74,12 +68,6 @@
     };
   };
 
-  #nix.gc = {
-  #  automatic = true;
-  #  dates = "weekly";
-  #  options = "--delete-older-than 7d";
-  #};
-
   environment.variables = {
     QT_QPA_PLATFORMTHEME = "qt6ct";
     EDITOR = "nvim";
@@ -140,21 +128,6 @@
     packages = with pkgs; [ cups-pk-helper ];
   };
 
-  #programs.appimage = {
-  #  enable = true;
-  #  binfmt = true;
-  #  package = pkgs.appimage-run.override {
-  #    extraPkgs = pkgs: 
-  #    [
-  #      pkgs.icu
-  #      pkgs.libxcrypt-legacy
-  #      pkgs.python312
-  #      pkgs.python312Packages.torch
-  #      pkgs.zstd
-  #    ]; 
-  #  };
-  #};
-
   programs.nh = {
     enable = true;
     clean.enable = true;

+ 6 - 5
nixos/flavors/desktop/hyprland/default.nix

@@ -7,15 +7,16 @@
   environment.systemPackages = with pkgs; [
     cliphist
     wl-clipboard
-    mission-center
     hyprpicker
-    nomacs
-    gammastep
-    geoclue2
     wtype
-    matugen
+
+    mission-center
+    nomacs
     alacritty
+    vlc
 
+    kdePackages.kdenlive
+    kdePackages.ark
     kdePackages.dolphin
     kdePackages.qtsvg 
     kdePackages.kio

+ 0 - 5
nixos/hardware/gpu/nvidia.nix

@@ -14,11 +14,6 @@
   hardware.nvidia = {
     open = false;
 
-    powerManagement = {
-      enable = true;
-      finegrained = true;
-    };
-
     modesetting = {
       enable = true;
     };