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,16 +1,16 @@
# 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 = {
enable = true; enable = true;
flake = "git+https://git.sense-t.eu.org/NixOS/gpd-configurations#gpd"; flake = "git+https://git.sense-t.eu.org/NixOS/gpd-configurations#gpd";
}; };
} }

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": {
@ -98,4 +98,4 @@
}, },
"root": "root", "root": "root",
"version": 7 "version": 7
} }

135
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;[
noto-fonts
noto-fonts-cjk
noto-fonts-emoji
liberation_ttf
fira-code
fira-code-symbols
source-han-sans
source-han-serif
source-han-mono
source-code-pro
font-awesome_5
powerline-fonts
powerline-symbols
(nerdfonts.override { fonts = [ "FiraCode" "DroidSansMono" ]; })
];
fontconfig.cache32Bit = true; fonts = with pkgs;[
noto-fonts
noto-fonts-cjk
noto-fonts-emoji
liberation_ttf
fira-code
fira-code-symbols
source-han-sans
source-han-serif
source-han-mono
source-code-pro
font-awesome_5
powerline-fonts
powerline-symbols
(nerdfonts.override { fonts = [ "FiraCode" "DroidSansMono" ]; })
];
fontconfig.defaultFonts = { fontconfig.cache32Bit = true;
serif = [
"Source Han Serif SC"
];
sansSerif = [ fontconfig.defaultFonts = {
"Source Han Sans SC" serif = [
]; "Source Han Serif SC"
];
monospace = [ sansSerif = [
"Fira Code" "Source Han Sans SC"
"Source Han Mono SC" ];
];
}; monospace = [
"Fira Code"
"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 = {
hyprland = {
enable = true;
xwayland = {
enable = true;
hidpi = true;
};
};
proxychains = { # Enable automatic login for the user.
enable = true; services = {
quietMode = true; # flatpak dev.deedles.Trayscale
proxies = { # sudo tailscale up --operator=$USER
default = { # use https://hs.wetofu.me
type = "socks5"; tailscale.enable = true;
port = 1089; blueman.enable = true;
host = "127.0.0.1"; logrotate.checkConfig = false;
enable = true; flatpak.enable = true;
};
};
};
git.enable = true; ntp = {
zsh.enable = true; enable = true;
light.enable = true; servers = [
dconf.enable = true; "ntp.ntsc.ac.cn" # China
];
}; };
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 = {
plymouth.enable = true;
# Use xanmod kernel
kernelPackages = pkgs.linuxPackages_xanmod_latest;
kernelParams = [ "quiet" ];
kernelModules = [ "kvm-intel" ];
consoleLogLevel = 0;
kernel.sysctl = { boot = {
# for ryujinx plymouth.enable = true;
"vm.max_map_count" = 524288; # Use xanmod kernel
}; kernelPackages = pkgs.linuxPackages_xanmod_latest;
kernelParams = [ "quiet" ];
kernelModules = [ "kvm-intel" ];
consoleLogLevel = 0;
initrd = { kernel.sysctl = {
#verbose = false; # for ryujinx
availableKernelModules = [ "vm.max_map_count" = 524288;
"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;
fileSystems."/home" = { efiSupport = true;
device = "/dev/disk/by-uuid/4125f3b3-7613-a04b-910c-87169a7a87b3"; device = "nodev";
fsType = "ext4";
mirroredBoots = [
{
devices = [ "nodev" ];
path = "/boot";
}
];
};
}; };
};
swapDevices = [ fileSystems."/boot" = {
{ device = "/dev/nvme0n1p2"; } device = "/dev/disk/by-uuid/8095-BE1B";
]; fsType = "vfat";
};
# Enables DHCP on each ethernet and wireless interface. In case of scripted networking fileSystems."/nix" = {
# (the default) this is the recommended approach. When using systemd-networkd it's device = "/dev/disk/by-uuid/d2fac87e-ce48-174a-a544-36606fd39ee0";
# 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"; fileSystems."/home" = {
powerManagement.cpuFreqGovernor = lib.mkDefault "ondemand"; device = "/dev/disk/by-uuid/4125f3b3-7613-a04b-910c-87169a7a87b3";
hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; fsType = "ext4";
hardware.bluetooth.enable = true; };
}
swapDevices = [
{ device = "/dev/nvme0n1p2"; }
];
# 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 = {
states = {
good = 95;
warning = 30;
critical = 20;
};
format = "{icon}\t{capacity}%";
format-charging = " {capacity}%";
format-plugged = " {capacity}%";
format-alt = "{time} {icon}";
format-icons = ["" "" "" "" ""];
};
tray = { battery = {
icon-size = 24; states = {
spacing = 10; good = 95;
warning = 30;
critical = 20;
}; };
format = "{icon}\t{capacity}%";
format-charging = " {capacity}%";
format-plugged = " {capacity}%";
format-alt = "{time} {icon}";
format-icons = [ "" "" "" "" "" ];
};
clock = { tray = {
format = " {:%H:%M}"; icon-size = 24;
tooltip-format = "<span size='9pt' font='monospace'>{calendar}</span>"; spacing = 10;
calendar = { };
mode = "month";
weeks-pos = "right";
format = {
months = "<span color='#ffead3'><b>{}</b></span>";
days = "<span color='#ecc6d9'><b>{}</b></span>";
weeks = "<span color='#99ffdd'><b>W{}</b></span>";
weekdays = "<span color='#ffcc66'><b>{}</b></span>";
today = "<span color='#ff6699'><b><u>{}</u></b></span>";
};
};
};
cpu = { clock = {
interval = 15; format = " {:%H:%M}";
format = " {}%"; tooltip-format = "<span size='9pt' font='monospace'>{calendar}</span>";
max-length = 10; calendar = {
mode = "month";
weeks-pos = "right";
format = {
months = "<span color='#ffead3'><b>{}</b></span>";
days = "<span color='#ecc6d9'><b>{}</b></span>";
weeks = "<span color='#99ffdd'><b>W{}</b></span>";
weekdays = "<span color='#ffcc66'><b>{}</b></span>";
today = "<span color='#ff6699'><b><u>{}</u></b></span>";
};
}; };
};
memory = { cpu = {
interval = 30; interval = 15;
format = " {}%"; format = " {}%";
max-length = 10; max-length = 10;
}; };
"custom/launcher" = { memory = {
format = " "; interval = 30;
on-click = "nwggrid"; format = " {}%";
}; max-length = 10;
};
"custom/power" = { "custom/launcher" = {
format = "󰐥 "; format = " ";
on-click = "nwgbar"; on-click = "nwggrid";
}; };
"custom/power" = {
format = "󰐥 ";
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.fcitx5.addons = with pkgs; [
fcitx5-configtool
fcitx5-gtk
fcitx5-chinese-addons
];
gtk = {
enable = true;
iconTheme = {
package = pkgs.iconpack-obsidian; # icon theme
name = "Obsidian";
}; };
};
i18n.inputMethod.enabled = "fcitx5"; }
i18n.inputMethod.fcitx5.addons = with pkgs; [
fcitx5-configtool
fcitx5-gtk
fcitx5-chinese-addons
];
gtk = {
enable = true;
iconTheme = {
package = pkgs.iconpack-obsidian; # icon theme
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 = { dunst = {
global = { enable = true;
width = 300; settings = {
height = 300; global = {
offset = "30x50"; width = 300;
origin = "top-right"; height = 300;
notification_limit = 10; offset = "30x50";
progress_bar = true; origin = "top-right";
transparency = 20; notification_limit = 10;
corner_radius = 8; progress_bar = true;
}; transparency = 20;
corner_radius = 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;
};
};
}; };
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;
}; };
};
}; };
} };
}