This commit is contained in:
Sense T 2023-07-04 16:53:01 +08:00
parent e9c51a6869
commit 23172262c8
17 changed files with 759 additions and 759 deletions

View File

@ -1,12 +1,12 @@
# NixOS configurations file. # NixOS configurations file.
{config, pkgs, lib,...}: { { config, pkgs, lib, ... }: {
system.stateVersion = "23.05"; system.stateVersion = "23.05";
imports = [ imports = [
# Include the results of the hardware scan. # Include the results of the hardware scan.
./hardware-configuration.nix ./hardware-configuration.nix
# User custom configurations. # User custom configurations.
./global ./global
]; ];
system.autoUpgrade = { system.autoUpgrade = {

View File

@ -74,11 +74,11 @@
}, },
"nixpkgs": { "nixpkgs": {
"locked": { "locked": {
"lastModified": 1687829761, "lastModified": 1688389917,
"narHash": "sha256-QRe1Y8SS3M4GeC58F/6ajz6V0ZLUVWX3ZAMgov2N3/g=", "narHash": "sha256-RKiK1QeommEsjQ8fLgxt4831x9O6n2gD7wAhVZTrr8M=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "9790f3242da2152d5aa1976e3e4b8b414f4dd206", "rev": "aed4b19d312525ae7ca9bceb4e1efe3357d0e2eb",
"type": "github" "type": "github"
}, },
"original": { "original": {

133
flake.nix
View File

@ -1,77 +1,78 @@
{ {
description = "NixOS configuration for GPD Win Max"; description = "NixOS configuration for GPD Win Max";
nixConfig = rec { nixConfig = rec {
auto-optimise-store = true; auto-optimise-store = true;
experimental-features = [ "nix-command" "flakes" ]; experimental-features = [ "nix-command" "flakes" ];
trusted-substituters = [ trusted-substituters = [
"https://mirrors.ustc.edu.cn/nix-channels/store" # 中科大 "https://mirrors.ustc.edu.cn/nix-channels/store" # 中科大
"https://mirrors.tuna.tsinghua.edu.cn/nix-channels/store" # 清华 "https://mirrors.tuna.tsinghua.edu.cn/nix-channels/store" # 清华
"https://mirrors.bfsu.edu.cn/nix-channels/store" # 北外 "https://mirrors.bfsu.edu.cn/nix-channels/store" # 北外
"https://mirror.sjtu.edu.cn/nix-channels/store" # 交大 "https://mirror.sjtu.edu.cn/nix-channels/store" # 交大
"https://nixos-cn.cachix.org" "https://nixos-cn.cachix.org"
"https://cache.nixos.org/" "https://cache.nixos.org/"
]; ];
substituters = trusted-substituters; substituters = trusted-substituters;
trusted-users = [ trusted-users = [
"user" "user"
"root" "root"
"@wheel" "@wheel"
]; ];
};
inputs = {
nixpkgs.url = "nixpkgs/nixos-23.05";
impermanence.url = "github:nix-community/impermanence";
home-manager = {
url = "github:nix-community/home-manager/release-23.05";
inputs.nixpkgs.follows = "nixpkgs";
}; };
inputs = { nixos-cn = {
nixpkgs.url = "nixpkgs/nixos-23.05"; url = "github:nixos-cn/flakes";
impermanence.url = "github:nix-community/impermanence"; inputs.nixpkgs.follows = "nixpkgs";
home-manager = {
url = "github:nix-community/home-manager/release-23.05";
inputs.nixpkgs.follows = "nixpkgs";
};
nixos-cn = {
url = "github:nixos-cn/flakes";
inputs.nixpkgs.follows = "nixpkgs";
};
}; };
};
outputs = {self, nixpkgs, home-manager, nixos-cn, impermanence, ...}: { outputs = { self, nixpkgs, home-manager, nixos-cn, impermanence, ... }: {
nixosConfigurations.gpd = nixpkgs.lib.nixosSystem rec { nixosConfigurations.gpd = nixpkgs.lib.nixosSystem rec {
system = "x86_64-linux"; system = "x86_64-linux";
specialArgs = { specialArgs = {
pkgs = import nixpkgs { pkgs = import nixpkgs {
system = system; system = system;
config.allowUnfree = true; config.allowUnfree = true;
overlays = [ overlays = [
(self: super: { (self: super: {
waybar = super.waybar.overrideAttrs (oldAttrs: { waybar = super.waybar.overrideAttrs (oldAttrs: {
# enable hyprland support # enable hyprland support
mesonFlags = oldAttrs.mesonFlags ++ [ "-Dexperimental=true" ]; mesonFlags = oldAttrs.mesonFlags ++ [ "-Dexperimental=true" ];
}); });
}) })
]; ];
};
cn-pkgs = import nixos-cn {
system = system;
config.allowUnfree = true;
};
};
modules = [
./configuration.nix
impermanence.nixosModules.impermanence
nixos-cn.nixosModules.nixos-cn-registries
nixos-cn.nixosModules.nixos-cn
home-manager.nixosModules.home-manager {
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
home-manager.users = import ./home;
}
];
}; };
cn-pkgs = import nixos-cn {
system = system;
config.allowUnfree = true;
};
};
modules = [
./configuration.nix
impermanence.nixosModules.impermanence
nixos-cn.nixosModules.nixos-cn-registries
nixos-cn.nixosModules.nixos-cn
home-manager.nixosModules.home-manager
{
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
home-manager.users = import ./home;
}
];
}; };
};
} }

View File

@ -1,9 +1,9 @@
{ {
imports = [ imports = [
./system-configuration.nix ./system-configuration.nix
./software-configuration.nix ./software-configuration.nix
./user-configuration.nix ./user-configuration.nix
./font-configuration.nix ./font-configuration.nix
./stateless-configuration.nix ./stateless-configuration.nix
]; ];
} }

View File

@ -1,39 +1,39 @@
{pkgs, ...}: { { pkgs, ... }: {
fonts= { fonts = {
fontDir.enable = true; fontDir.enable = true;
fonts = with pkgs;[ fonts = with pkgs;[
noto-fonts noto-fonts
noto-fonts-cjk noto-fonts-cjk
noto-fonts-emoji noto-fonts-emoji
liberation_ttf liberation_ttf
fira-code fira-code
fira-code-symbols fira-code-symbols
source-han-sans source-han-sans
source-han-serif source-han-serif
source-han-mono source-han-mono
source-code-pro source-code-pro
font-awesome_5 font-awesome_5
powerline-fonts powerline-fonts
powerline-symbols powerline-symbols
(nerdfonts.override { fonts = [ "FiraCode" "DroidSansMono" ]; }) (nerdfonts.override { fonts = [ "FiraCode" "DroidSansMono" ]; })
]; ];
fontconfig.cache32Bit = true; fontconfig.cache32Bit = true;
fontconfig.defaultFonts = { fontconfig.defaultFonts = {
serif = [ serif = [
"Source Han Serif SC" "Source Han Serif SC"
]; ];
sansSerif = [ sansSerif = [
"Source Han Sans SC" "Source Han Sans SC"
]; ];
monospace = [ monospace = [
"Fira Code" "Fira Code"
"Source Han Mono SC" "Source Han Mono SC"
]; ];
};
}; };
};
} }

View File

@ -1,116 +1,116 @@
{pkgs, ...}: { { pkgs, ... }: {
xdg.portal = { xdg.portal = {
enable = true; enable = true;
#wlr.enable = true; #wlr.enable = true;
xdgOpenUsePortal = true; xdgOpenUsePortal = true;
extraPortals = with pkgs; [ extraPortals = with pkgs; [
xdg-desktop-portal-hyprland xdg-desktop-portal-hyprland
xdg-desktop-portal-gtk xdg-desktop-portal-gtk
];
};
# Enable automatic login for the user.
services = {
# flatpak dev.deedles.Trayscale
# sudo tailscale up --operator=$USER
# use https://hs.wetofu.me
tailscale.enable = true;
blueman.enable = true;
logrotate.checkConfig = false;
flatpak.enable = true;
ntp = {
enable = true;
servers = [
"ntp.ntsc.ac.cn" # China
];
};
greetd = {
enable = true;
settings = rec {
initial_session = {
user = "user";
command = "${pkgs.greetd.greetd}/bin/agreety --cmd Hyprland";
};
default_session = initial_session;
};
};
xserver = {
layout = "cn";
xkbVariant = "";
libinput = {
mouse = {
accelProfile = "flat";
};
};
};
pipewire = {
enable = true;
alsa.enable = true;
pulse.enable = true;
};
};
# List packages installed in system profile. To search, run:
# $ nix search wget
environment.systemPackages = with pkgs; [
hyprpaper
hyprland-protocols
hyprland-share-picker
]; ];
};
programs = { # Enable automatic login for the user.
hyprland = { services = {
enable = true; # flatpak dev.deedles.Trayscale
xwayland = { # sudo tailscale up --operator=$USER
enable = true; # use https://hs.wetofu.me
hidpi = true; tailscale.enable = true;
}; blueman.enable = true;
}; logrotate.checkConfig = false;
flatpak.enable = true;
proxychains = { ntp = {
enable = true; enable = true;
quietMode = true; servers = [
proxies = { "ntp.ntsc.ac.cn" # China
default = { ];
type = "socks5";
port = 1089;
host = "127.0.0.1";
enable = true;
};
};
};
git.enable = true;
zsh.enable = true;
light.enable = true;
dconf.enable = true;
}; };
virtualisation = { greetd = {
podman.enable = true; enable = true;
oci-containers.backend = "podman"; settings = rec {
oci-containers.containers = { initial_session = {
wsproxy = { user = "user";
login.username = "senseab"; command = "${pkgs.greetd.greetd}/bin/agreety --cmd Hyprland";
login.registry = "ghcr.io";
login.passwordFile = "/var/lib/secrets/podman/ghcr.io"; # should create it manually.
image = "ghcr.io/senseab/wsproxy:master";
autoStart = true;
environment = {
CONFIG_NO_TLS_VERIFY = "true";
CONFIG_ADDR = "wss://dev.wetofu.me/path";
WSPROXY_MODE = "client";
};
ports = [
"127.0.0.1:1089:1089"
];
};
}; };
default_session = initial_session;
};
}; };
xserver = {
layout = "cn";
xkbVariant = "";
libinput = {
mouse = {
accelProfile = "flat";
};
};
};
pipewire = {
enable = true;
alsa.enable = true;
pulse.enable = true;
};
};
# List packages installed in system profile. To search, run:
# $ nix search wget
environment.systemPackages = with pkgs; [
hyprpaper
hyprland-protocols
hyprland-share-picker
];
programs = {
hyprland = {
enable = true;
xwayland = {
enable = true;
hidpi = true;
};
};
proxychains = {
enable = true;
quietMode = true;
proxies = {
default = {
type = "socks5";
port = 1089;
host = "127.0.0.1";
enable = true;
};
};
};
git.enable = true;
zsh.enable = true;
light.enable = true;
dconf.enable = true;
};
virtualisation = {
podman.enable = true;
oci-containers.backend = "podman";
oci-containers.containers = {
wsproxy = {
login.username = "senseab";
login.registry = "ghcr.io";
login.passwordFile = "/var/lib/secrets/podman/ghcr.io"; # should create it manually.
image = "ghcr.io/senseab/wsproxy:master";
autoStart = true;
environment = {
CONFIG_NO_TLS_VERIFY = "true";
CONFIG_ADDR = "wss://dev.wetofu.me/path";
WSPROXY_MODE = "client";
};
ports = [
"127.0.0.1:1089:1089"
];
};
};
};
} }

View File

@ -1,38 +1,38 @@
{ {
# /nix/persistent 是你实际保存文件的地方 # /nix/persistent 是你实际保存文件的地方
environment.persistence."/nix/persistent" = { environment.persistence."/nix/persistent" = {
# 不让这些映射的 mount 出现在文件管理器的侧边栏中 # 不让这些映射的 mount 出现在文件管理器的侧边栏中
hideMounts = true; hideMounts = true;
# 你要映射的文件夹 # 你要映射的文件夹
directories = [ directories = [
"/etc/NetworkManager/system-connections" "/etc/NetworkManager/system-connections"
"/root" "/root"
"/var" "/var"
]; ];
files = [ files = [
"/etc/machine-id" "/etc/machine-id"
]; ];
};
environment.variables.NIX_REMOTE = "daemon";
systemd.services.nix-daemon = {
environment = {
# 指定临时文件的位置
TMPDIR = "/var/cache/nix";
}; };
serviceConfig = {
environment.variables.NIX_REMOTE = "daemon"; # 在 Nix Daemon 启动时自动创建 /var/cache/nix
CacheDirectory = "nix";
systemd.services.nix-daemon = {
environment = {
# 指定临时文件的位置
TMPDIR = "/var/cache/nix";
};
serviceConfig = {
# 在 Nix Daemon 启动时自动创建 /var/cache/nix
CacheDirectory = "nix";
};
}; };
};
# Stateless rootfs # Stateless rootfs
fileSystems."/" = { fileSystems."/" = {
device = "tmpfs"; device = "tmpfs";
fsType = "tmpfs"; fsType = "tmpfs";
options = [ "relatime" "mode=755" "nosuid" "nodev" ]; options = [ "relatime" "mode=755" "nosuid" "nodev" ];
}; };
} }

View File

@ -1,54 +1,54 @@
{ {
sound.enable = true; sound.enable = true;
networking.networkmanager.enable = true; networking.networkmanager.enable = true;
time.timeZone = "Asia/Shanghai"; time.timeZone = "Asia/Shanghai";
security.sudo.wheelNeedsPassword = false; security.sudo.wheelNeedsPassword = false;
hardware = { hardware = {
opengl.enable = true; opengl.enable = true;
};
# Select internationalisation properties.
i18n = {
defaultLocale = "zh_CN.UTF-8";
extraLocaleSettings = {
LC_ADDRESS = "zh_CN.UTF-8";
LC_IDENTIFICATION = "zh_CN.UTF-8";
LC_MEASUREMENT = "zh_CN.UTF-8";
LC_MONETARY = "zh_CN.UTF-8";
LC_NAME = "zh_CN.UTF-8";
LC_NUMERIC = "zh_CN.UTF-8";
LC_PAPER = "zh_CN.UTF-8";
LC_TELEPHONE = "zh_CN.UTF-8";
LC_TIME = "zh_CN.UTF-8";
}; };
};
# Select internationalisation properties. nix.settings = {
i18n = { auto-optimise-store = true;
defaultLocale = "zh_CN.UTF-8"; experimental-features = [
extraLocaleSettings = { "nix-command"
LC_ADDRESS = "zh_CN.UTF-8"; "flakes"
LC_IDENTIFICATION = "zh_CN.UTF-8"; ];
LC_MEASUREMENT = "zh_CN.UTF-8";
LC_MONETARY = "zh_CN.UTF-8";
LC_NAME = "zh_CN.UTF-8";
LC_NUMERIC = "zh_CN.UTF-8";
LC_PAPER = "zh_CN.UTF-8";
LC_TELEPHONE = "zh_CN.UTF-8";
LC_TIME = "zh_CN.UTF-8";
};
};
nix.settings = { substituters = [
auto-optimise-store = true; "https://mirrors.ustc.edu.cn/nix-channels/store" # 中科大
experimental-features = [ "https://mirrors.tuna.tsinghua.edu.cn/nix-channels/store" # 清华
"nix-command" "https://mirrors.bfsu.edu.cn/nix-channels/store" # 北外
"flakes" "https://mirror.sjtu.edu.cn/nix-channels/store" # 交大
]; "https://nixos-cn.cachix.org"
"https://cache.nixos.org/"
];
substituters = [ trusted-users = [
"https://mirrors.ustc.edu.cn/nix-channels/store" # 中科大 "root"
"https://mirrors.tuna.tsinghua.edu.cn/nix-channels/store" # 清华 "@wheel"
"https://mirrors.bfsu.edu.cn/nix-channels/store" # 北外 ];
"https://mirror.sjtu.edu.cn/nix-channels/store" # 交大 };
"https://nixos-cn.cachix.org"
"https://cache.nixos.org/"
];
trusted-users = [ nix.gc = {
"root" automatic = true;
"@wheel" dates = "weekly";
]; options = "--delete-older-than 1w";
}; };
nix.gc = {
automatic = true;
dates = "weekly";
options = "--delete-older-than 1w";
};
} }

View File

@ -1,20 +1,20 @@
{pkgs, ...}: { { pkgs, ... }: {
users= { users = {
mutableUsers = false; mutableUsers = false;
users = { users = {
user = { user = {
isNormalUser = true; isNormalUser = true;
description = "Default user"; description = "Default user";
extraGroups = [ extraGroups = [
"networkmanager" "networkmanager"
"wheel" "wheel"
"input" "input"
"video" "video"
"kvm" "kvm"
]; ];
hashedPassword = ""; # Login directly hashedPassword = ""; # Login directly
shell = pkgs.zsh; shell = pkgs.zsh;
}; };
};
}; };
};
} }

View File

@ -4,83 +4,83 @@
{ config, lib, pkgs, modulesPath, ... }: { config, lib, pkgs, modulesPath, ... }:
{ {
imports =[ imports = [
(modulesPath + "/installer/scan/not-detected.nix") (modulesPath + "/installer/scan/not-detected.nix")
]; ];
boot = { boot = {
plymouth.enable = true; plymouth.enable = true;
# Use xanmod kernel # Use xanmod kernel
kernelPackages = pkgs.linuxPackages_xanmod_latest; kernelPackages = pkgs.linuxPackages_xanmod_latest;
kernelParams = [ "quiet" ]; kernelParams = [ "quiet" ];
kernelModules = [ "kvm-intel" ]; kernelModules = [ "kvm-intel" ];
consoleLogLevel = 0; consoleLogLevel = 0;
kernel.sysctl = { kernel.sysctl = {
# for ryujinx # for ryujinx
"vm.max_map_count" = 524288; "vm.max_map_count" = 524288;
};
initrd = {
#verbose = false;
availableKernelModules = [
"xhci_pci"
"ahci"
"nvme"
"usb_storage"
"usbhid"
"sd_mod"
];
};
loader = {
efi.canTouchEfiVariables = true;
grub = {
configurationLimit = 10;
efiSupport = true;
device = "nodev";
mirroredBoots = [
{
devices = [ "nodev" ];
path = "/boot";
}
];
};
};
}; };
fileSystems."/boot" = { initrd = {
device = "/dev/disk/by-uuid/8095-BE1B"; #verbose = false;
fsType = "vfat"; availableKernelModules = [
"xhci_pci"
"ahci"
"nvme"
"usb_storage"
"usbhid"
"sd_mod"
];
}; };
fileSystems."/nix" = { loader = {
device = "/dev/disk/by-uuid/d2fac87e-ce48-174a-a544-36606fd39ee0"; efi.canTouchEfiVariables = true;
fsType = "ext4";
grub = {
configurationLimit = 10;
efiSupport = true;
device = "nodev";
mirroredBoots = [
{
devices = [ "nodev" ];
path = "/boot";
}
];
};
}; };
};
fileSystems."/home" = { fileSystems."/boot" = {
device = "/dev/disk/by-uuid/4125f3b3-7613-a04b-910c-87169a7a87b3"; device = "/dev/disk/by-uuid/8095-BE1B";
fsType = "ext4"; fsType = "vfat";
}; };
swapDevices = [ fileSystems."/nix" = {
{ device = "/dev/nvme0n1p2"; } device = "/dev/disk/by-uuid/d2fac87e-ce48-174a-a544-36606fd39ee0";
]; fsType = "ext4";
};
# Enables DHCP on each ethernet and wireless interface. In case of scripted networking fileSystems."/home" = {
# (the default) this is the recommended approach. When using systemd-networkd it's device = "/dev/disk/by-uuid/4125f3b3-7613-a04b-910c-87169a7a87b3";
# still possible to use this option, but it's recommended to use it in conjunction fsType = "ext4";
# with explicit per-interface declarations with `networking.interfaces.<interface>.useDHCP`. };
networking.useDHCP = lib.mkDefault true;
# networking.interfaces.eth0.useDHCP = lib.mkDefault true;
# networking.interfaces.wlan0.useDHCP = lib.mkDefault true;
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; swapDevices = [
powerManagement.cpuFreqGovernor = lib.mkDefault "ondemand"; { device = "/dev/nvme0n1p2"; }
hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; ];
hardware.bluetooth.enable = true;
# Enables DHCP on each ethernet and wireless interface. In case of scripted networking
# (the default) this is the recommended approach. When using systemd-networkd it's
# still possible to use this option, but it's recommended to use it in conjunction
# with explicit per-interface declarations with `networking.interfaces.<interface>.useDHCP`.
networking.useDHCP = lib.mkDefault true;
# networking.interfaces.eth0.useDHCP = lib.mkDefault true;
# networking.interfaces.wlan0.useDHCP = lib.mkDefault true;
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
powerManagement.cpuFreqGovernor = lib.mkDefault "ondemand";
hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
hardware.bluetooth.enable = true;
} }

View File

@ -1,3 +1,3 @@
{ {
user = import ./user; user = import ./user;
} }

View File

@ -1,122 +1,122 @@
{ {
layer = "top"; layer = "top";
position = "top"; position = "top";
height = 24; height = 24;
modules-left = [ modules-left = [
"hyprland/window" "hyprland/window"
]; ];
modules-center = [ "wlr/workspaces" ]; modules-center = [ "wlr/workspaces" ];
modules-right = [ modules-right = [
"backlight" "backlight"
"wireplumber" "wireplumber"
# "cpu" # "cpu"
# "memory" # "memory"
"battery" "battery"
"network" "network"
"tray" "tray"
"clock" "clock"
]; ];
wireplumber = { wireplumber = {
tooltip = false; tooltip = false;
scroll-step = 5; scroll-step = 5;
format = "{icon} {volume}%"; format = "{icon} {volume}%";
format-muted = "{icon} --"; format-muted = "{icon} --";
on-click ="wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle"; # wpctl? on-click = "wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle"; # wpctl?
format-icons = { format-icons = {
default = ["" "" ""]; default = [ "" "" "" ];
};
}; };
};
"hyprland/window" = { "hyprland/window" = {
format = "{}"; format = "{}";
separate-outputs = true; separate-outputs = true;
}; };
"wlr/workspaces" = { "wlr/workspaces" = {
format = "{icon}"; format = "{icon}";
on-click = "activate"; on-click = "activate";
format-icons = { format-icons = {
"1" = ""; "1" = "";
"2" = ""; "2" = "";
"3" = ""; "3" = "";
"4" = ""; "4" = "";
"5" = ""; "5" = "";
urgent = ""; urgent = "";
active = ""; active = "";
default = ""; default = "";
};
sort-by-number = true;
}; };
sort-by-number = true;
};
network = { network = {
tooltip = false; tooltip = false;
format-wifi = " {essid}"; format-wifi = " {essid}";
format-ethernet = ""; format-ethernet = "";
}; };
backlight = { backlight = {
tooltip = false; tooltip = false;
format = " {}%"; format = " {}%";
interval = 1; interval = 1;
on-scroll-up = "light -A 5"; on-scroll-up = "light -A 5";
on-scroll-down = "light -U 5"; on-scroll-down = "light -U 5";
}; };
battery = { battery = {
states = { states = {
good = 95; good = 95;
warning = 30; warning = 30;
critical = 20; critical = 20;
};
format = "{icon}\t{capacity}%";
format-charging = " {capacity}%";
format-plugged = " {capacity}%";
format-alt = "{time} {icon}";
format-icons = ["" "" "" "" ""];
}; };
format = "{icon}\t{capacity}%";
format-charging = " {capacity}%";
format-plugged = " {capacity}%";
format-alt = "{time} {icon}";
format-icons = [ "" "" "" "" "" ];
};
tray = { tray = {
icon-size = 24; icon-size = 24;
spacing = 10; spacing = 10;
}; };
clock = { clock = {
format = " {:%H:%M}"; format = " {:%H:%M}";
tooltip-format = "<span size='9pt' font='monospace'>{calendar}</span>"; tooltip-format = "<span size='9pt' font='monospace'>{calendar}</span>";
calendar = { calendar = {
mode = "month"; mode = "month";
weeks-pos = "right"; weeks-pos = "right";
format = { format = {
months = "<span color='#ffead3'><b>{}</b></span>"; months = "<span color='#ffead3'><b>{}</b></span>";
days = "<span color='#ecc6d9'><b>{}</b></span>"; days = "<span color='#ecc6d9'><b>{}</b></span>";
weeks = "<span color='#99ffdd'><b>W{}</b></span>"; weeks = "<span color='#99ffdd'><b>W{}</b></span>";
weekdays = "<span color='#ffcc66'><b>{}</b></span>"; weekdays = "<span color='#ffcc66'><b>{}</b></span>";
today = "<span color='#ff6699'><b><u>{}</u></b></span>"; today = "<span color='#ff6699'><b><u>{}</u></b></span>";
}; };
};
}; };
};
cpu = { cpu = {
interval = 15; interval = 15;
format = " {}%"; format = " {}%";
max-length = 10; max-length = 10;
}; };
memory = { memory = {
interval = 30; interval = 30;
format = " {}%"; format = " {}%";
max-length = 10; max-length = 10;
}; };
"custom/launcher" = { "custom/launcher" = {
format = " "; format = " ";
on-click = "nwggrid"; on-click = "nwggrid";
}; };
"custom/power" = { "custom/power" = {
format = "󰐥 "; format = "󰐥 ";
on-click = "nwgbar"; on-click = "nwgbar";
}; };
} }

View File

@ -1,27 +1,27 @@
{pkgs, ...}: { { pkgs, ... }: {
imports = [ imports = [
./home.nix ./home.nix
./programs.nix ./programs.nix
./services.nix ./services.nix
./xdg.nix ./xdg.nix
]; ];
systemd.user.services = { systemd.user.services = {
# TODO: Podman # TODO: Podman
}; };
i18n.inputMethod.enabled = "fcitx5"; i18n.inputMethod.enabled = "fcitx5";
i18n.inputMethod.fcitx5.addons = with pkgs; [ i18n.inputMethod.fcitx5.addons = with pkgs; [
fcitx5-configtool fcitx5-configtool
fcitx5-gtk fcitx5-gtk
fcitx5-chinese-addons fcitx5-chinese-addons
]; ];
gtk = { gtk = {
enable = true; enable = true;
iconTheme = { iconTheme = {
package = pkgs.iconpack-obsidian; # icon theme package = pkgs.iconpack-obsidian; # icon theme
name = "Obsidian"; name = "Obsidian";
};
}; };
};
} }

View File

@ -1,90 +1,90 @@
{pkgs, ...}: { { pkgs, ... }: {
home = { home = {
stateVersion = "23.05"; # Static stateVersion = "23.05"; # Static
username = "user"; username = "user";
homeDirectory = "/home/user"; homeDirectory = "/home/user";
packages = with pkgs; [ packages = with pkgs; [
btop btop
bat bat
thefuck thefuck
ranger ranger
icdiff icdiff
#rofi #rofi
#rofi-rbw #rofi-rbw
#nwg-launchers #nwg-launchers
nwg-bar nwg-bar
nwg-drawer nwg-drawer
gnumake42 gnumake42
wget wget
axel axel
grim grim
slurp slurp
unzip unzip
p7zip p7zip
#appimage-run #appimage-run
cmatrix cmatrix
gnome.gnome-software gnome.gnome-software
]; ];
sessionPath = [ sessionPath = [
".local/bin" ".local/bin"
#"Applications" #"Applications"
]; ];
sessionVariables = { sessionVariables = {
TERM = "kitty"; TERM = "kitty";
#GTK_IM_MODULE = "fcitx"; #GTK_IM_MODULE = "fcitx";
#QT_IM_MODULE = "fcitx"; #QT_IM_MODULE = "fcitx";
#SDL_VIDEODRIVER = "wayland"; #SDL_VIDEODRIVER = "wayland";
#SDL_IM_MODULE = "fcitx"; #SDL_IM_MODULE = "fcitx";
};
shellAliases = {
cao = "fuck";
top = "btop";
ls = "ls --color=auto";
cat = "bat -p --paging=never -u";
diff = "icdiff";
};
file = {
# hyprland
".config/hypr/hyprland.conf".source = ./files/hyprland.conf;
".config/hypr/hyprpaper.conf".source = ./files/hyprpaper.conf;
# ranger
".config/ranger/rc.conf".source = ./files/ranger-rc.conf;
# nwg
#".config/nwg-launchers".source = ./files/nwg-launchers;
".config/nwg-drawer".source = ./files/nwg-drawer;
".config/nwg-bar".source = ./files/nwg-bar;
# wallpapers
".local/share/wallpapers".source = ./wallpapers;
# Use flatseal to change permissions.
#".local/share/fonts".source = /run/current-system/sw/share/X11/fonts;
# Fix flatpak fonts
".local/share/flatpak/overrides/global".text = ''
[Context]
sockets=wayland
filesystems=/run/current-system/sw/share/X11/fonts:ro;/nix/store:ro;~/.icons;
'';
# Electron global settings
".config/electron-flags.conf".text = ''
--enable-features=WaylandWindowDecorations
--ozone-platform-hint=auto
--enable-webrtc-pipewire-capturer
'';
".config/electron13-flags.conf".text = ''
--enable-features=UseOzonePlatform
--ozone-platform=wayland
'';
};
}; };
shellAliases = {
cao = "fuck";
top = "btop";
ls = "ls --color=auto";
cat = "bat -p --paging=never -u";
diff = "icdiff";
};
file = {
# hyprland
".config/hypr/hyprland.conf".source = ./files/hyprland.conf;
".config/hypr/hyprpaper.conf".source = ./files/hyprpaper.conf;
# ranger
".config/ranger/rc.conf".source = ./files/ranger-rc.conf;
# nwg
#".config/nwg-launchers".source = ./files/nwg-launchers;
".config/nwg-drawer".source = ./files/nwg-drawer;
".config/nwg-bar".source = ./files/nwg-bar;
# wallpapers
".local/share/wallpapers".source = ./wallpapers;
# Use flatseal to change permissions.
#".local/share/fonts".source = /run/current-system/sw/share/X11/fonts;
# Fix flatpak fonts
".local/share/flatpak/overrides/global".text = ''
[Context]
sockets=wayland
filesystems=/run/current-system/sw/share/X11/fonts:ro;/nix/store:ro;~/.icons;
'';
# Electron global settings
".config/electron-flags.conf".text = ''
--enable-features=WaylandWindowDecorations
--ozone-platform-hint=auto
--enable-webrtc-pipewire-capturer
'';
".config/electron13-flags.conf".text = ''
--enable-features=UseOzonePlatform
--ozone-platform=wayland
'';
};
};
} }

View File

@ -1,82 +1,78 @@
{pkgs, ...}: { { pkgs, ... }: {
programs = { programs = {
home-manager.enable = true; home-manager.enable = true;
git = { git = {
enable = true; enable = true;
userName = "GPD Game User"; userName = "GPD Game User";
userEmail = "user@gpd.local"; userEmail = "user@gpd.local";
};
vim = {
enable = true;
defaultEditor = true;
};
zsh = {
enable = true;
enableAutosuggestions = true;
enableSyntaxHighlighting = true;
enableVteIntegration = true;
oh-my-zsh = {
enable = true;
plugins = [ "sudo" "git" "golang" "thefuck" "kubectl" "emoji" "pip" "npm" "yarn" "vscode" ];
theme = "agnoster";
};
};
waybar = {
enable = true;
systemd.enable = true;
systemd.target = "default.target";
# see https://github.com/theCode-Breaker/riverwm/blob/main/waybar/river/config-river
# https://blog.cascade.moe/posts/hyprland-configure/
settings = {
mainBar = import ./config/waybar.nix;
};
style = import ./config/waybar-style.nix;
};
kitty = {
enable = true;
font = {
name = "Powerline";
size = 12;
};
keybindings = {
"ctrl+c" = "copy_or_interrupt";
"ctrl+v" = "paste_from_clipboard";
};
shellIntegration = {
enableZshIntegration = true;
enableBashIntegration = true;
};
settings = {
background_opacity = "0.8";
};
};
rbw = {
enable = true;
settings = {
base_url = "https://pass.sense-t.eu.org";
email = "sense-t@sense-t.eu.org";
lock_timeout = 300;
pinentry = "gnome3";
};
};
wlogout = {
enable = false;
};
clipman = {
enable = true;
};
}; };
vim = {
enable = true;
defaultEditor = true;
};
zsh = {
enable = true;
enableAutosuggestions = true;
enableSyntaxHighlighting = true;
enableVteIntegration = true;
oh-my-zsh = {
enable = true;
plugins = [ "sudo" "git" "golang" "thefuck" "kubectl" "emoji" "pip" "npm" "yarn" "vscode" ];
theme = "agnoster";
};
};
waybar = {
enable = true;
systemd.enable = true;
systemd.target = "default.target";
# see https://github.com/theCode-Breaker/riverwm/blob/main/waybar/river/config-river
# https://blog.cascade.moe/posts/hyprland-configure/
settings = {
mainBar = import ./config/waybar.nix;
};
style = import ./config/waybar-style.nix;
};
kitty = {
enable = true;
font = {
name = "Powerline";
size = 12;
};
keybindings = {
"ctrl+c" = "copy_or_interrupt";
"ctrl+v" = "paste_from_clipboard";
};
shellIntegration = {
enableZshIntegration = true;
enableBashIntegration = true;
};
settings = {
background_opacity = "0.8";
};
};
rbw = {
enable = true;
settings = {
base_url = "https://pass.sense-t.eu.org";
email = "sense-t@sense-t.eu.org";
lock_timeout = 300;
pinentry = "gnome3";
};
};
wlogout = {
enable = false;
};
};
} }

View File

@ -1,43 +1,45 @@
{ {
services = { services = {
dunst = { clipman.enable = true;
enable = true;
settings = {
global = {
width = 300;
height = 300;
offset = "30x50";
origin = "top-right";
notification_limit = 10;
progress_bar = true;
transparency = 20;
corner_radius = 8;
};
urgency_low = { dunst = {
frame_color = "#3B7C87"; enable = true;
foreground = "#3B7C87"; settings = {
background = "#191311"; global = {
#background = "#2B313C" width = 300;
timeout = 4; height = 300;
}; offset = "30x50";
origin = "top-right";
urgency_normal = { notification_limit = 10;
frame_color = "#5B8234"; progress_bar = true;
foreground = "#5B8234"; transparency = 20;
background = "#191311"; corner_radius = 8;
#background = "#2B313C"
timeout = 6;
};
urgency_critical = {
frame_color = "#B7472A";
foreground = "#B7472A";
background = "#191311";
#background = "#2B313C"
timeout = 8;
};
};
}; };
urgency_low = {
frame_color = "#3B7C87";
foreground = "#3B7C87";
background = "#191311";
#background = "#2B313C"
timeout = 4;
};
urgency_normal = {
frame_color = "#5B8234";
foreground = "#5B8234";
background = "#191311";
#background = "#2B313C"
timeout = 6;
};
urgency_critical = {
frame_color = "#B7472A";
foreground = "#B7472A";
background = "#191311";
#background = "#2B313C"
timeout = 8;
};
};
}; };
};
} }

View File

@ -1,31 +1,32 @@
let let
defaultBrowser = "io.gitlab.librewolf-community.desktop"; defaultBrowser = "io.gitlab.librewolf-community.desktop";
defaultFileManager = "ranger.desktop"; defaultFileManager = "ranger.desktop";
defaultTerminal = "kitty.desktop"; defaultTerminal = "kitty.desktop";
in { in
xdg = { {
enable = true; xdg = {
mimeApps = { enable = true;
enable = true; mimeApps = {
defaultApplications = { enable = true;
# Default web browser. defaultApplications = {
"text/html" = defaultBrowser; # Default web browser.
"x-scheme-handler/http" = defaultBrowser; "text/html" = defaultBrowser;
"x-scheme-handler/https" = defaultBrowser; "x-scheme-handler/http" = defaultBrowser;
"x-scheme-handler/about" = defaultBrowser; "x-scheme-handler/https" = defaultBrowser;
"x-scheme-handler/unknown" = defaultBrowser; "x-scheme-handler/about" = defaultBrowser;
"x-scheme-handler/unknown" = defaultBrowser;
# Default file manager. # Default file manager.
"inode/directory" = defaultFileManager; "inode/directory" = defaultFileManager;
# Image # Image
"image/*" = defaultTerminal; "image/*" = defaultTerminal;
# Default terminal # Default terminal
"application/x-sh" = defaultTerminal; "application/x-sh" = defaultTerminal;
"application/x-shellscript" = defaultTerminal; "application/x-shellscript" = defaultTerminal;
"x-scheme-handler/ssh" = defaultTerminal; "x-scheme-handler/ssh" = defaultTerminal;
}; };
};
}; };
};
} }