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

View file

@ -3,6 +3,5 @@
{
imports = [
./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;
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
{
imports = [
../boot
../i18n
../networking
../nix
../packages
../power-management
#../specialisation # dont actually use this
../users
];
# Installed packages (System wide)
environment = {
#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
imports = [
../../flakes/darwin/home-manager.nix
../../../../flakes/darwin/home-manager.nix
];
### 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
iterm2
### Misc
prismlauncher
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
netease-cloud-music-gtk
# game
steam
#lunar-client
bitwarden
#discord
#qq
@ -117,9 +113,7 @@
mousai
protonup-qt
piper
prismlauncher
telegram-desktop
osu-lazer-bin
qbittorrent
gradience
dippi
@ -283,11 +277,6 @@
terminal = "${pkgs.alacritty}/bin/alacritty";
};
mangohud = {
enable = true;
# TODO: add configuration, i have no idea how to display stuff with nix syntax
};
#boxxy = {
# enable = true;
# #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
imports = [
../../flakes/nixos/home-manager.nix
../../flakes/nixos/sops-nix.nix
../../flakes/nixos/hosts.nix
../../flakes/nixos/berberman.nix
../../../../flakes/nixos/home-manager.nix
../../../../flakes/nixos/sops-nix.nix
../../../../flakes/nixos/hosts.nix
../../../../flakes/nixos/berberman.nix
];
### home-manager
home-manager.users.guanranwang = import ./home-manager/nixos;
home-manager.users.guanranwang = import ../../home-manager/nixos/presets/desktop.nix;
### sops-nix
nix.extraOptions = "!include ${config.sops.secrets.nix-access-tokens.path}";
users.groups."nix-access-tokens" = {};
sops = {
defaultSopsFile = ./secrets/secrets.yaml;
defaultSopsFile = ../../secrets/secrets.yaml;
age.sshKeyPaths = [ "/nix/persist/system/etc/ssh/ssh_host_ed25519_key" ];
gnupg.sshKeyPaths = [];
secrets = {

View file

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