nixos: add presets

This commit is contained in:
Guanran Wang 2023-10-16 16:26:06 +08:00
parent 07bff0bc66
commit 8ff2fc46aa
Signed by: nyancat
SSH key fingerprint: SHA256:8oWGKciPALWut/6WA27oFKofX+6Wtc0gQnsefXLQx/8
18 changed files with 112 additions and 76 deletions

View file

@ -86,11 +86,10 @@
system = "x86_64-linux"; system = "x86_64-linux";
specialArgs = { inherit inputs; }; specialArgs = { inherit inputs; };
modules = [ modules = [
./nixos # Entrypoint ./nixos/presets/gaming.nix # OS-specific (with presets)
./machines/nixos/81fw-lenovo-legion-y7000 # Hardware-specific configurations ./users/guanranwang/nixos/presets/gaming.nix # User-specific (with presets)
./machines/nixos/81fw-lenovo-legion-y7000/machine-1 # Machine-specific configurations ./machines/nixos/81fw-lenovo-legion-y7000 # Hardware-specific
./machines/nixos/81fw-lenovo-legion-y7000/machine-1 # Machine-specific
./users/guanranwang/nixos.nix # Home Manager entrypoint (user-specific)
{ networking.hostName = "81FW-NixOS"; } # Hostname { networking.hostName = "81FW-NixOS"; } # Hostname
]; ];
@ -101,12 +100,11 @@
system = "x86_64-linux"; system = "x86_64-linux";
specialArgs = { inherit inputs; }; specialArgs = { inherit inputs; };
modules = [ modules = [
./nixos ./nixos/presets/desktop.nix
./users/guanranwang/nixos/presets/desktop.nix
./machines/nixos/imac-2017 ./machines/nixos/imac-2017
./machines/nixos/imac-2017/machine-1 ./machines/nixos/imac-2017/machine-1
./users/guanranwang/nixos.nix
{ networking.hostName = "iMac-NixOS"; } { networking.hostName = "iMac-NixOS"; }
]; ];
}; };
@ -120,10 +118,9 @@
specialArgs = { inherit inputs; }; specialArgs = { inherit inputs; };
modules = [ modules = [
./darwin ./darwin
./users/guanranwang/darwin/presets/desktop.nix
./machines/darwin/imac-2017 ./machines/darwin/imac-2017
./users/guanranwang/darwin.nix
{ networking.hostName = "iMac-macOS"; } { networking.hostName = "iMac-macOS"; }
]; ];
}; };

View file

@ -3,6 +3,5 @@
{ {
imports = [ imports = [
./hardware.nix ./hardware.nix
../../../nixos/presets/desktop.nix
]; ];
} }

View file

@ -1,14 +0,0 @@
{ ... }:
{
imports = [
./boot
./i18n
./networking
./nix
./packages
./power-management
#./specialisation # dont actually use this
./users
];
}

View file

@ -16,12 +16,5 @@
enable = true; enable = true;
package = pkgs.gnomeExtensions.gsconnect; package = pkgs.gnomeExtensions.gsconnect;
}; };
gamemode = {
enable = true;
settings.custom = {
start = "${pkgs.libnotify}/bin/notify-send 'GameMode Activated' 'GameMode Activated! Enjoy enhanced performance. 🚀'";
end = "${pkgs.libnotify}/bin/notify-send 'GameMode Deactivated' 'GameMode Deactivated. Back to normal mode. '";
};
};
}; };
} }

View file

@ -2,6 +2,17 @@
# Imported by default, check out ./desktop.nix or ./server.nix # Imported by default, check out ./desktop.nix or ./server.nix
{ {
imports = [
../boot
../i18n
../networking
../nix
../packages
../power-management
#../specialisation # dont actually use this
../users
];
# Installed packages (System wide) # Installed packages (System wide)
environment = { environment = {
#defaultPackages = []; #defaultPackages = [];

14
nixos/presets/gaming.nix Normal file
View file

@ -0,0 +1,14 @@
{ pkgs, ... }:
{
imports = [
./desktop.nix
];
programs.gamemode = {
enable = true;
settings.custom = {
start = "${pkgs.libnotify}/bin/notify-send 'GameMode Activated' 'GameMode Activated! Enjoy enhanced performance. 🚀'";
end = "${pkgs.libnotify}/bin/notify-send 'GameMode Deactivated' 'GameMode Deactivated. Back to normal mode. '";
};
};
}

View file

@ -14,8 +14,8 @@
# Flakes # Flakes
imports = [ imports = [
../../flakes/darwin/home-manager.nix ../../../../flakes/darwin/home-manager.nix
]; ];
### home-manager ### home-manager
home-manager.users.guanranwang = import ./home-manager/darwin; # NOTE: using flakes home-manager.users.guanranwang = import ../../home-manager/darwin/presets/desktop.nix; # NOTE: using flakes
} }

View file

@ -0,0 +1,9 @@
{ ... }:
{
imports = [
./desktop.nix
];
### home-manager
home-manager.users.guanranwang = import ../../home-manager/darwin/presets/gaming.nix; # NOTE: using flakes
}

View file

@ -1,9 +0,0 @@
{ ... }:
{
imports = [
../common/home.nix
./home.nix
./dotfiles.nix
];
}

View file

@ -66,7 +66,6 @@
keka # un-archive-r keka # un-archive-r
iterm2 iterm2
### Misc ### Misc
prismlauncher
element-desktop element-desktop

View file

@ -0,0 +1,9 @@
{ ... }:
{
imports = [
../../common/home.nix
../home.nix
../dotfiles.nix
];
}

View file

@ -0,0 +1,11 @@
{ pkgs, ... }:
{
imports = [
./desktop.nix
];
home.packages = with pkgs; [
prismlauncher
];
}

View file

@ -1,15 +0,0 @@
{ ... }:
{
imports = [
../common/home.nix
./home.nix
./dotfiles.nix
./i18n.nix
./sway.nix
./waybar.nix
./xdg
];
}

View file

@ -106,10 +106,6 @@
amberol amberol
netease-cloud-music-gtk netease-cloud-music-gtk
# game
steam
#lunar-client
bitwarden bitwarden
#discord #discord
#qq #qq
@ -117,9 +113,7 @@
mousai mousai
protonup-qt protonup-qt
piper piper
prismlauncher
telegram-desktop telegram-desktop
osu-lazer-bin
qbittorrent qbittorrent
gradience gradience
dippi dippi
@ -283,11 +277,6 @@
terminal = "${pkgs.alacritty}/bin/alacritty"; terminal = "${pkgs.alacritty}/bin/alacritty";
}; };
mangohud = {
enable = true;
# TODO: add configuration, i have no idea how to display stuff with nix syntax
};
#boxxy = { #boxxy = {
# enable = true; # enable = true;
# #rules = { # #rules = {

View file

@ -0,0 +1,15 @@
{ ... }:
{
imports = [
../../common/home.nix
../home.nix
../dotfiles.nix
../i18n.nix
../sway.nix
../waybar.nix
../xdg
];
}

View file

@ -0,0 +1,19 @@
{ pkgs, ... }:
{
imports = [
./desktop.nix
];
home.packages = with pkgs; [
steam
#lunar-client
prismlauncher
osu-lazer-bin
];
programs.mangohud = {
enable = true;
# TODO: add configuration, i have no idea how to display stuff with nix syntax
};
}

View file

@ -14,18 +14,18 @@
# Flakes # Flakes
imports = [ imports = [
../../flakes/nixos/home-manager.nix ../../../../flakes/nixos/home-manager.nix
../../flakes/nixos/sops-nix.nix ../../../../flakes/nixos/sops-nix.nix
../../flakes/nixos/hosts.nix ../../../../flakes/nixos/hosts.nix
../../flakes/nixos/berberman.nix ../../../../flakes/nixos/berberman.nix
]; ];
### home-manager ### home-manager
home-manager.users.guanranwang = import ./home-manager/nixos; home-manager.users.guanranwang = import ../../home-manager/nixos/presets/desktop.nix;
### sops-nix ### sops-nix
nix.extraOptions = "!include ${config.sops.secrets.nix-access-tokens.path}"; nix.extraOptions = "!include ${config.sops.secrets.nix-access-tokens.path}";
users.groups."nix-access-tokens" = {}; users.groups."nix-access-tokens" = {};
sops = { sops = {
defaultSopsFile = ./secrets/secrets.yaml; defaultSopsFile = ../../secrets/secrets.yaml;
age.sshKeyPaths = [ "/nix/persist/system/etc/ssh/ssh_host_ed25519_key" ]; age.sshKeyPaths = [ "/nix/persist/system/etc/ssh/ssh_host_ed25519_key" ];
gnupg.sshKeyPaths = []; gnupg.sshKeyPaths = [];
secrets = { secrets = {

View file

@ -0,0 +1,9 @@
{ ... }:
{
imports = [
./desktop.nix
];
home-manager.users.guanranwang = import ../../home-manager/nixos/presets/gaming.nix;
}