Compare commits

..

No commits in common. "main" and "v1.1" have entirely different histories.

133 changed files with 1329 additions and 4175 deletions

2
.envrc
View file

@ -1,3 +1,3 @@
source_url "https://raw.githubusercontent.com/cachix/devenv/82c0147677e510b247d8b9165c54f73d32dfd899/direnvrc" "sha256-7u4iDd1nZpxL4tCzmPG0dQgC5V+/44Ba+tHkPob1v2k="
source_url "https://raw.githubusercontent.com/cachix/devenv/95f329d49a8a5289d31e0982652f7058a189bfca/direnvrc" "sha256-d+8cBpDfDBj41inrADaJt+bDWhOktwslgoP5YiGJ1v0="
use devenv

View file

@ -1,29 +1,19 @@
# My NixOS configuration
- system: `"x86_64-linux"`
- host os: `Linux 6.12.2-zen1, NixOS, 25.05 (Warbler), 25.05.20241229.88195a9`
- host os: `Linux 6.6.44, NixOS, 24.11 (Vicuna), 24.11.20240804.cb9a96f`
- multi-user?: `yes`
- sandbox: `yes`
- version: `nix-env (Nix) 2.24.11`
- version: `nix-env (Nix) 2.18.5`
- channels(root): `"nixos"`
- nixpkgs: `/nix/store/8vz84mqgnm1gz5yk7hgnnb5gir5hjxas-source`
- nixpkgs: `/nix/store/4cpakzyvfw1rmm9v5i3387x6jd2h1v86-source`
## Installation
This configuration is dependent on flakes being enabled in the system building the config.
### Build script
Build the default version of this configuration.
```
wget https://raw.githubusercontent.com/stvnliu/nixos-configuration/refs/heads/main/deploy.sh
chmod +x ./deploy.sh
./deploy.sh https://github.com/stvnliu/nixos-configuration nixos-msi
```
or manually:
```sh
git clone <repo_url> <path_to_config>
sudo nixos-rebuild --flake <path_to_config>#<your_hostname> boot
sudo nixos-rebuild --flake <path_to_this_config>#<your_hostname> switch
```
## Features

View file

@ -1,22 +1,12 @@
{ config, pkgs, lib, ... }:
let
monitorMaxBrightness = "255";
# monitorMinBrightness = "32";
stylixBG = config.lib.stylix.colors.base00;
stylixFG = config.lib.stylix.colors.base07;
stylixPrimaryBG = config.lib.stylix.colors.base12;
in
{
config,
pkgs,
lib,
...
}: {
# Type definitions for nix variables used in this configuration
options = with lib;
with types; {
usingMusicPlayerDaemon = mkOption { type = bool; };
defaultApplications = {
fileManager = mkOption { type = str; };
appLauncher = mkOption { type = str; };
terminal = mkOption { type = str; };
};
myWallPaperPath = mkOption { type = path; };
myUserName = mkOption {type = str;};
myHostName = mkOption {type = str;};
myWallPaperPathString = mkOption {type = str;};
@ -25,48 +15,21 @@ in
displayScale = mkOption {type = int;};
myAutostartCommands = mkOption {type = listOf str;};
myConfigLocation = mkOption {type = str;};
desktopFont = {
shortName = mkOption { type = str; };
fullName = mkOption { type = str; };
package = mkOption { type = package; };
};
};
# Default values for this configuration
config = rec {
myUserName = "stvnliu";
myWallPaperPath = ../home-manager/${myUserName}/assets/od_neon.png;
myHostName = "nixos-msi";
displayScale = 2;
myWallPaperPathString = "/home/${myUserName}/wallpaper.png";
myWallPaperPathString = "/home/${myUserName}/wallpaper.jpg";
myDisplayName = "Zhongheng Liu";
myEmail = "z.liu@outlook.com.gr";
/* specialisation."powersave".configuration = {
myAutostartCommands =
[ "${pkgs.brightnessctl}/bin/brightnessctl s ${monitorMinBrightness}" ];
};
*/
myConfigLocation =
"/home/${myUserName}/Development/Nix/nixos-configuration";
desktopFont = {
shortName = "0xProto Nerd Font";
fullName = "${desktopFont.shortName}:style=Regular";
package = pkgs.nerd-fonts._0xproto;
};
myAutostartCommands = [
"${pkgs.brightnessctl}/bin/brightnessctl s ${monitorMaxBrightness}"
"fcitx5"
# "${pkgs.foot}/bin/foot --server -f \"${desktopFontFullName}:size=12\" -o colors.alpha=0.85"
"${pkgs.udiskie}/bin/udiskie"
"${pkgs.pa-notify}/bin/pa-notify"
"${pkgs.networkmanagerapplet}/bin/nm-applet"
];
defaultApplications = {
terminal = "${pkgs.foot}/bin/footclient";
fileManager = "${pkgs.nemo}/bin/nemo";
appLauncher = ''
${pkgs.wmenu}/bin/wmenu-run -p "Launch a program..." -N ${stylixBG} -n ${stylixFG} -S ${stylixPrimaryBG}'';
};
usingMusicPlayerDaemon = true;
myConfigLocation = "/home/${myUserName}/nix-conf";
};
}

View file

@ -1,18 +0,0 @@
#!/usr/bin/env sh
# Deploys the configuation to your machine
TMP_DIRNAME="/tmp/nix-config"
GIT_REMOTE_SRC=$1
NIX_HOST=$2
echo "Going to clone $GIT_REMOTE_SRC into $TMP_DIRNAME"
mkdir "$TMP_DIRNAME"
git clone "$GIT_REMOTE_SRC" "$TMP_DIRNAME"
prev=$PWD
cd "$TMP_DIRNAME" || return
echo "Now going to build nix configuration for $NIX_HOST to switch on next boot"
sudo nixos-rebuild --flake .#"$NIX_HOST" boot
cd "$prev" || return

View file

@ -3,10 +3,11 @@
"devenv": {
"locked": {
"dir": "src/modules",
"lastModified": 1732298876,
"lastModified": 1723156315,
"owner": "cachix",
"repo": "devenv",
"rev": "741e23a22f3dc9e53075be3eaa795ea9ed6f5129",
"rev": "ff5eb4f2accbcda963af67f1a1159e3f6c7f5f91",
"treeHash": "6624b16e4203ef3eae59ce8d5d19005e04741537",
"type": "github"
},
"original": {
@ -23,6 +24,7 @@
"owner": "edolstra",
"repo": "flake-compat",
"rev": "0f9255e01c2351cc7d116c072cb317785dd33b33",
"treeHash": "2addb7b71a20a25ea74feeaf5c2f6a6b30898ecb",
"type": "github"
},
"original": {
@ -43,6 +45,7 @@
"owner": "hercules-ci",
"repo": "gitignore.nix",
"rev": "637db329424fd7e46cf4185293b9cc8c88c95394",
"treeHash": "ca14199cabdfe1a06a7b1654c76ed49100a689f9",
"type": "github"
},
"original": {
@ -57,6 +60,7 @@
"owner": "cachix",
"repo": "devenv-nixpkgs",
"rev": "4267e705586473d3e5c8d50299e71503f16a6fb6",
"treeHash": "6d9f1f7ca0faf1bc2eeb397c78a49623260d3412",
"type": "github"
},
"original": {
@ -68,10 +72,11 @@
},
"nixpkgs-stable": {
"locked": {
"lastModified": 1731797254,
"lastModified": 1722869614,
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "e8c38b73aeb218e27163376a2d617e61a2ad9b59",
"rev": "883180e6550c1723395a3a342f830bfc5c371f6b",
"treeHash": "e3ce01703c0d0324121e0d3ec6336275025b4ae6",
"type": "github"
},
"original": {
@ -91,10 +96,11 @@
"nixpkgs-stable": "nixpkgs-stable"
},
"locked": {
"lastModified": 1732021966,
"lastModified": 1723056346,
"owner": "cachix",
"repo": "pre-commit-hooks.nix",
"rev": "3308484d1a443fc5bc92012435d79e80458fe43c",
"rev": "3c977f1c9930f54066c085305b4b2291385e7a73",
"treeHash": "d6f89338ffb2ca32c20bc0f8d50009e1894ab804",
"type": "github"
},
"original": {

View file

@ -1,4 +1,10 @@
{ pkgs, ... }: {
{
pkgs,
lib,
config,
inputs,
...
}: {
# https://devenv.sh/basics/
env.GREET = "devenv";
cachix.enable = false;
@ -9,10 +15,9 @@
# languages.rust.enable = true;
languages.nix.enable = true;
pre-commit.hooks = {
nixpkgs-fmt.enable = true;
alejandra.enable = true;
shellcheck.enable = true;
commitizen.enable = true;
deadnix.enable = true;
};
# https://devenv.sh/processes/
# processes.cargo-watch.exec = "cargo-watch";
@ -24,20 +29,18 @@
scripts.hello.exec = ''
echo hello from $GREET
'';
scripts.about.exec = ''
${pkgs.glow}/bin/glow -p ./README.md
less ./LICENSE
'';
enterShell = ''
hello
git --version
nixpkgs-fmt --version
alejandra --version
'';
# https://devenv.sh/tests/
enterTest =
# shell
/*
shell
*/
''
echo "Running tests"
git --version | grep --color=auto "${pkgs.git.version}"

750
flake.lock generated

File diff suppressed because it is too large Load diff

View file

@ -2,41 +2,35 @@
description = "Your new nix config";
inputs = {
hyprswitch.url = "github:h3rmt/hyprswitch/release";
# Nixpkgs
nixpkgs-master.url = "github:nixos/nixpkgs/master";
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
nixpkgs-stable.url = "github:nixos/nixpkgs/nixos-24.11";
nixvim = {
url = "github:nix-community/nixvim";
inputs.nixpkgs.follows = "nixpkgs";
};
# Home manager
home-manager = {
url = "github:nix-community/home-manager";
inputs.nixpkgs.follows = "nixpkgs";
};
/* lix-module = {
url =
"https://git.lix.systems/lix-project/nixos-module/archive/2.91.0.tar.gz";
inputs.nixpkgs.follows = "nixpkgs";
};
*/
stylix = { url = "github:danth/stylix"; };
home-manager.url = "github:nix-community/home-manager";
home-manager.inputs.nixpkgs.follows = "nixpkgs";
stylix.url = "github:danth/stylix";
spicetify-nix = {
url = "github:Gerg-L/spicetify-nix";
inputs.nixpkgs.follows = "nixpkgs";
};
hyprland-qtutils.url = "github:hyprwm/hyprland-qtutils";
};
outputs = { self, nixpkgs, home-manager, stylix, spicetify-nix, ... }@inputs:
let
outputs = {
self,
nixpkgs,
home-manager,
stylix,
spicetify-nix,
...
} @ inputs: let
inherit (self) outputs;
myHostName = "nixos-msi";
stevenUserName = "stvnliu";
in
{
in {
# NixOS configuration entrypoint
# Available through 'nixos-rebuild --flake .#your-hostname'
nixosConfigurations = {
@ -44,7 +38,6 @@
specialArgs = {inherit inputs outputs;};
modules = [
./nixos/configuration.nix
#lix-module.nixosModules.default
];
};
};
@ -52,17 +45,14 @@
# Standalone home-manager configuration entrypoint
# Available through 'home-manager --flake .#your-username@your-hostname'
homeConfigurations = {
"${stevenUserName}@${myHostName}" =
home-manager.lib.homeManagerConfiguration {
pkgs =
nixpkgs.legacyPackages.x86_64-linux; # Home-manager requires 'pkgs' instance
"${stevenUserName}@${myHostName}" = home-manager.lib.homeManagerConfiguration {
pkgs = nixpkgs.legacyPackages.x86_64-linux; # Home-manager requires 'pkgs' instance
extraSpecialArgs = {inherit inputs outputs;};
modules = [
./home-manager/${stevenUserName}/home.nix
stylix.homeManagerModules.stylix
inputs.nixvim.homeManagerModules.nixvim
spicetify-nix.homeManagerModules.default
inputs.stylix.homeManagerModules.stylix
inputs.spicetify-nix.homeManagerModules.default
];
};
};

View file

@ -1,8 +1,7 @@
import { Workspaces } from "./hyprworkspaces.js";
import { NetworkIndicator } from "./indicators.js";
const hyprland = await Service.import("hyprland")
const network = await Service.import("network")
// const notifications = await Service.import("notifications")
// const mpris = await Service.import("mpris")
const hyprland = await Service.import("hyprland");
const mpris = await Service.import("mpris")
const audio = await Service.import("audio")
const battery = await Service.import("battery")
const systemtray = await Service.import("systemtray")
@ -13,6 +12,61 @@ const date = Variable("", {
// widgets can be only assigned as a child in one container
// so to make a reuseable widget, make it a function
// then you can simply instantiate one by calling it
const focusedTitle = Widget.Label({
label: hyprland.active.client.bind('title'),
visible: hyprland.active.client.bind('address')
.as(addr => addr !== "0x"),
})
const dispatch = ws => hyprland.messageAsync(`dispatch workspace ${ws}`);
const Workspaces = () => Widget.EventBox({
onScrollUp: () => dispatch('+1'),
onScrollDown: () => dispatch('-1'),
child: Widget.Box({
children: Array.from({ length: 10 }, (_, i) => i + 1).map(i => Widget.Button({
attribute: i,
label: `${i}`,
onClicked: () => dispatch(i),
class_name: i === hyprland.active.workspace.id ? "focused" : ""
})),
// remove this setup hook if you want fixed number of buttons
setup: self => self.hook(hyprland, () => self.children.forEach(btn => {
btn.visible = hyprland.workspaces.some(ws => ws.id === btn.attribute);
})),
}),
})
function ClientTitle() {
return Widget.Label({
class_name: "client-title",
label: hyprland.active.client.bind("title").as(title => title.length <= 30 ? title : `${title.substring(0, 29)}...`),
})
}
const WifiIndicator = () => Widget.Box({
children: [
Widget.Icon({
icon: network.wifi.bind('icon_name'),
}),
Widget.Label({
label: network.wifi.bind('ssid')
.as(ssid => ssid || 'Unknown'),
}),
],
})
const WiredIndicator = () => Widget.Icon({
icon: network.wired.bind('icon_name'),
})
const NetworkIndicator = () => Widget.Stack({
children: {
wifi: WifiIndicator(),
wired: WiredIndicator(),
},
shown: network.bind('primary').as(p => p || 'wifi'),
})
function Clock() {
const calendar = Widget.Calendar({
showDayNames: true,
@ -41,7 +95,27 @@ function Clock() {
})
}
/* function Media() {
// we don't need dunst or any other notification daemon
// because the Notifications module is a notification daemon itself
/*function Notification() {
const popups = notifications.bind("popups")
return Widget.Box({
class_name: "notification",
visible: popups.as(p => p.length > 0),
children: [
Widget.Icon({
icon: "preferences-system-notifications-symbolic",
}),
Widget.Label({
label: popups.as(p => p[0]?.summary || ""),
}),
],
})
}*/
function Media() {
const label = Utils.watch("", mpris, "player-changed", () => {
if (mpris.players[0]) {
const { track_artists, track_title } = mpris.players[0]
@ -59,7 +133,7 @@ function Clock() {
child: Widget.Label({ label }),
})
}
*/
function Volume() {
const icons = {
@ -139,6 +213,7 @@ function Left() {
spacing: 8,
children: [
Workspaces(),
ClientTitle(),
],
})
}
@ -212,13 +287,15 @@ const cpuProgress = Widget.Label({
const ramProgress = Widget.Label({
label: ram.bind().as(usage => `${(usage * 100).toPrecision(4)}%`)
})
const bars = hyprland.monitors.map((value, _index, _arr) => {
return Bar(value.id);
})
App.config({
style: "./style.css",
windows: bars,
windows: [
Bar(),
// you can call it, for each monitor
// Bar(0),
// Bar(1)
],
})
export { }

View file

@ -1,23 +0,0 @@
const hyprland = await Service.import("hyprland")
const dispatch = ws => hyprland.messageAsync(`dispatch workspace ${ws}`);
const wsSymbols = ["1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "20"]
const Workspaces = () => Widget.EventBox({
onScrollUp: () => dispatch('+1'),
onScrollDown: () => dispatch('-1'),
child: Widget.Box({
children: Array.from({ length: 10 }, (_, i) => i + 1).map(i => Widget.Button({
attribute: i,
label: `${wsSymbols[i-1]}`,
onClicked: () => dispatch(i),
class_name: i === hyprland.active.workspace.id ? "focused" : ""
})),
// remove this setup hook if you want fixed number of buttons
setup: self => self.hook(hyprland, () => self.children.forEach(btn => {
btn.visible = hyprland.workspaces.some(ws => ws.id === btn.attribute);
})),
}),
})
export { Workspaces };

View file

@ -1,25 +0,0 @@
const network = await Service.import("network")
const WifiIndicator = () => Widget.Box({
children: [
Widget.Icon({
icon: network.wifi.bind('icon_name'),
}),
Widget.Label({
label: network.wifi.bind('ssid')
.as(ssid => ssid || 'Unknown'),
}),
],
})
const WiredIndicator = () => Widget.Icon({
icon: network.wired.bind('icon_name'),
})
const NetworkIndicator = () => Widget.Stack({
children: {
wifi: WifiIndicator(),
wired: WiredIndicator(),
},
shown: network.bind('primary').as(p => p || 'wifi'),
})
export { NetworkIndicator };

View file

@ -1,3 +0,0 @@
function MonitorWidget() {
}

View file

@ -1,17 +0,0 @@
const mpris = await Service.import('mpris')
/**
* @param {import('types/service/mpris').MprisPlayer} player
* */
const Player = (player, count) => Widget.Button({
onClicked: () => player.playPause(),
child: Widget.Label().hook(player, label => {
const { track_artists, track_title } = player;
label.label = `${count} PLAYING`;
}),
})
export const players = Widget.Box({
children: mpris.bind('players').as(p => p.map(
(this_player, index, array) => { return Player(this_player, array.length) }))
})

View file

@ -1,6 +1,7 @@
{ pkgs
, config
, ...
{
pkgs,
config,
...
}: {
config = {
home.file = {
@ -8,10 +9,7 @@
source = ./config;
};
};
home.packages = with pkgs; [
ags
brightnessctl
];
home.packages = with pkgs; [ags];
myAutostartCommands = [
#"${pkgs.ags}/bin/ags --init"
"${pkgs.ags}/bin/ags"

Binary file not shown.

Before

Width:  |  Height:  |  Size: 166 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 779 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.3 MiB

View file

@ -1,22 +1,14 @@
{ pkgs, ... }: {
{
lib,
pkgs,
config,
...
}: {
imports = [
#./vscode.nix
#./intellij.nix
];
programs.nixvim = import ./nixvim;
# dependencies for nixvim configuration
home.packages = with pkgs; [ripgrep fd];
programs.helix = {
enable = true;
settings = {
editor.cursor-shape = {
normal = "block";
insert = "bar";
select = "underline";
};
};
languages.language = import ./helix-langs.nix { inherit pkgs; };
themes = {
autumn_night_transparent = {
"inherits" = "autumn_night";
"ui.background" = { };
};
};
};
}

View file

@ -1,11 +1,24 @@
{ pkgs
, ...
{
pkgs,
config,
...
}: {
gtk = {
enable = true;
iconTheme = {
package = pkgs.adwaita-icon-theme;
name = "Adwaita";
package = pkgs.gruvbox-plus-icons;
name = "Gruvbox-Plus-Dark";
};
};
qt = {
enable = true;
platformTheme = "gtk";
style = {
package = pkgs.libsForQt5.breeze-qt5;
name = "breeze";
};
};
home.packages = with pkgs; [
libsForQt5.breeze-qt5
];
}

View file

@ -1,30 +0,0 @@
{ pkgs }: [
{
name = "nix";
auto-format = true;
formatter.command = "${pkgs.nixfmt}/bin/nixfmt";
}
{
name = "python";
auto-format = true;
formatter.command = "${pkgs.black}/bin/black";
}
{
name = "rust";
auto-format = true;
formatter.command = "${pkgs.rustfmt}/bin/rustfmt";
}
{
name = "java";
auto-format = true;
formatter.command = "${pkgs.jdt-language-server}/bin/jdtls";
}
{
name = "c";
auto-format = true;
formatter.command = "${pkgs.astyle}/bin/astyle --squeeze-ws --style=c";
}
# { }
# { }
# { }
]

View file

@ -1,26 +1,46 @@
{ config, pkgs, ... }: {
# his is your home-manager configuration file
# Use this to configure your home environment (it replaces ~/.config/nixpkgs/home.nix)
{
inputs,
lib,
config,
pkgs,
...
}: {
# You can import other home-manager modules here
imports = [
#./hypr
# If you want to use home-manager modules from other flakes (such as nix-colors):
# inputs.nix-colors.homeManagerModule
# You can also split up your configuration and import pieces of it here:
#./swaywm.nix
./hypr
./shells
../../common/variables.nix
./services
./mako.nix
./wechat
./editors.nix
./gtk.nix
#./ags
./ags
./xdg.nix
./stylix.nix
#./dwl
./spicetify.nix
./scripts
./programs
./packages
];
#services.pass-secret-service.enable = true;
nixpkgs = {
# You can add overlays here
overlays = [
(_final: prev: {
# If you want to use overlays exported from other flakes:
# neovim-nightly-overlay.overlays.default
# Or define it inline, for example:
# (final: prev: {
# hi = final.hello.overrideAttrs (oldAttrs: {
# patches = [ ./change-hello-to-hi.patch ];
# });
# })
(final: prev: {
ags = prev.ags.overrideAttrs (old: {
buildInputs = old.buildInputs ++ [pkgs.libdbusmenu-gtk3];
});
@ -28,13 +48,6 @@
];
# Configure your nixpkgs instance
config = {
cudaSupport = true;
permittedInsecurePackages = [
"dotnet-core-combined"
"dotnet-sdk-6.0.428"
"dotnet-sdk-7.0.410"
"dotnet-sdk-wrapped-6.0.428"
];
# Disable if you don't want unfree packages
allowUnfree = true;
# Workaround for https://github.com/nix-community/home-manager/issues/2942
@ -46,43 +59,66 @@
username = "${config.myUserName}";
homeDirectory = "/home/${config.myUserName}";
# copy wallpaper from assets
file = { "wallpaper.jpg".source = config.myWallPaperPath; };
file = {"wallpaper.jpg".source = ./assets/nixos-wallpaper.jpg;};
};
home.packages = with pkgs; [
prismlauncher
protonvpn-gui
devenv
vlc
clash-verge-rev
tree
zed-editor
rhythmbox
#clash-verge-rev
qq
libreoffice
discord
#zathura
kdePackages.okular
shotwell
mpv
kdePackages.kdenlive
kdenlive
obsidian
pcmanfm
udiskie
android-file-transfer
usbutils
mtpfs
teams-for-linux
sxiv
heroic
];
myAutostartCommands = [
"${pkgs.clash-verge-rev}/bin/clash-verge"
#"${pkgs.clash-verge-rev}/bin/clash-verge"
"${pkgs.firefox}/bin/firefox"
"${pkgs.thunderbird}/bin/thunderbird"
];
programs = {
obs-studio = {
enable = true;
plugins = with pkgs.obs-studio-plugins; [ wlrobs input-overlay ];
plugins = [pkgs.obs-studio-plugins.wlrobs];
};
home-manager.enable = true;
firefox = {
enable = true;
package = with pkgs;
(librewolf.override {
nativeMessagingHosts = [ passff-host ];
hasMozSystemDirPatch = true;
});
};
firefox.enable = true;
thunderbird = {
enable = true;
profiles.default = {isDefault = true;};
};
git = {
enable = true;
package = pkgs.gitFull;
userName = config.myDisplayName;
userEmail = config.myEmail;
extraConfig = {
push.autoSetupRemote = true;
commit.gpgsign = true;
gpg.format = "ssh";
gpg.ssh.allowedSignersFile = "/home/${config.myUserName}/.ssh/allowed_signers";
user.signingkey = "/home/${config.myUserName}/.ssh/id_ed25519.pub";
credential.helper = "libsecret";
};
};
};
# Nicely reload system units when changing configs
systemd.user.startServices = "sd-switch";

View file

@ -1,7 +1,11 @@
{ ...
{
pkgs,
config,
lib,
...
}: {
imports = [
./hyprland
./hyprland.nix
./hyprpaper.nix
./hypridle.nix
./hyprlock.nix

View file

@ -1,8 +1,6 @@
{ ... }:
let
{pkgs, ...}: let
timeoutSeconds = 600;
in
{
in {
services.hypridle = {
enable = true;
settings = {

View file

@ -0,0 +1,102 @@
{
config,
pkgs,
...
}: {
home.packages = with pkgs; [foot];
wayland.windowManager.hyprland = {
# Whether to enable Hyprland wayland compositor
enable = true;
# The hyprland package to use
package = pkgs.hyprland;
plugins = with pkgs.hyprlandPlugins; [
hyprfocus
csgo-vulkan-fix
];
# Whether to enable XWayland
xwayland.enable = true;
settings = {
xwayland = {force_zero_scaling = true;};
monitor = [
#"eDP-1, 1920x1080@165,0x0,1"
",preferred, auto, ${builtins.toString config.displayScale}"
];
input = {
# xset rate 250 50 replacement on wayland...
# FAST MODE LET'S GOOO
repeat_rate = 50;
repeat_delay = 250;
};
exec-once =
config.myAutostartCommands
++ [
"[workspace special silent] ${pkgs.foot}/bin/foot -f 'BlexMono Nerd Font:size=12' -o colors.alpha=0.85 ${config.myShells.defaultShell}"
];
misc = {
disable_hyprland_logo = true;
disable_splash_rendering = true;
font_family = "monospace";
};
"$mod" = "SUPER";
binde = [
", XF86AudioRaiseVolume, exec, wpctl set-volume -l 1.0 @DEFAULT_AUDIO_SINK@ 5%+"
# Example volume button that will activate even while an input inhibitor is active
", XF86AudioLowerVolume, exec, wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%-"
];
bind = let
terminalCmd = "${pkgs.foot}/bin/foot -f 'BlexMono Nerd Font:size=12' -o colors.alpha=0.85 ${config.myShells.defaultShell}";
screenshotLocation = "/home/${config.myUserName}/Screenshots/$(date '+%Y-%m-%d-%H-%M-%S').png";
in
[
"$mod SHIFT, L, exec, ${pkgs.hyprlock}/bin/hyprlock --immediate"
"$mod SHIFT, Print, exec, ${pkgs.grimblast}/bin/grimblast copysave output ${screenshotLocation}"
"$mod, Print, exec, ${pkgs.grimblast}/bin/grimblast copysave area ${screenshotLocation}"
", Print, exec, ${pkgs.grimblast}/bin/grimblast copy area"
# special workspace keybinds
"$mod, S, togglespecialworkspace"
"$mod SHIFT, S, movetoworkspace, special"
# keysyms for util functions
# Example volume button that allows press and hold, volume limited to 150%
"$mod, Q, killactive"
"$mod, D, exec, ${pkgs.fuzzel}/bin/fuzzel"
# firefox quickstart
"$mod, F, exec, ${pkgs.firefox}/bin/firefox"
"$mod, E, exec, ${pkgs.pcmanfm}/bin/pcmanfm"
# foot terminal
"$mod, Return, exec, ${terminalCmd}"
"$mod SHIFT, Return, exec, [float] ${terminalCmd}"
# vimkeys navigation
"$mod, H, movefocus, l"
"$mod, J, movefocus, d"
"$mod, K, movefocus, u"
"$mod, L, movefocus, r"
]
++ (
# workspaces
# binds $mod + [shift +] {1..10} to [move to] workspace {1..10}
builtins.concatLists (builtins.genList (x: let
ws = let c = (x + 1) / 10; in builtins.toString (x + 1 - (c * 10));
in [
"$mod, ${ws}, workspace, ${toString (x + 1)}"
"$mod SHIFT, ${ws}, movetoworkspace, ${toString (x + 1)}"
])
10)
);
bindm = [
# mouse movements
"$mod, mouse:272, movewindow"
"$mod, mouse:273, resizewindow"
"$mod ALT, mouse:272, resizewindow"
];
};
# Optional
# Whether to enable hyprland-session.target on hyprland startup
systemd = {enable = true;};
};
# ...
}

View file

@ -1,68 +0,0 @@
{ config, pkgs, inputs, ... }:
let
terminalCmd = config.defaultApplications.terminal;
screenshotLocation =
"/home/${config.myUserName}/Screenshots/$(date '+%Y-%m-%d-%H-%M-%S').png";
in
[
"$mod SHIFT, L, exec, ${pkgs.wlogout}/bin/wlogout"
"$mod SHIFT, Print, exec, ${pkgs.grimblast}/bin/grimblast copysave output ${screenshotLocation}"
", Print, exec, ${pkgs.grimblast}/bin/grimblast copysave area ${screenshotLocation}"
"$mod, Print, exec, ${pkgs.grimblast}/bin/grimblast copy area"
# special workspace keybinds
"$mod, S, togglespecialworkspace"
"$mod SHIFT, S, movetoworkspace, special"
"alt, Tab, exec, ${inputs.hyprswitch.packages.x86_64-linux.default}/bin/hyprswitch gui --mod-key alt --key Tab --close mod-key-release --reverse-key=key=grave && hyprswitch dispatch"
# keysyms for util functions
# Example volume button that allows press and hold, volume limited to 150%
"$mod, Q, killactive"
"$mod, D, exec, ${config.defaultApplications.appLauncher}"
"$mod, F, fullscreen"
"$mod, E, exec, ${config.defaultApplications.fileManager}"
# foot terminal
"$mod, Return, exec, ${terminalCmd} ${config.myShells.defaultShell}"
"$mod SHIFT, Return, exec, ${terminalCmd} --title=floats ${config.myShells.defaultShell}"
# cmdline utilities
/* NOTE Replaced by network manager applet
nmtui interface is no longer needed
TODO Fix floating window rule
*/
# "$mod, N, exec, [float] ${terminalCmd} ${pkgs.networkmanager}/bin/nmtui"
#"$mod, M, exec, [float] ${terminalCmd} ${pkgs.zenith}/bin/zenith"
# vimkeys navigation
"$mod, H, movefocus, l"
"$mod, J, movefocus, d"
"$mod, K, movefocus, u"
"$mod, L, movefocus, r"
] ++ (if config.services.mpd.enable then
[ "$mod, M, exec, ${terminalCmd} --title=ncmpc ${pkgs.ncmpcpp}/bin/ncmpcpp" ]
else
[ ]) ++ (if config.services.swaync.enable then
[ "$mod, N, exec, ${pkgs.swaynotificationcenter}/bin/swaync-client -t" ]
else
[ ]) ++ (
# workspaces
# binds $mod + [shift +] {1..10} to [move to] workspace {1..10}
builtins.concatLists (builtins.genList
(x:
let ws = let c = (x + 1) / 10; in builtins.toString (x + 1 - (c * 10));
in [
"$mod, ${ws}, workspace, ${toString (x + 1)}"
"$mod SHIFT, ${ws}, movetoworkspace, ${toString (x + 1)}"
]) 10)
# workspaces
# binds $mod + [shift +] {1..10} to [move to] workspace {1..10}
/* builtins.concatLists (builtins.genList (x:
let ws = let c = (x + 1) / 10; in builtins.toString (x + 1 - (c * 10));
in [
"$mod M, ${ws}, workspace, ${toString (x + 10 + 1)}"
"$mod SHIFT M, ${ws}, movetoworkspace, ${toString (x + 10 + 1)}"
]) 10)
*/
)

View file

@ -1,85 +0,0 @@
{ inputs, config, pkgs, lib, ... }:
let
bgbordercolor = config.lib.stylix.colors.base01;
fgbordercolor = config.lib.stylix.colors.base02;
in
{
home.packages =
[ inputs.hyprland-qtutils.packages.x86_64-linux.default pkgs.foot ];
wayland.windowManager.hyprland = {
# Whether to enable Hyprland wayland compositor
enable = true;
# The hyprland package to use
package = pkgs.hyprland;
plugins = with pkgs.hyprlandPlugins;
[
# hyprbars
# hyprexpo
# hyprfocus
# hycov
];
# Whether to enable XWayland
xwayland.enable = true;
settings = {
plugins = import ./hyprbars.nix { inherit config; };
# env = [ "AQ_DRM_DEVICES, /dev/dri/card0" ];
xwayland = { force_zero_scaling = true; };
monitor = [
"desc:Xiaomi Corporation Mi 27 NFGL 3215000032603, 1920x1080@75, 2560x0, 1"
"desc:BOE 0x0B40,preferred, auto, ${
builtins.toString config.displayScale
}"
", preferred, auto, 1" # wildcard definition
];
general = {
"col.inactive_border" = lib.mkForce "rgb(${bgbordercolor})";
"col.active_border" = lib.mkForce "rgb(${fgbordercolor})";
border_size = 1;
gaps_in = 2.5;
gaps_out = 5;
allow_tearing = true;
};
windowrulev2 = import ./window_rules.nix;
decoration = { rounding = 5; };
input = {
# xset rate 250 50 replacement on wayland...
repeat_rate = 50;
repeat_delay = 250;
accel_profile = "flat";
};
exec-once = config.myAutostartCommands ++ (import ./hypr_autostart.nix {
inherit config;
inherit pkgs;
inherit inputs;
});
cursor = {
# Fixes https://github.com/hyprwm/Hyprland/issues/9324
# Needed because by default, Hyprland enabled Nvidia hardware cursors.
no_hardware_cursors = true;
};
misc = {
disable_hyprland_logo = true;
disable_splash_rendering = true;
font_family = "monospace";
focus_on_activate = true;
};
"$mod" = "SUPER";
binde = import ./xf86_binds.nix { inherit pkgs; };
bind = import ./binds.nix {
inherit config;
inherit pkgs;
inherit inputs;
};
bindm = [
# mouse movements
"$mod, mouse:272, movewindow"
"$mod, mouse:273, resizewindow"
"$mod ALT, mouse:272, resizewindow"
];
};
# Optional
# Whether to enable hyprland-session.target on hyprland startup
systemd = { enable = true; }; # set to false due to UWSM
};
# ...
}

View file

@ -1,7 +0,0 @@
{ config, pkgs, inputs }: [
"${config.programs.thunderbird.package}/bin/thunderbird"
"${pkgs.mpris-notifier}/bin/mpris-notifier"
"${pkgs.mpd-discord-rpc}/bin/mpd-discord-rpc"
"${pkgs.easyeffects}/bin/easyeffects --gapplication-service"
"${inputs.hyprswitch.packages.x86_64-linux.default}/bin/hyprswitch init --show-title --size-factor 5.5 --workspaces-per-row 5"
]

View file

@ -1,16 +0,0 @@
{ config }: {
hyprbars = {
bar_height = 38;
bar_color = "rgb(1e1e1e)";
"col.text" = "ffffff";
bar_text_size = 12;
bar_text_font = config.desktopFont.fullName;
bar_button_padding = 12;
bar_padding = 10;
bar_precedence_over_border = true;
hyprbars-button = [
"rgb(ffffff), 20, 󰅖, hyprctl dispatch killactive;"
"rgb(ffffff), 20, 󰊓, hyprctl dispatch fullscreen 2;"
];
};
}

View file

@ -1,7 +0,0 @@
[
"workspace special silent, class:^(foot.*)$, title:autorun"
"float, title:floats"
"float, title:ncmpc"
"size 50% 50%, title:ncmpc"
"immediate, class:^(cs2)$"
]

View file

@ -1,11 +0,0 @@
{ pkgs
,
}: [
", XF86AudioPlay, exec, ${pkgs.playerctl}/bin/playerctl play-pause"
", XF86AudioStop, exec, ${pkgs.playerctl}/bin/playerctl stop"
", XF86AudioNext, exec, ${pkgs.playerctl}/bin/playerctl next"
", XF86AudioPrev, exec, ${pkgs.playerctl}/bin/playerctl previous"
", XF86AudioRaiseVolume, exec, ${pkgs.wireplumber}/bin/wpctl set-volume -l 1.0 @DEFAULT_AUDIO_SINK@ 5%+"
", XF86AudioLowerVolume, exec, ${pkgs.wireplumber}/bin/wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%-"
", XF86AudioMute, exec, ${pkgs.wireplumber}/bin/wpctl set-volume @DEFAULT_AUDIO_SINK@ 0%"
]

View file

@ -1,5 +1,10 @@
{ config, lib, ... }: {
programs.hyprlock = lib.mkForce {
{
pkgs,
config,
lib,
...
}: {
programs.hyprlock = {
enable = true;
settings = {
general = {
@ -9,25 +14,29 @@
no_fade_in = false;
};
background = [{
background = [
{
path = "screenshot";
blur_passes = 3;
blur_size = 8;
}];
}
];
input-field = [{
size = "400, 50";
input-field = [
{
size = "200, 50";
position = "0, -80";
monitor = "";
dots_center = true;
fade_on_empty = false;
font_color = "rgb(${config.lib.stylix.colors.base07})";
inner_color = "rgb(${config.lib.stylix.colors.base02})";
outer_color = "rgb(${config.lib.stylix.colors.base03})";
outline_thickness = 1;
placeholder_text = ''<span foreground="##cad3f5">Password...</span>'';
font_color = "rgb(202, 211, 245)";
inner_color = "rgb(91, 96, 120)";
outer_color = "rgb(24, 25, 38)";
outline_thickness = 5;
#placeholder_text = '\'<span foreground="##cad3f5">Password...</span>'\';
shadow_passes = 2;
}];
}
];
};
};
}

View file

@ -1,5 +1,7 @@
{ config
, ...
{
pkgs,
config,
...
}: {
services.hyprpaper = {
enable = true;
@ -8,8 +10,6 @@
splash = false;
preload = [config.myWallPaperPathString];
wallpaper = [",${config.myWallPaperPathString}"];
#preload = [/home/stvnliu/Downloads/mao-zedong.jpg];
#wallpaper = [",/home/stvnliu/Downloads/mao-zedong.jpg"];
};
};
}

View file

@ -0,0 +1,49 @@
{
pkgs,
config,
...
}: {
services.kanshi = {
enable = true;
profiles = {
undocked = {
outputs = [
{
criteria = "eDP-1";
scale = 1.0;
status = "enable";
}
];
};
docked_office_cn = {
outputs = [
{
criteria = "AOC 2619 M1194JA002428";
position = "0,0";
mode = "1920x1200@59.94Hz";
}
{
criteria = "eDP-1";
position = "0,0";
status = "disable";
}
];
};
docked_office_gr = {
outputs = [
{
criteria = "HDMI-A-1";
position = "0,0";
mode = "1920x1080@60.00Hz";
}
{
criteria = "eDP-1";
position = "0,0";
status = "disable";
}
];
};
};
systemdTarget = "hyprland-session.target";
};
}

View file

@ -1,9 +1,10 @@
{ ...
}:
let
defaultTimeoutMillis = 5 * 1000;
in
{
pkgs,
lib,
...
}: let
defaultTimeoutMillis = 5 * 1000;
in {
services.mako = {
enable = true;
defaultTimeout = defaultTimeoutMillis;

View file

@ -1,6 +1,6 @@
{
plugins.auto-save = {
enable = true;
settings.enabled = true;
enableAutoSave = true;
};
}

View file

@ -2,37 +2,31 @@
{
plugins = {
luasnip.enable = true;
/*
copilot-lua = {
enable = true;
suggestion.enabled = false;
panel.enabled = false;
};
*/
cmp = {
enable = true;
settings = {
autoEnableSources = true;
experimental = { ghost_text = false; };
performance = {
debounce = 60;
fetchingTimeout = 200;
maxViewEntries = 30;
};
snippet = { expand = "luasnip"; };
cmp-buffer = {enable = true;};
cmp-emoji = {enable = true;};
cmp-nvim-lsp = {enable = true;};
cmp-path = {enable = true;};
cmp_luasnip = {enable = true;};
/*
cmp = {
enable = true;
settings = {
snippet.expand = ''
function(args)
require('luasnip').lsp_expand(args.body)
end
'';
*/
sources = [
{name = "nvim_lsp";}
{name = "luasnip";}
@ -42,7 +36,9 @@
}
{name = "nvim_lua";}
{name = "path";}
{name = "copilot";}
];
formatting = {
fields = ["abbr" "kind" "menu"];
format =

View file

@ -1,6 +0,0 @@
{
plugins.coq-nvim = {
enable = true;
installArtifacts = true;
};
}

View file

@ -1,8 +0,0 @@
[
{
mode = "n";
key = "<leader>ree";
action = "<CMD>RustLsp explainError<CR>";
options.desc = "Explain this Rust error (custom)";
}
]

View file

@ -1,12 +1,15 @@
{ ... }: {
{
pkgs,
config,
...
}: {
imports = [
./auto-pairs.nix
./autosave.nix
#./bufferline.nix
./bufferline.nix
./cmp.nix
#./coq.nix
./git.nix
#./ionide.nix
./ionide.nix
./lualine.nix
./lsp.nix
./none-ls.nix
@ -20,27 +23,13 @@
./which_key.nix
./wilder.nix
./virt-column.nix
./devicons.nix
./tagbar.nix
./wrapping.nix
./twilight.nix
];
enable = true;
enableMan = true;
defaultEditor = true;
globals.mapleader = " ";
colorschemes.gruvbox = {enable = true;};
performance = {
byteCompileLua.enable = true;
combinePlugins = {
enable = true;
/*standalonePlugins = [
"nvim-treesitter"
];*/
};
};
keymaps =
[
keymaps = [
# Global
# Default mode is "" which means normal-visual-op
{
@ -160,6 +149,5 @@
action = "<CMD>RustStartStandaloneServerForBuffer<CR>";
options.desc = "Start standalone rust-analyzer";
}
]
++ (import ./custom/binds.nix);
];
}

View file

@ -1,3 +0,0 @@
{
plugins.web-devicons.enable = true;
}

View file

@ -1,51 +1,20 @@
{ ... }: {
{
plugins = {
lsp-signature.enable = true;
lsp-status.enable = true;
lsp = {
enable = true;
servers = {
# For Python
pylsp.enable = true;
#pylyzer.enable = true;
#ruff.enable = true;
#ruff_lsp.enable = true;
rust_analyzer = {
enable = true;
installCargo = false;
installRustc = false;
};
# For CXX
clangd.enable = true;
# Misc
bashls.enable = true;
clangd.enable = true;
fsautocomplete.enable = true;
gopls.enable = true;
#nushell.enable = true;
# For Nix
#nil_ls.enable = true;
nixd = {
nil_ls.enable = true;
#nixd.enable = true;
rust-analyzer = {
enable = true;
extraOptions = {
home-manager = {
expr = ''
(builtins.getFlake "/home/stvnliu/nix-conf/").homeConfigurations."stvnliu@nixos-msi".options'';
installRustc = true;
};
};
};
# Haskell
hls = {
enable = true;
installGhc = false;
};
# For TypeScript
ts_ls.enable = true;
tsserver.enable = true;
};
keymaps.lspBuf = {
"gd" = "definition";
@ -55,12 +24,10 @@
"K" = "hover";
};
};
#lsp-lines.enable = true;
#rustaceanvim = {
# enable = true;
# # rust-tools.enable = true;
#};
lsp-lines = {
enable = true;
currentLine = true;
};
rust-tools.enable = true;
};
diagnostics.virtual_lines.only_current_line = true;
}

View file

@ -1,12 +0,0 @@
{
plugins.lspkind = {
enable = true;
symbolMap = {
Copilot = " ";
};
extraOptions = {
maxwidth = 50;
ellipsis_char = "...";
};
};
}

View file

@ -3,7 +3,7 @@
updatetime = 100; # Faster completion
number = true;
relativenumber = true;
relativenumber = false;
autoindent = true;
clipboard = "unnamedplus";

View file

@ -1,22 +0,0 @@
{ pkgs, ... }:
{
dependencies.ctags.package = pkgs.universal-ctags;
plugins.tagbar = {
enable = true;
settings = {
autoclose = false;
autofocus = false;
autoshowtag = true;
foldlevel = 2;
iconchars = [ "" "" ];
position = "right";
visibility_symbols = {
private = "󰛑 ";
protected = "󱗤 ";
public = "󰡭 ";
};
};
};
}

View file

@ -1,11 +1,10 @@
{ pkgs, ... }: {
{
plugins = {
treesitter = {
enable = true;
nixGrammars = true;
nixvimInjections = true; # enables language injection in nixvim
settings.indent.enable = true;
grammarPackages = pkgs.vimPlugins.nvim-treesitter.passthru.allGrammars;
indent = true;
};
treesitter-context.enable = true;
rainbow-delimiters.enable = true;

View file

@ -1,6 +0,0 @@
{ ... }: {
plugins = {
zen-mode = { enable = true; };
twilight = { enable = true; };
};
}

View file

@ -1,6 +0,0 @@
{ ... }:
{
plugins.wrapping = {
enable = true;
};
}

View file

@ -1,13 +0,0 @@
{ ...
}: {
imports = [
./util-programs.nix
./office-programs.nix
./discord.nix
./wayland-utils.nix
./pentesting.nix
./dev.nix
./gaming.nix
./hypr.nix
];
}

View file

@ -1,9 +0,0 @@
{ pkgs
, ...
}: {
home.packages = with pkgs; [
wget
vscodium-fhs
devenv
];
}

View file

@ -1,13 +0,0 @@
{ pkgs
, ...
}: {
home.packages = with pkgs; [ discord vesktop cinny-desktop ];
/*xdg.desktopEntries.discord = {
exec = "${pkgs.vesktop}/bin/vesktop";
terminal = false;
mimeType = [ "x-scheme-handler/discord" ];
name = "Discord - Vesktop";
genericName = "Discord but substituted with Vesktop";
type = "Application";
};*/
}

View file

@ -1,4 +0,0 @@
{ pkgs, ... }:
{
home.packages = with pkgs; [ bottles zeroad ];
}

View file

@ -1,4 +0,0 @@
{ inputs, ... }:
{
home.packages = [ inputs.hyprswitch.packages.x86_64-linux.default ];
}

View file

@ -1,13 +0,0 @@
{ pkgs
, ...
}: {
home.packages = with pkgs; [
libreoffice
kdePackages.okular
evolution
evolution-ews
# proton mail
protonmail-bridge
protonmail-bridge-gui
];
}

View file

@ -1,9 +0,0 @@
{ pkgs
, ...
}: {
home.packages = with pkgs; [
openvpn
inetutils
nmap
];
}

View file

@ -1,21 +0,0 @@
{ pkgs, ... }: {
home.packages = with pkgs; [
bottom
libnotify
tree
android-file-transfer
mtpfs
usbutils
glow
tmux
ranger
lazygit
mmv
cheat
thefuck
pcmanfm
udiskie
sxiv
transmission_4-gtk
];
}

View file

@ -1,4 +0,0 @@
{ pkgs, ... }: {
home.packages = with pkgs; [ vscodium-fhs ];
xdg.desktopEntries.codium = { };
}

View file

@ -1,5 +0,0 @@
{ pkgs
, ...
}: {
home.packages = with pkgs; [ wl-clipboard ];
}

View file

@ -1,10 +0,0 @@
{ ...
}: {
imports = [
./git.nix
./rofi.nix
./tmux.nix
./foot.nix
#./walker.nix
];
}

View file

@ -1,15 +0,0 @@
{ lib
, ...
}: {
programs.foot = {
enable = true;
settings = {
main = {
term = "xterm-256color";
dpi-aware = lib.mkForce "no";
};
mouse = { hide-when-typing = "yes"; };
};
server.enable = true;
};
}

View file

@ -1,13 +0,0 @@
{ pkgs
, config
, ...
}: {
programs.git = {
enable = true;
lfs.enable = true;
package = pkgs.gitFull;
userName = config.myDisplayName;
userEmail = config.myEmail;
extraConfig = import ./git_config.nix;
};
}

View file

@ -1,13 +0,0 @@
{
core.autocrlf = "input";
push = {
autoSetupRemote = true;
followTags = true;
};
commit.gpgsign = true;
#gpg.format = "ssh";
#gpg.ssh.allowedSignersFile = "/home/${config.myUserName}/.ssh/allowed_signers";
#user.signingkey = "/home/${config.myUserName}/.ssh/id_ed25519.pub";
user.signingkey = "DC8F48E7B4C40905";
credential.helper = "libsecret";
}

View file

@ -1,6 +0,0 @@
{ ...
}: {
programs.rofi = {
enable = true;
};
}

View file

@ -1,18 +0,0 @@
{ pkgs
, config
, ...
}: {
programs.tmux = {
enable = true;
shell = config.myShells.defaultShell;
terminal = "screen-256color"; # Fix for apps not recognising full color
mouse = true;
plugins = with pkgs; [
tmuxPlugins.cpu
{
plugin = tmuxPlugins.resurrect;
extraConfig = "set -g @resurrect-strategy-nvim 'session'";
}
];
};
}

View file

@ -1,18 +0,0 @@
{ config
, ...
}: {
programs.walker = {
enable = true;
runAsService = true;
# All options from the config.json can be used here.
config = {
search.placeholder = "Example";
list = { height = 200; };
websearch.prefix = "?";
switcher.prefix = "/";
};
# If this is not set the default styling is used.
};
}

View file

@ -1,16 +1,7 @@
{ config
, pkgs
, ...
{
config,
pkgs,
...
}: {
home.packages = [
(import ./heic-to-jpg.script.nix { inherit pkgs; })
(import ./tmux-default.script.nix {
inherit pkgs;
inherit config;
})
(import ./git-check.script.nix {
inherit pkgs;
inherit config;
})
];
home.packages = [(import ./heic-to-jpg.script.nix {inherit pkgs;})];
}

View file

@ -1,52 +0,0 @@
{ pkgs, config, }:
let
git = config.programs.git.package;
# checks for any Git repositories with uncommitted changes
# used because I am too lazy
in
pkgs.writeShellScriptBin "git-check" ''
#!${pkgs.bash}/bin/bash
cd_err() {
echo "change-directory occurred error. interrupting..."
}
git_check() {
prev=$1
repo_dir=$2
#echo "Checking git-cleanliness at $repo_dir, working in $PWD"
cd "$repo_dir" || return
inside_git_repo="$(${git}/bin/git rev-parse --is-inside-work-tree 2>/dev/null)"
result=256
default_skip=false
if [ "$inside_git_repo" ]; then
if [ "$(${git}/bin/git status --porcelain)" ]; then
result=0
else
result=1
fi
#echo "not a git repository"
fi
if [[ $result -eq 0 ]]; then
echo "DIRTY $PWD"
if $default_skip; then return; fi
read -rp "Enter dirty directory? [y/n/N(skip others)] " userinput
if [[ "$userinput" = "y" ]]; then
${pkgs.lazygit}/bin/lazygit
fi
if [[ "$userinput" = "N" ]]; then
default_skip=true
fi
fi
#echo "going back to $prev"
cd "$prev" || return
}
path=$PWD
scan_path=$PWD
if [ -z "$1" ]; then
scan_path=$PWD
else
scan_path=$1
fi
for item in $(find $scan_path -maxdepth 1 -type d); do
git_check "$path" "$item"
done
''

View file

@ -1,8 +0,0 @@
{ pkgs, }:
let
# browserPath = lib.getExe config.programs.firefox.package;
# dmenuPath = lib.getExe pkgs.wmenu;
in
pkgs.writeShellScriptBin "urlmenu" ''
#!${pkgs.bash}/bin/bash
''

View file

@ -1,19 +0,0 @@
{ pkgs
, config
,
}:
let
tmux = config.programs.tmux.package;
windowName = "code-mode";
in
pkgs.writeShellScriptBin "tmux-code" ''
#!${pkgs.bash}/bin/bash
${tmux}/bin/tmux has-session -t ${windowName} 2>/dev/null
if [ $? != 0 ]; then
# setting up session
${tmux}/bin/tmux new -s ${windowName} -d
${tmux}/bin/tmux send-keys -t ${windowName} 'nvim' Enter
${tmux}/bin/tmux split-window -h
fi
${tmux}/bin/tmux attach -t ${windowName}
''

View file

@ -1,10 +0,0 @@
{ ...
}: {
imports = [
./swaync.nix
./mpd.nix
# DEPRECATED due to switch to KDE
#./waybar.nix
];
}

View file

@ -1,18 +0,0 @@
{ pkgs, config, lib, ... }:
lib.mkIf config.usingMusicPlayerDaemon {
home.packages = [ pkgs.ncmpc ];
services = {
mpd = {
enable = true;
network.listenAddress = "any";
network.port = 6600;
extraConfig = ''
audio_output {
type "pipewire"
name "my pipewire output"
}
'';
};
mpd-mpris = { enable = true; };
};
}

View file

@ -1,6 +0,0 @@
{ ...
}: {
services.swaync = {
enable = true;
};
}

View file

@ -1,8 +0,0 @@
{ ... }: {
programs.waybar = {
enable = true;
systemd = { enable = true; };
style = "${import ./waybar_style.nix { }}";
settings = import ./waybar_config.nix;
};
}

View file

@ -1,117 +0,0 @@
{
mainBar = {
layer = "top";
position = "bottom";
height = 30;
output = [ "eDP-1" "eDP-2" "HDMI-A-1" ];
modules-left = [ "hyprland/workspaces" "hyprland/submap" ];
modules-center = [ "mpd" ];
modules-right =
[ "clock" "group/trays" "group/monitor" "wireplumber" "temperature" ];
"battery" = {
"bat" = "BAT1";
"format" = "BAT {capacity}% @ {power}W";
};
"hyprland/workspaces" = {
disable-scroll = true;
all-outputs = true;
};
"tray" = {
"icon-size" = 18;
"spacing" = 10;
};
"custom/tray-label" = { "format" = "[TRAY]"; };
"custom/monitor-label" = { "format" = "[HW]"; };
"group/trays" = {
"orientation" = "inherit";
"modules" = [ "custom/tray-label" "tray" ];
"drawer" = { "click-to-reveal" = true; };
};
"group/monitor" = {
"orientation" = "inherit";
"modules" = [ "custom/monitor-label" "battery" "cpu" "memory" ];
"drawer" = { "click-to-reveal" = true; };
};
"mpd" = {
"artist-len" = 10;
"album-len" = 10;
"title-len" = 20;
"format" =
"{stateIcon} {consumeIcon}{randomIcon}{repeatIcon}{singleIcon}{artist} - {album} - {title} ({elapsedTime:%M:%S}/{totalTime:%M:%S}) ";
"format-disconnected" = "Disconnected ";
"format-stopped" =
"{consumeIcon}{randomIcon}{repeatIcon}{singleIcon}Stopped ";
"interval" = 10;
"consume-icons" = {
"on" = " "; # Icon shows only when "consume" is on
};
"random-icons" = {
"off" = ''
<span color="#f53c3c"></span> ''; # Icon grayed out when "random" is off
"on" = " ";
};
"repeat-icons" = { "on" = " "; };
"single-icons" = { "on" = " 1 "; };
"state-icons" = {
"paused" = "";
"playing" = "";
};
"tooltip-format" = "MPD (connected)";
"tooltip-format-disconnected" = "MPD (disconnected)";
};
"wireplumber" = {
"format" = "{volume}% {icon}";
"format-muted" = "";
"format-icons" = [ "" "" "" ];
};
"cpu" = {
"format" = "CPU {icon}";
"format-icons" = [
"<span color='#69ff94'></span>" # green
"<span color='#2aa9ff'></span>" # blue
"<span color='#f8f8f2'></span>" # white
"<span color='#f8f8f2'></span>" # white
"<span color='#ffffa5'></span>" # yellow
"<span color='#ffffa5'></span>" # yellow
"<span color='#ff9977'></span>" # orange
"<span color='#dd532e'></span>" # red
];
"memory" = { "format" = "MEM {percentage}%"; };
};
"clock" = {
"format" = "{:%H:%M} ";
"format-alt" = "{:%A, %B %d, %Y (%R)}";
"tooltip-format" = "<tt><small>{calendar}</small></tt>";
"calendar" = {
"mode" = "year";
"mode-mon-col" = 3;
"weeks-pos" = "right";
"on-scroll" = 1;
"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>";
};
};
/* "actions" = {
"on-click-right" = "mode";
"on-scroll-up" = "tz_up";
"on-scroll-down" = "tz_down";
"on-scroll-up" = "shift_up";
"on-scroll-down" = "shift_down";
};
*/
};
/* "custom/hello-from-waybar" = {
format = "hello {}";
max-length = 40;
interval = "once";
exec = pkgs.writeShellScript "hello-from-waybar" ''
echo "from within waybar"
'';
};
*/
};
}

View file

@ -1,4 +0,0 @@
{ ... }: ''
* {
font-family: JetBrainsMono Nerd Font;
}''

View file

@ -1,14 +1,10 @@
{pkgs}: {
gil = "${pkgs.lazygit}/bin/lazygit";
cd = "z";
cdi = "zi";
ls = "${pkgs.eza}/bin/exa";
cat = "${pkgs.bat}/bin/bat";
ls = "${pkgs.lsd}/bin/lsd";
ll = "ls -l";
rm = "${pkgs.trash-cli}/bin/trash";
osupdate = "${pkgs.nh}/bin/nh os switch";
homeupdate = "${pkgs.nh}/bin/nh home switch";
batmon = "watch -n0 upower -i /org/freedesktop/UPower/devices/battery_BAT1";
inception = "${pkgs.pipx}/bin/pipx run copier copy --trust gh:DataChefHQ/Inception .";
help = "echo \"No help for u lololololololol\"";
}

View file

@ -1,12 +1,15 @@
{ lib
, config
, ...
}:
{
pkgs,
lib,
config,
...
}: let
cfg = config.myShells;
in
with lib; {
imports = [
./zsh.nix
./fish
./nushell
./zoxide.nix
./direnv.nix
./starship
@ -20,8 +23,7 @@ with lib; {
myShells = {
zsh.enable = false;
fish.enable = true;
#nushell.enable = true;
defaultShell = "${config.programs.fish.package}/bin/fish";
defaultShell = "fish";
prompts.starship.enable = true;
};
};

View file

@ -1,4 +0,0 @@
{ ...
}: {
EDITOR = "nvim";
}

View file

@ -1,9 +1,9 @@
{ pkgs
, config
, lib
, ...
}:
let
{
pkgs,
config,
lib,
...
}: let
cfg = config.myShells.fish;
in
with lib; {
@ -17,13 +17,10 @@ with lib; {
${builtins.readFile ./init/zoxide.fish}
${builtins.readFile ./init/nh.fish}
${builtins.readFile ./init/tailscale.fish}
${builtins.readFile ./init/pass.fish}
function fish_greeting
${(pkgs.fortune.override {withOffensive = true;})}/bin/fortune -as | ${pkgs.cowsay}/bin/cowsay | ${pkgs.lolcat}/bin/lolcat
${pkgs.fortune}/bin/fortune -a
end
funcsave -q fish_greeting
${pkgs.thefuck}/bin/thefuck --alias | source
'';
shellAliases = import ../aliases {inherit pkgs;};
plugins = with pkgs.fishPlugins; [

View file

@ -1,116 +0,0 @@
# Copyright (C) 2012-2014 Dmitry Medvinsky <me@dmedvinsky.name>. All Rights Reserved.
# This file is licensed under the GPLv2+. Please see COPYING for more information.
set -l PROG 'pass'
function __fish_pass_get_prefix
if set -q PASSWORD_STORE_DIR
realpath -- "$PASSWORD_STORE_DIR"
else
echo "$HOME/.password-store"
end
end
function __fish_pass_needs_command
[ (count (commandline -opc)) -eq 1 ]
end
function __fish_pass_uses_command
set -l cmd (commandline -opc)
if [ (count $cmd) -gt 1 ]
if [ $argv[1] = $cmd[2] ]
return 0
end
end
return 1
end
function __fish_pass_print_gpg_keys
gpg2 --list-keys | grep uid | sed 's/.*<\(.*\)>/\1/'
end
function __fish_pass_print
set -l ext $argv[1]
set -l strip $argv[2]
set -l prefix (__fish_pass_get_prefix)
set -l matches $prefix/**$ext
printf '%s\n' $matches | sed "s#$prefix/\(.*\)$strip#\1#"
end
function __fish_pass_print_entry_dirs
__fish_pass_print "/"
end
function __fish_pass_print_entries
__fish_pass_print ".gpg" ".gpg"
end
function __fish_pass_print_entries_and_dirs
__fish_pass_print_entry_dirs
__fish_pass_print_entries
end
function __fish_pass_git_complete
set -l prefix (__fish_pass_get_prefix)
set -l git_cmd (commandline -opc) (commandline -ct)
set -e git_cmd[1 2] # Drop "pass git".
complete -C"git -C $prefix $git_cmd"
end
complete -c $PROG -f -n '__fish_pass_needs_command' -a help -d 'Command: show usage help'
complete -c $PROG -f -n '__fish_pass_needs_command' -a version -d 'Command: show program version'
complete -c $PROG -f -n '__fish_pass_needs_command' -a init -d 'Command: initialize new password storage'
complete -c $PROG -f -n '__fish_pass_uses_command init' -s p -l path -d 'Assign gpg-id for specified sub folder of password store'
complete -c $PROG -f -n '__fish_pass_needs_command' -a ls -d 'Command: list passwords'
complete -c $PROG -f -n '__fish_pass_uses_command ls' -a "(__fish_pass_print_entry_dirs)"
complete -c $PROG -f -n '__fish_pass_needs_command' -a insert -d 'Command: insert new password'
complete -c $PROG -f -n '__fish_pass_uses_command insert' -s e -l echo -d 'Echo the password on console'
complete -c $PROG -f -n '__fish_pass_uses_command insert' -s m -l multiline -d 'Provide multiline password entry'
complete -c $PROG -f -n '__fish_pass_uses_command insert' -s f -l force -d 'Do not prompt before overwritting'
complete -c $PROG -f -n '__fish_pass_uses_command insert' -a "(__fish_pass_print_entry_dirs)"
complete -c $PROG -f -n '__fish_pass_needs_command' -a generate -d 'Command: generate new password'
complete -c $PROG -f -n '__fish_pass_uses_command generate' -s n -l no-symbols -d 'Do not use special symbols'
complete -c $PROG -f -n '__fish_pass_uses_command generate' -s c -l clip -d 'Put the password in clipboard'
complete -c $PROG -f -n '__fish_pass_uses_command generate' -s f -l force -d 'Do not prompt before overwritting'
complete -c $PROG -f -n '__fish_pass_uses_command generate' -s i -l in-place -d 'Replace only the first line with the generated password'
complete -c $PROG -f -n '__fish_pass_uses_command generate' -a "(__fish_pass_print_entry_dirs)"
complete -c $PROG -f -n '__fish_pass_needs_command' -a mv -d 'Command: rename existing password'
complete -c $PROG -f -n '__fish_pass_uses_command mv' -s f -l force -d 'Force rename'
complete -c $PROG -f -n '__fish_pass_uses_command mv' -a "(__fish_pass_print_entries_and_dirs)"
complete -c $PROG -f -n '__fish_pass_needs_command' -a cp -d 'Command: copy existing password'
complete -c $PROG -f -n '__fish_pass_uses_command cp' -s f -l force -d 'Force copy'
complete -c $PROG -f -n '__fish_pass_uses_command cp' -a "(__fish_pass_print_entries_and_dirs)"
complete -c $PROG -f -n '__fish_pass_needs_command' -a rm -d 'Command: remove existing password'
complete -c $PROG -f -n '__fish_pass_uses_command rm' -s r -l recursive -d 'Remove password groups recursively'
complete -c $PROG -f -n '__fish_pass_uses_command rm' -s f -l force -d 'Force removal'
complete -c $PROG -f -n '__fish_pass_uses_command rm' -a "(__fish_pass_print_entries_and_dirs)"
complete -c $PROG -f -n '__fish_pass_needs_command' -a edit -d 'Command: edit password using text editor'
complete -c $PROG -f -n '__fish_pass_uses_command edit' -a "(__fish_pass_print_entries)"
complete -c $PROG -f -n '__fish_pass_needs_command' -a show -d 'Command: show existing password'
complete -c $PROG -f -n '__fish_pass_uses_command show' -s c -l clip -d 'Put password in clipboard'
complete -c $PROG -f -n '__fish_pass_uses_command show' -a "(__fish_pass_print_entries)"
# When no command is given, `show` is defaulted.
complete -c $PROG -f -n '__fish_pass_needs_command' -s c -l clip -d 'Put password in clipboard'
complete -c $PROG -f -n '__fish_pass_needs_command' -a "(__fish_pass_print_entries)"
complete -c $PROG -f -n '__fish_pass_uses_command -c' -a "(__fish_pass_print_entries)"
complete -c $PROG -f -n '__fish_pass_uses_command --clip' -a "(__fish_pass_print_entries)"
complete -c $PROG -f -n '__fish_pass_needs_command' -a git -d 'Command: execute a git command'
complete -c $PROG -f -n '__fish_pass_uses_command git' -a '(__fish_pass_git_complete)'
complete -c $PROG -f -n '__fish_pass_needs_command' -a find -d 'Command: find a password file or directory matching pattern'
complete -c $PROG -f -n '__fish_pass_needs_command' -a grep -d 'Command: search inside of decrypted password files for matching pattern'
complete -c $PROG -f -n '__fish_pass_uses_command grep' -a '(begin
set -l cmd (commandline -opc) (commandline -ct)
set -e cmd[1 2] # Drop "pass grep".
complete -C"grep $cmd"
end)'

View file

@ -1,26 +0,0 @@
{ pkgs
, config
, lib
, ...
}:
let
cfg = config.myShells.nushell;
in
with lib; {
options = {
myShells.nushell = { enable = mkEnableOption "Enables nushell config"; };
};
config = mkIf cfg.enable {
programs = {
nushell = {
enable = true;
configFile.source = ./init/config.nu;
shellAliases = import ../aliases/default.nix { inherit pkgs; };
};
carapace = {
enable = true;
enableNushellIntegration = true;
};
};
};
}

View file

@ -1,15 +0,0 @@
$env.config = {
show_banner: false,
hooks: {
pre_prompt: [{ ||
if (which direnv | is-empty) {
return
}
direnv export json | from json | default {} | load-env
if 'ENV_CONVERSIONS' in $env and 'PATH' in $env.ENV_CONVERSIONS {
$env.PATH = do $env.ENV_CONVERSIONS.PATH.from_string $env.PATH
}
}]
}
}

View file

@ -1,8 +1,9 @@
{ lib
, config
, ...
}:
let
{
lib,
pkgs,
config,
...
}: let
cfg = config.myShells.prompts.starship;
in
with lib; {
@ -14,12 +15,10 @@ with lib; {
};
};
config = mkIf cfg.enable {
myShells.prompts.starship.confPath = ./presets/pure-direnv.toml;
programs.starship = {
enable = true;
enableZshIntegration = config.myShells.zsh.enable;
enableFishIntegration = config.myShells.fish.enable;
enableNushellIntegration = config.myShells.nushell.enable;
settings = builtins.fromTOML (builtins.readFile cfg.confPath);
};
};

View file

@ -1,56 +0,0 @@
format = """
${direnv}\
$username\
$hostname\
$directory\
$git_branch\
$git_state\
$git_status\
$cmd_duration\
$line_break\
$python\
$character"""
[direnv]
disabled = false
#command = '[[ $(direnv status) =~ "Found RC allowed false" ]] && echo "=========> missing: direnv allow <============"' # shows output of command
detect_files = ['.envrc'] # can specify filters but wildcards are not supported
[directory]
style = "blue"
truncate_to_repo = false
truncation_length = 8
truncation_symbol = ".../"
[character]
success_symbol = "[](purple)"
error_symbol = "[](red)"
vimcmd_symbol = "[](green)"
[git_branch]
format = "[$branch]($style)"
style = "bright-black"
[git_status]
format = "[[(*$conflicted$untracked$modified$staged$renamed$deleted)](218) ($ahead_behind$stashed)]($style)"
style = "cyan"
conflicted = "!"
untracked = "U"
modified = "*"
staged = "+"
renamed = "R"
deleted = "-"
stashed = "≡"
[git_state]
format = '\([$state( $progress_current/$progress_total)]($style)\) '
style = "bright-black"
[cmd_duration]
format = "[$duration]($style) "
style = "yellow"
[python]
format = "[$virtualenv]($style) "
style = "bright-black"

View file

@ -1,5 +1,8 @@
{ config
, ...
{
pkgs,
config,
lib,
...
}: {
programs.zoxide = {
enable = true;

View file

@ -1,8 +1,11 @@
{ pkgs
, lib
, config
, ...
}:
{
pkgs,
lib,
config,
...
}: let
cfg = config.shell.zsh;
in
with lib; {
options.myShells.zsh = {
enable = mkEnableOption "Enables zsh and components.";

View file

@ -0,0 +1,26 @@
{
pkgs,
lib,
inputs,
...
}: let
spicePkgs = inputs.spicetify-nix.legacyPackages.${pkgs.system};
in {
# allow spotify to be installed if you don't have unfree enabled already
nixpkgs.config.allowUnfreePredicate = pkg:
builtins.elem (lib.getName pkg) [
"spotify"
];
programs.spicetify = {
enable = true;
theme = spicePkgs.themes.onepunch;
colorScheme = "Dark";
enabledExtensions = with spicePkgs.extensions; [
adblock
fullAppDisplay
shuffle # shuffle+ (special characters are sanitized out of ext names)
hidePodcasts
];
};
}

View file

@ -1,35 +1,17 @@
{ pkgs
, config
, ...
}:
let
globalOpacity = 0.75;
in
{
{pkgs, ...}: {
stylix = {
enable = true;
autoEnable = true;
base16Scheme = "${pkgs.base16-schemes}/share/themes/onedark-dark.yaml";
image = config.myWallPaperPath;
base16Scheme = "${pkgs.base16-schemes}/share/themes/gruvbox-dark-medium.yaml";
image = ./assets/nixos-wallpaper.jpg;
fonts = {
/*sansSerif = {
name = "Helvetica Neue LT Std";
package = pkgs.helvetica-neue-lt-std;
};*/
sansSerif = {
name = "Aileron";
package = pkgs.aileron;
};
monospace = {
name = config.desktopFont.fullName;
package = config.desktopFont.package;
name = "BlexMono Nerd Font";
package = pkgs.nerdfonts.override {fonts = ["IBMPlexMono"];};
};
sizes = {
terminal = 16;
applications = 12;
};
};
opacity = {
applications = globalOpacity;
desktop = globalOpacity;
popups = globalOpacity;
terminal = globalOpacity;
};
};
}

View file

@ -0,0 +1,13 @@
{
pkgs,
lib,
...
}: {
wayland.windowManager.sway = {
enable = true;
config = rec {
modifier = "Mod4";
terminal = "${pkgs.foot}/bin/foot -f 'BlexMono Nerd Font:size=24' zsh";
};
};
}

View file

@ -0,0 +1,20 @@
{
pkgs,
config,
lib,
...
}: {
options = with lib;
with types; {
myWallPaperPathString = mkOption {type = str;};
myUserName = mkOption {type = str;};
myDisplayName = mkOption {type = str;};
myEmail = mkOption {type = str;};
};
config = rec {
myUserName = "stvnliu";
myWallPaperPathString = "/home/${config.myUserName}/wallpaper.png";
myDisplayName = "Zhongheng Liu";
myEmail = "z.liu@outlook.com.gr";
};
}

View file

@ -3,6 +3,6 @@
"openssl-1.1.1w"
];
home.packages = with pkgs; [
wechat-uos
(wechat-uos.override {uosLicense = ./license.tar.gz;})
];
}

Binary file not shown.

View file

@ -1,7 +1,6 @@
{ ... }: {
{pkgs, ...}: {
xdg = {
enable = true;
userDirs.enable = true;
mimeApps = {
enable = true;
defaultApplications = {

5
nixos/ags.nix Normal file
View file

@ -0,0 +1,5 @@
{pkgs, ...}: {
environment.systemPackages = [
pkgs.ags
];
}

View file

@ -1,97 +0,0 @@
{ pkgs
, ...
}:
let
xenlism-grub-themes = pkgs.stdenv.mkDerivation {
pname = "xenlism-grub-themes";
version = "1.0";
src = pkgs.fetchFromGitHub {
owner = "xenlism";
repo = "Grub-themes";
rev = "40ac048df9aacfc053c515b97fcd24af1a06762f";
hash = "sha256-ProTKsFocIxWAFbYgQ46A+GVZ7mUHXxZrvdiPJqZJ6I=";
};
installPhase = "cp -r xenlism-grub-1080p-nixos/Xenlism-Nixos $out";
};
in
{
environment.systemPackages = with pkgs; [ hack-font ];
#fileSystems."/mnt/winsys" = {
# device = "/dev/nvme0n1p5";
# fsType = "ntfs-3g";
# options = [ "rw" "uid=1000" ];
#};
#fileSystems."/mnt/windata" = {
# device = "/dev/nvme0n1p3";
# fsType = "ntfs-3g";
# options = [ "rw" "uid=1000" ];
#};
boot = {
/*plymouth = {
enable = true;
theme = "rings";
themePackages = with pkgs; [
# By default we would install all themes
(adi1090x-plymouth-themes.override { selected_themes = [ "rings" ]; })
];
};*/
# Enable "Silent Boot"
consoleLogLevel = 0;
initrd.verbose = false;
kernelParams = [
"quiet"
"splash"
"boot.shell_on_fail"
"loglevel=3"
"rd.systemd.show_status=false"
"rd.udev.log_level=3"
"udev.log_priority=3"
];
# Hide the OS choice for bootloaders.
# It's still possible to open the bootloader list by pressing any key
# It will just not appear on screen unless a key is pressed
supportedFilesystems = [ "ntfs" ];
loader = {
#timeout = 0;
efi = { canTouchEfiVariables = true; };
grub = {
enable = true;
efiSupport = true;
device = "nodev";
fsIdentifier = "label";
devices = [ "nodev" ];
extraConfig = ''
function load_video {
if [ x$feature_all_video_module = xy ]; then
insmod all_video
else
insmod efi_gop
insmod efi_uga
insmod ieee1275_fb
insmod vbe
insmod vga
insmod video_bochs
insmod video_cirrus
fi
}'';
extraEntries = ''
menuentry "UEFI Firmware Settings" {
fwsetup
}
menuentry "Reboot" {
reboot
}
menuentry "Poweroff" {
halt
}
'';
useOSProber = true;
configurationLimit = 10;
fontSize = 32;
theme = xenlism-grub-themes;
};
};
};
}

View file

@ -1,64 +1,30 @@
# This is your system's configuration file.
# Use this to configure your system environment (it replaces /etc/nixos/configuration.nix)
{ inputs, lib, config, pkgs, ... }: {
{
inputs,
lib,
config,
pkgs,
...
}: {
imports = [
../common/variables.nix
./greetd.nix
./bootloader.nix
./grub.nix
./nvidia.nix
./fonts.nix
./services/laptop.preset.nix
./virtualisation.nix
#./dwm
#./spec.nix
./hardware-configuration.nix
#./custom-hosts.nix
];
# Virtual cam settings: see https://wiki.nixos.org/wiki/OBS_Studio#Using_the_Virtual_Camera
environment.sessionVariables = {
environment.variables = {
GDK_SCALE = config.displayScale;
FLAKE = config.myConfigLocation;
MANPAGER = "nvim +Man!";
NVD_BACKEND = "direct";
NIXOS_OZONE_WL = "1";
# GTK_IM_MODULE = lib.mkForce "";
};
/* services.jellyfin = {
enable = true;
openFirewall = true;
};
*/
services.displayManager.sddm.enable = true;
services.displayManager.sddm.wayland.enable = true;
services.desktopManager.plasma6.enable = true;
services.keyd = {
enable = true;
keyboards = {
default = {
ids = [ "*" ];
settings = {
main = {
capslock = "esc";
esc = "capslock";
};
};
extraConfig = "";
};
};
};
programs.gnupg.agent = {
enable = true;
pinentryPackage = pkgs.pinentry-gnome3;
enableSSHSupport = true;
};
programs.gamescope = {
enable = true;
capSysNice = true;
GTK_IM_MODULE = lib.mkForce "";
};
security.pam.services.hyprlock = {};
i18n.inputMethod = {
type = "fcitx5";
enable = true;
enabled = "fcitx5";
fcitx5.addons = with pkgs; [
fcitx5-mozc
fcitx5-gtk
@ -68,24 +34,26 @@
#enabled = "ibus";
#ibus.engines = with pkgs.ibus-engines; [rime];
};
#programs.hyprland = { enable = true; };
hardware.bluetooth = {
enable = true;
powerOnBoot = true;
settings = { General = { Disable = "Handsfree,Headset"; }; };
};
#specialisation = {
# in-china.configuration = {
# networking.proxy = {
# default = "http://127.0.0.1:7897/";
# noProxy = "127.0.0.1,localhost,internal.domain";
# };
# };
#};
specialisation = {
in-china.configuration = {
networking.proxy = {
default = "http://127.0.0.1:7897/";
noProxy = "127.0.0.1,localhost,internal.domain";
};
};
};
xdg.portal = {
enable = true;
extraPortals = with pkgs; [ xdg-desktop-portal-gtk ];
config = { common.default = [ "gtk" ]; };
extraPortals = with pkgs; [
xdg-desktop-portal-gtk
];
config = {
common.default = ["gtk"];
};
};
systemd.user.services.mpris-proxy = {
description = "Mpris proxy";
@ -93,8 +61,7 @@
wantedBy = ["default.target"];
serviceConfig.ExecStart = "${pkgs.bluez}/bin/mpris-proxy";
};
programs = {
steam = {
programs.steam = {
enable = true;
remotePlay.openFirewall =
true; # Open ports in the firewall for Steam Remote Play
@ -102,43 +69,20 @@
true; # Open ports in the firewall for Source Dedicated Server
localNetworkGameTransfers.openFirewall =
true; # Open ports in the firewall for Steam Local Network Game Transfers
extraCompatPackages = with pkgs; [ proton-ge-bin ];
};
gamemode.enable = true;
};
boot = {
extraModulePackages = with config.boot.kernelPackages; [ v4l2loopback ];
extraModprobeConfig = ''
options v4l2loopback devices=1 video_nr=1 card_label="OBS Cam" exclusive_caps=1
'';
kernelPackages = pkgs.linuxPackages_zen;
supportedFilesystems = ["ntfs"];
};
documentation = {
enable = true;
dev.enable = true;
doc.enable = true;
man.enable = true;
};
security.polkit.enable = true;
environment.systemPackages = with pkgs; [
man-pages-posix
man-pages
(pass-wayland.withExtensions (exts: [ exts.pass-otp exts.pass-import ]))
gparted
zed-editor
libsForQt5.qt5.qtquickcontrols2
libsForQt5.qt5.qtgraphicaleffects
/* (blender.override {
cudaSupport = true;
})
*/
trash-cli
#inputs.hyprswitch.packages.x86_64-linux.default
];
# turned off because timedatectl doesn't like it
time.hardwareClockInLocalTime = false;
time.timeZone = "Asia/Shanghai";
time.timeZone = "Europe/Athens";
services = {
#displayManager.sddm = {
# enable = true;
@ -146,8 +90,6 @@
# theme = "${import ./sddm-theme.nix {inherit pkgs;}}";
#};
#automatic-timezoned.enable = true;
pcscd.enable = true;
openssh = {
enable = true;
settings = {
@ -162,52 +104,36 @@
# enable = true;
# wrapperFeatures.gtk = true;
#};
programs.hyprland.enable = true; # enables Hyprland DM.
nixpkgs = {
overlays = [];
config = {
cudaSupport = true;
allowUnfree = true;
permittedInsecurePackages = [ "dotnet-core-combined" ];
};
config = {allowUnfree = true;};
};
nix =
let flakeInputs = lib.filterAttrs (_: lib.isType "flake") inputs;
nix = let
flakeInputs = lib.filterAttrs (_: lib.isType "flake") inputs;
in {
settings = {
experimental-features = "nix-command flakes";
# flake-registry = "";
flake-registry = "";
nix-path = config.nix.nixPath;
};
extraOptions = ''
trusted-users = root stvnliu
'';
channel.enable = false;
registry = lib.mapAttrs (_: flake: {inherit flake;}) flakeInputs;
nixPath = lib.mapAttrsToList (n: _: "${n}=flake:${n}") flakeInputs;
};
systemd.network.wait-online.enable = false;
networking = {
hostName = "${config.myHostName}";
networkmanager.enable = true;
useNetworkd = lib.mkDefault true;
useDHCP = lib.mkDefault true;
};
users.users = {
"${config.myUserName}" = {
initialPassword = "stevenpassword";
isNormalUser = true;
openssh.authorizedKeys.keys = [];
packages = with pkgs; [ nh ];
packages = with pkgs; [nh gparted];
extraGroups = ["wheel" "input" "networkmanager"];
};
"xi_jinping" = {
initialPassword = "bingchilling";
isNormalUser = true;
packages = with pkgs; [ git ];
extraGroups = [ "input" ];
};
};
# https://nixos.wiki/wiki/FAQ/When_do_I_update_stateVersion
system.stateVersion = "24.05";

View file

@ -1,20 +0,0 @@
{ ...
}:
let
rootDomainName = "stvnliu.me";
subdomains = [
"git"
"kellnr"
"www"
"blog"
"files"
"code"
"chat"
];
in
{
networking.extraHosts = ''
# home IP mapping
192.168.1.100 ${rootDomainName} ${builtins.concatStringsSep " " (map (x: x + "." + rootDomainName) subdomains)}
'';
}

View file

@ -1,26 +0,0 @@
# /etc/nixos/configuration.nix
{ config, pkgs, ... }:
{
# Virtual cam settings: see https://wiki.nixos.org/wiki/OBS_Studio#Using_the_Virtual_Camera
boot.extraModulePackages = with config.boot.kernelPackages; [
v4l2loopback
];
boot.extraModprobeConfig = ''
options v4l2loopback devices=1 video_nr=1 card_label="OBS Cam" exclusive_caps=1
'';
security.polkit.enable = true;
# Install OBS Studio with droidcam-obs
users.users.foo = {
packages = with pkgs; [
# ...
(wrapOBS {
plugins = with obs-studio-plugins; [
droidcam-obs
];
})
# ...
];
};
}

View file

@ -1,22 +0,0 @@
{ pkgs, }: {
#options = {
#dwm.enable = lib.mkEnableOption "Enables dwm.";
#};
environment.systemPackages = with pkgs; [ st dmenu slstatus pamixer ];
programs.dconf.enable = true;
services.xserver = {
enable = true;
windowManager = {
dwm = {
enable = true;
package = pkgs.dwm.override {
patches = [
./patches/config-20240325.diff
./patches/dwm-flextile-20210722-138b405.diff
./patches/dwm-systray-6.4.diff
];
};
};
};
};
}

View file

@ -1,100 +0,0 @@
diff --git a/config.def.h b/config.def.h
index 1c0b587..8595a71 100644
--- a/config.def.h
+++ b/config.def.h
@@ -49,7 +49,10 @@ static const Layout layouts[] = {
{ MODKEY, KEY, view, {.ui = 1 << TAG} }, \
{ MODKEY|ControlMask, KEY, toggleview, {.ui = 1 << TAG} }, \
{ MODKEY|ShiftMask, KEY, tag, {.ui = 1 << TAG} }, \
- { MODKEY|ControlMask|ShiftMask, KEY, toggletag, {.ui = 1 << TAG} },
+ { MODKEY|ControlMask|ShiftMask, KEY, toggletag, {.ui = 1 << TAG} }, \
+ { ALTMOD, KEY, focusnthmon, {.i = TAG } }, \
+ { ALTMOD|ShiftMask, KEY, tagnthmon, {.i = TAG } },
+
/* helper for spawning shell commands in the pre dwm-5.0 fashion */
#define SHCMD(cmd) { .v = (const char*[]){ "/bin/sh", "-c", cmd, NULL } }
diff --git a/dwm.c b/dwm.c
index b0b3466..96fa0bd 100644
--- a/dwm.c
+++ b/dwm.c
@@ -161,6 +161,7 @@ static void destroynotify(XEvent *e);
static void detach(Client *c);
static void detachstack(Client *c);
static Monitor *dirtomon(int dir);
+static Monitor *numtomon(int num);
static void drawbar(Monitor *m);
static void drawbars(void);
static void enternotify(XEvent *e);
@@ -168,6 +169,7 @@ static void expose(XEvent *e);
static void focus(Client *c);
static void focusin(XEvent *e);
static void focusmon(const Arg *arg);
+static void focusnthmon(const Arg *arg);
static void focusstack(const Arg *arg);
static Atom getatomprop(Client *c, Atom prop);
static int getrootptr(int *x, int *y);
@@ -209,6 +211,7 @@ static void sigchld(int unused);
static void spawn(const Arg *arg);
static void tag(const Arg *arg);
static void tagmon(const Arg *arg);
+static void tagnthmon(const Arg *arg);
static void tile(Monitor *);
static void togglebar(const Arg *arg);
static void togglefloating(const Arg *arg);
@@ -693,6 +696,18 @@ dirtomon(int dir)
return m;
}
+Monitor *
+numtomon(int num)
+{
+ Monitor *m = NULL;
+ int i = 0;
+
+ for(m = mons, i=0; m->next && i < num; m = m->next){
+ i++;
+ }
+ return m;
+}
+
void
drawbar(Monitor *m)
{
@@ -830,6 +845,21 @@ focusmon(const Arg *arg)
focus(NULL);
}
+void
+focusnthmon(const Arg *arg)
+{
+ Monitor *m;
+
+ if (!mons->next)
+ return;
+
+ if ((m = numtomon(arg->i)) == selmon)
+ return;
+ unfocus(selmon->sel, 0);
+ selmon = m;
+ focus(NULL);
+}
+
void
focusstack(const Arg *arg)
{
@@ -1671,6 +1701,14 @@ tagmon(const Arg *arg)
sendmon(selmon->sel, dirtomon(arg->i));
}
+void
+tagnthmon(const Arg *arg)
+{
+ if (!selmon->sel || !mons->next)
+ return;
+ sendmon(selmon->sel, numtomon(arg->i));
+}
+
void
tile(Monitor *m)
{

Some files were not shown because too many files have changed in this diff Show more