refactor!: restructure and document configuration

This commit is contained in:
Alexandre Cavalheiro S. Tiago da Silva 2025-03-06 05:30:47 -03:00
parent 4a02e072a7
commit f87f9995be
Signed by: wizardlink
GPG key ID: A5767B54367CFBDF
126 changed files with 957 additions and 590 deletions

67
README.md Normal file
View file

@ -0,0 +1,67 @@
# linuxware
This repository contains the configuration of my main Linux based system(s), currently this repository consist of a
[NixOS] system configuration alongside [dotfiles] generated by [Home Manager] and [dotfiles] maintained by me.
## Navigation guide
In this section I will detail how you can navigate and make the most use out of my configuration.
### File structure
- [`flake.nix` & `flake.lock`](#flake)
- _This is the "entry-point" of the [NixOS] configuration._
- [`hosts/`](/hosts/)
- _Inside you can find the per-system customizations I've made._
- [`modules/`](/modules/)
- _These contain the modules I export in the [flake](#flake)._
- [`packages/`](/packages/)
- _Encompasses the packages I maintain outside or in tandem with [nixpkgs]._
- [`shared/`](/shared/)
- _The [NixOS] and [Home Manager] configuration that's shared across hosts._
- [`assets/`](/assets/)
- _All media used in this configuration or shown inside READMEs._
> _Be sure to click the hyperlinks for the relevant documentation._
#### Flake
A flake basically contains what you want to consume in your environment and what you want to export to be consumed, on
top of having a lockfile to pin the versions of what you are consuming.
Personally, the best way to learn how to use it as a beginner is the [Unofficial NixOS & Flakes
Book](https://nixos-and-flakes.thiscute.world/). I will not explain how to configure or use my flake as that would be
lenghty.
I export four modules that you can use in your configuration:
- [Hyprland NixOS configuration](/modules/hyprland/README.md)
- _Accessed through `<linuxware>.nixosModules.hyprland`._
- [Hyprland home-manager configuration](/modules/hyprland/README.md#configuration)
- _Accessed through `<linuxware>.homeManagerModules.hyprland`._
- [Emacs home-manager configuration & dotfiles](/modules/emacs/README.md)
- _Accessed through `<linuxware>.homeManagerModules.emacs`_
- [Neovim home-manager configuration & dotfiles](/modules/neovim/README.md)
- _Accessed through `<linuxware>.homeManagerModules.neovim`._
> _Be sure to click the hyperlinks for the relevant documentation._
To facilitate on-boarding, once you've set-up the experimental features needed for flakes I have provided a template
with this repository for you to use; it comes with a [NixOS] system configuration, [Home Manager] configuration
alongside the modules that I provide.
All you have to do is enter the directory you want your configuration to reside and execute
`nix flake init -t github:wizardlink/linuxware`. Be sure to read the `README.md` file!
## Desktop screenshot
![image](/assets/screenshots/full-system.png)
> _All screenshots of the system and it's components are available [here](/assets/README.md)._
<!-- REFERENCES -->
[dotfiles]: https://wiki.archlinux.org/title/Dotfiles
[home manager]: https://github.com/nix-community/home-manager
[nixos]: https://nixos.org/
[nixpkgs]: https://github.com/NixOS/nixpkgs/

Binary file not shown.

After

Width:  |  Height:  |  Size: 124 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 399 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.1 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

View file

Before

Width:  |  Height:  |  Size: 1.5 MiB

After

Width:  |  Height:  |  Size: 1.5 MiB

View file

Before

Width:  |  Height:  |  Size: 1.6 MiB

After

Width:  |  Height:  |  Size: 1.6 MiB

View file

Before

Width:  |  Height:  |  Size: 1.7 MiB

After

Width:  |  Height:  |  Size: 1.7 MiB

BIN
assets/screenshots/rofi.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 46 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 102 KiB

View file

Before

Width:  |  Height:  |  Size: 4.8 MiB

After

Width:  |  Height:  |  Size: 4.8 MiB

View file

@ -8,7 +8,6 @@
url = "github:nix-community/home-manager";
inputs.nixpkgs.follows = "nixpkgs";
};
spicetify-nix = {
url = "github:Gerg-L/spicetify-nix";
inputs.nixpkgs.follows = "nixpkgs";
@ -42,13 +41,13 @@
let
specialArgs = inputs;
modules = [
./specific/desktop/nixos.nix
./hosts/wizdesk/nixos.nix
home-manager.nixosModules.home-manager
{
home-manager.extraSpecialArgs = inputs;
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
home-manager.users.wizardlink = import ./specific/desktop/home-manager.nix;
home-manager.users.wizardlink = import ./hosts/wizdesk/home-manager.nix;
}
];
in
@ -58,13 +57,13 @@
let
specialArgs = inputs;
modules = [
./specific/laptop/nixos.nix
./hosts/wizlap/nixos.nix
home-manager.nixosModules.home-manager
{
home-manager.extraSpecialArgs = inputs;
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
home-manager.users.wizardlink = import ./specific/laptop/home-manager.nix;
home-manager.users.wizardlink = import ./hosts/wizlap/home-manager.nix;
}
];
in
@ -73,10 +72,25 @@
formatter."${system}" = pkgs.nixfmt-rfc-style;
packages."${system}" = {
wb32dfu-udev-rules = pkgs.callPackage ./packages/wb32dfu-udev-rules { };
zenergy = pkgs.callPackage ./packages/zenergy.nix { };
};
nixosModules = {
hyprland = import ./modules/hyprland/nixos.nix;
};
homeManagerModules = {
emacsConfig = import ./modules/home-manager/programs/emacs;
hyprlandConfig = import ./modules/home-manager/programs/hyprland;
neovim = import ./modules/home-manager/programs/neovim;
emacs = import ./modules/emacs;
hyprland = import ./modules/hyprland/home-manager.nix;
neovim = import ./modules/neovim;
};
templates.default = {
path = ./modules/template;
description = "A NixOS & Home-Manager template to get started with the https://github.com/wizardlink/linuxware
configuration.";
};
};
}

15
hosts/README.md Normal file
View file

@ -0,0 +1,15 @@
## wizdesk
My main machine, this is where I host everything that's accessible through the `thewizard.link` domain.
### Specs
![image](/assets/screenshots/fastfetch-wizdesk.png)
## wizlap
My ASUS Vivobook 15 (M1502IA), I mostly use it when I have to travel so there isn't much to say about it.
### Specs
They can be found in ASUS' store/support page, I haven't modified it yet.

View file

@ -7,11 +7,11 @@
# Import configurations for better modularity.
imports = [
../../modules/home-manager
./services/openttd.nix
./services/terraria.nix
./services/hydractify-bot.nix
./services/gakuen-cosplay-api.nix
../../modules/emacs
../../modules/hyprland/home-manager.nix
../../modules/neovim
../../shared/home-manager
./services/home-manager
];
# Home Manager needs a bit of information about you and the paths it should
@ -28,11 +28,6 @@
# release notes.
home.stateVersion = "23.05"; # Please read the comment before changing.
home.sessionVariables = {
EDITOR = "nvim";
MANPAGER = "nvim +Man!";
};
home.file = {
# Create wallpaper script to be read by the start_services.sh script.
".local/share/scripts/wallpaper.sh" = {
@ -137,6 +132,13 @@
screenshot.enable = true;
};
# Enable hypridle and hyprlock
hypridle.enable = true;
hyprlock = {
enable = true;
background = "/mnt/internal/personal/wallpapers/wallhaven-2em8y6.jpg";
};
# Add monitor configuration to hyprland
extraConfig = # hyprlang
''

View file

@ -1,11 +1,11 @@
{ pkgs, ... }:
{ pkgs, config, ... }:
{
imports = [
../../modules/nixos
../../modules/hyprland/nixos.nix
../../shared/nixos
./hardware-configuration.nix
./hardware.nix
./services.nix
./services/nixos
];
#
@ -134,11 +134,36 @@
};
#
# NETWORK #
# HARDWARE #
#
# Enable WOL on my ethernet interface.
networking.interfaces.enp5s0.wakeOnLan.enable = true;
# Enable Zenergy
boot.initrd.kernelModules = [
"zenergy"
];
boot.extraModulePackages = [
config.boot.kernelPackages.zenergy
];
# Enable openrazer for managing Razer products' configuration
hardware.openrazer = {
enable = true;
users = [ "wizardlink" ];
};
services.udev = {
# Vial udev rule for Monsgeek M1
extraRules = ''
# Monsgeek M1
KERNEL=="hidraw*", SUBSYSTEM=="hidraw", ATTRS{idVendor}=="fffe", ATTRS{idProduct}=="0005", MODE="0660", GROUP="users", TAG+="uaccess", TAG+="udev-acl"
'';
# WB32 DFU rules - needed for flashing
packages = [ (pkgs.callPackage ../../packages/wb32dfu-udev-rules { }) ];
};
# enable a better driver for wireless xbox controllers.
hardware.xpadneo.enable = true;
#
# PACKAGES #

View file

@ -0,0 +1,10 @@
{ ... }:
{
imports = [
./gakuen-cosplay-api.nix
./hydractify-bot.nix
./openttd.nix
./terraria.nix
];
}

View file

@ -0,0 +1,12 @@
{ ... }:
{
imports = [
./archi.nix
./caddy.nix
./forgejo.nix
./jellyfin.nix
./nix-serve.nix
./postgresql.nix
];
}

View file

@ -7,7 +7,10 @@
# Import configurations for better modularity.
imports = [
../../modules/home-manager
../../modules/emacs
../../modules/hyprland/home-manager.nix
../../modules/neovim
../../shared/home-manager
];
# Home Manager needs a bit of information about you and the paths it should
@ -24,11 +27,6 @@
# release notes.
home.stateVersion = "23.05"; # Please read the comment before changing.
home.sessionVariables = {
EDITOR = "nvim";
MANPAGER = "nvim +Man!";
};
home.file = {
# Create wallpaper script to be read by the start_services.sh script.
".local/share/scripts/wallpaper.sh" = {

View file

@ -1,10 +1,10 @@
{ ... }:
{ config, ... }:
{
imports = [
../../modules/nixos
../../modules/hyprland/nixos.nix
../../shared/nixos
./hardware-configuration.nix
./hardware.nix
];
#
@ -19,6 +19,9 @@
# (e.g. man configuration.nix or on https://nixos.org/nixos/options.html).
system.stateVersion = "23.05";
# Consume my desktop's binary cache. This is specially useful since (in theory)
# I will always update the flake and desktop machine first, so when I pull the changes,
# my desktop will have all the binaries my laptop needs.
nix.settings.substituters = [ "http://192.168.0.100:7373" ];
nix.settings.trusted-public-keys = [
"wizdesk-1:2UvctPjiMwMs7r2r7VPvoPmh4OcUjY3JmaRDJnOTZY8="
@ -97,4 +100,19 @@
LC_TIME = "en_GB.UTF-8";
};
};
#
# HARDWARE #
#
# Enable Zenergy
boot.initrd.kernelModules = [
"zenergy"
];
boot.extraModulePackages = [
config.boot.kernelPackages.zenergy
];
# enable a better driver for wireless xbox controllers.
hardware.xpadneo.enable = true;
}

8
modules/README.md Normal file
View file

@ -0,0 +1,8 @@
This directory encompasses all modules/resources that are exported by this repository's flake.
## Currently maintained modules
- [hyprland](./hyprland)
- [neovim](./neovim)
- [emacs](./emacs)
- [template](./template)

6
modules/emacs/README.md Normal file
View file

@ -0,0 +1,6 @@
This module has no options, it simply just adds the necessary packages to run
[DOOM Emacs](https://github.com/doomemacs/doomemacs) and writes contents inside [./doom](./doom) into `$XDG_CONFIG_HOME/doom`.
## Screenshots
![image](/assets/screenshots/doomemacs.png)

View file

@ -1,92 +0,0 @@
{ pkgs, clipboard-sync, ... }:
{
imports = [
./programs
];
# The home.packages option allows you to install Nix packages into your
# environment.
home.packages = with pkgs; [
# # You can also create simple shell scripts directly inside your
# # configuration. For example, this adds a command 'my-hello' to your
# # environment:
# (pkgs.writeShellScriptBin "my-hello" ''
# echo "Hello, ${config.home.username}!"
# '')
## Tools
# Utilities
fastfetch
firefox
pavucontrol
protonvpn-gui
qbittorrent
qdirstat
speedcrunch
vlc
yt-dlp
zathura
# Personal utilities
anki
ledger
(vesktop.override {
# FIXME: Need to pin until https://github.com/NixOS/nixpkgs/issues/380429 gets resolved.
electron = electron_33;
})
# Editing
libreoffice
# Creative work
aseprite
blender
krita
lmms
orca-slicer
shotcut
vcv-rack
vhs
## Entertainment
jellyfin-media-player
# Gaming
gamescope
heroic
protontricks
wineWowPackages.unstableFull
winetricks
# Games
openttd
prismlauncher
shattered-pixel-dungeon
xonotic
## Libraries
libsForQt5.kdegraphics-thumbnailers
libsForQt5.kio-extras
rnnoise-plugin
## Development
beekeeper-studio
godot_4
hoppscotch
lazygit
## Desktop environment
clipboard-sync.packages.${pkgs.stdenv.hostPlatform.system}.default
cliphist
grim
libsForQt5.ark
loupe
mako
slurp
swww
# Mail client
thunderbird
];
}

View file

@ -1,73 +0,0 @@
# My [Home Manager] module for neovim configuration
This is my personal configuration for _[neovim]_ using [Nix](https://nixos.org/), so this will not work outside of it - though it can be made to be.
In this case, I am outputting a [Home Manager] module to be used directly in your configuration, it currently barely has
any
options and is opinionated due to it being my personal configuration for daily use... But I plan to slowly add options
to make it usable by other people.
## Installing
First you add this repository as a flake input:
```nix
{
inputs = {
home-manager = {
url = "github:nix-community/home-manager";
inputs.nixpkgs.follows = "nixpkgs";
};
wizardlink.url = "git+https://git.thewizard.link/wizardlink/linuxware";
};
outputs = { home-manager, ... }@inputs: {
homeConfigurations.YOURHOSTNAME = home-manager.lib.homeManagerConfiguration {
# ...
extraSPecialArgs = inputs;
};
};
}
```
Then in your [Home Manager] configuration you can just import it:
```nix
{ wizardlink }:
{
imports = [
wizardlink.homeManagerModules.neovim
];
}
```
## Configuring
### [nixd](https://github.com/nix-community/nixd/)
```nix
programs.neovim.flake = {
hostname = "nixos"; # Your hostname used to build your system.
location = "git+file:///home/wizardlink/.system"; # Where you store your flake.
};
```
## My neovim failed because of package X not existing
My configuration is based off of `nixos-unstable` so sometimes your package may not exist or have a different name, I
apologise for that but I don't plan on maintaining backwards compatibility. :(
## How it looks
Here's some screenshots of how it currently looks like:
![image](./docs/example_1.png)
![image](./docs/example_2.png)
![image](./docs/example_3.png)
The theme I'm using is [catppuccin](https://github.com/catppuccin) in case you're curious.
[neovim]: https://neovim.io/
[Home Manager]: https://github.com/nix-community/home-manager

View file

@ -0,0 +1,60 @@
The [NixOS] module installs [Hyprland] onto the system.
Whilst the [Home Manager] module generates the dotfiles for [Hyprland] and optionally [hyprlock] and [hypridle].
It can be configured through `modules.hyprland`.
## Module options
### extraConfig
`modules.hyprland.extraConfig` when set will be appended to the top of the configuration I generate, you can see where
that is [here](./home-manager.nix#L189).
There are no monitors configured by default, so you should use this option to do so.
### hypridle.enable
Whether to configure and enable the [hypridle] package. Be mindful that it may not auto-start, I have yet to find why but
even though it configures to start after `graphical-session.target`, that isn't reached in Hyprland sometimes.
### hyprlock.enable
Whether to configure and enable the [hyprlock] package, by itself it does nothing but when [hypridle] is also enabled it
will automatically call [hyprlock] after a 120 second timeout.
### hyprlock.background
A path to an image that will be used as background when [hyprlock] is invoked.
### scripts.screenshot.enable
When enabled it will create two script files in `$XDG_DATA_HOME/scripts/hyprland` and two keybinds for you to run these
scripts, allowing you to take screenshots of a region and the entire screen of your first monitor.
### scripts.startup.enable
Not my proudest option, this will add two packages containing a startup script for apps that I use in the daily &
services. If this module ever gets actually used by someone, then I'll refine it.
## Visuals
### Active window
![image](/assets/screenshots/hyprland-active.png)
### Inactive window
![image](/assets/screenshots/hyprland-inactive.png)
### Gaps
![image](/assets/screenshots/hyprland-gaps.png)
<!-- REFERENCES -->
[hyprland]: https://hyprland.org/
[hyprlock]: https://github.com/hyprwm/hyprlock
[hypridle]: https://github.com/hyprwm/hypridle
[home manager]: https://github.com/nix-community/home-manager
[nixos]: https://nixos.org

View file

@ -21,6 +21,18 @@ in
description = "Configuration to be appended to my own.";
};
hypridle.enable = lib.mkEnableOption "hypridle";
hyprlock = {
enable = lib.mkEnableOption "hyprlock";
background = lib.mkOption {
type = lib.types.path;
default = "";
example = "~/wallpapers/abc.png";
description = "The image to be used as background for hyprlock.";
};
};
scripts = {
screenshot.enable = lib.mkEnableOption "screenshot";
startup.enable = lib.mkEnableOption "startup";
@ -28,13 +40,18 @@ in
};
config = {
home.sessionVariables = {
NIXOS_OZONE_WL = "1";
QT_QPA_PLATFORM = "wayland";
};
xdg.configFile."hypr/frappe.conf".source = builtins.fetchurl {
url = "https://raw.githubusercontent.com/catppuccin/hyprland/main/themes/frappe.conf";
sha256 = "1clw669i1n3dhawdw4clmjv75fy3smycb5iqk3sanzpr3y0i4vwx";
};
# Enable hypridle and hyprlock
services.hypridle = {
services.hypridle = lib.mkIf cfg.hypridle.enable {
enable = true;
settings = {
general = {
@ -43,21 +60,24 @@ in
lock_cmd = "hyprlock";
};
listener = [
{
timeout = 120;
on-timeout = "hyprlock";
}
{
timeout = 180;
on-timeout = "hyprctl dispatch dpms off";
on-resume = "hyprctl dispatch dpms on";
}
];
listener =
[
{
timeout = 180;
on-timeout = "hyprctl dispatch dpms off";
on-resume = "hyprctl dispatch dpms on";
}
]
++ lib.optionals cfg.hyprlock.enable [
{
timeout = 120;
on-timeout = "hyprlock";
}
];
};
};
programs.hyprlock = {
programs.hyprlock = lib.mkIf cfg.hyprlock.enable {
enable = true;
extraConfig = # hyprlang
''
@ -76,7 +96,7 @@ in
# BACKGROUND
background {
monitor =
path = $HOME/internal/personal/wallpapers/wallhaven-2em8y6.jpg
path = ${cfg.hyprlock.background}
blur_passes = 0
color = $base
}

View file

@ -0,0 +1,26 @@
{ pkgs, hyprland, ... }:
let
hyprland-pkgs = hyprland.inputs.nixpkgs.legacyPackages.${pkgs.stdenv.hostPlatform.system};
in
{
# Enable Hyprland's cachix
nix.settings.substituters = [ "https://hyprland.cachix.org" ];
nix.settings.trusted-public-keys = [
"hyprland.cachix.org-1:a7pgxzMz7+chwVL3/pzj6jIBMioiJM7ypFP8PwtkuGc="
];
# Enable Hyprland
programs.hyprland = {
enable = true;
package = hyprland.packages.${pkgs.stdenv.hostPlatform.system}.hyprland;
portalPackage = hyprland.packages.${pkgs.stdenv.hostPlatform.system}.xdg-desktop-portal-hyprland;
};
# Overwrite the Mesa packages with Hyprland's for consitency
hardware.graphics = {
package = hyprland-pkgs.mesa.drivers;
package32 = hyprland-pkgs.pkgsi686Linux.mesa.drivers;
};
}

43
modules/neovim/README.md Normal file
View file

@ -0,0 +1,43 @@
This module generates dotfiles for [neovim].
The module extends `programs.neovim`.
## Module options
### programs.neovim.nixd.hostname
By default [nixd] is enabled, you **need** to pass the current machine's
hostname that is used to generate your system.
### programs.neovim.nixd.location
The location of your system's flake, [nixd] will execute an expression defined in the LSP's configuration that reads
the flake's contents to evaluate [NixOS] and [Home Manager] options.
### programs.neovim.ollama.enable
Whether to add an [ollama] package to be used with [ollama.nvim](https://github.com/nomnivore/ollama.nvim).
### programs.neovim.ollama.type
The type of [ollama] package to be added, valid options are: `amd`, `nvidia` or `cpu`.
## My neovim failed because of package X not existing
My configuration is based off of `nixos-unstable` so sometimes your package may not exist or have a different name, I
apologise for that but I don't plan on maintaining backwards compatibility. :(
## How it looks
Here's some screenshots of how it currently looks like:
![image](/assets/screenshots/neovim-dashboard.png)
![image](/assets/screenshots/neovim-nix.png)
![image](/assets/screenshots/neovim-rust.png)
The theme I'm using is [catppuccin](https://github.com/catppuccin) in case you're curious.
[neovim]: https://neovim.io/
[Home Manager]: https://github.com/nix-community/home-manager
[nixd]: https://github.com/nix-community/nixd/
[ollama]: https://ollama.com/

View file

@ -56,81 +56,89 @@ in
};
config = {
home.sessionVariables = {
EDITOR = "nvim";
MANPAGER = "nvim +Man!";
};
programs.neovim = {
withNodeJs = true;
withPython3 = true;
extraLuaConfig = builtins.readFile ./init.lua;
extraPackages = with pkgs; [
# Needed by ollama.nvim
curl
ollamaPackage
extraPackages =
with pkgs;
[
# Needed by LuaSnip
luajitPackages.jsregexp
# Needed by LuaSnip
luajitPackages.jsregexp
# Treesitter
gcc # For compiling languages
# Treesitter
gcc # For compiling languages
# CMAKE
neocmakelsp
# CMAKE
neocmakelsp
# C/C++
clang-tools
vscode-extensions.ms-vscode.cpptools
# C/C++
clang-tools
vscode-extensions.ms-vscode.cpptools
# C#
#csharp-ls Testing roslyn.nvim
roslyn-ls
rzls
csharpier
netcoredbg
# C#
#csharp-ls Testing roslyn.nvim
roslyn-ls
rzls
csharpier
netcoredbg
# HTML/CSS/JSON
emmet-ls
vscode-langservers-extracted
# HTML/CSS/JSON
emmet-ls
vscode-langservers-extracted
# LUA
lua-language-server
stylua
# LUA
lua-language-server
stylua
# Markdown
markdownlint-cli
marksman
# Markdown
markdownlint-cli
marksman
# Nix
deadnix
nixd
nixfmt-rfc-style
statix
# Nix
deadnix
nixd
nixfmt-rfc-style
statix
# Python
basedpyright
python312Packages.flake8
ruff
# Python
basedpyright
python312Packages.flake8
ruff
# TypeScript/JavaScript
vtsls
deno
vscode-js-debug
# TypeScript/JavaScript
vtsls
deno
vscode-js-debug
# Rust
rust-analyzer
cargo # Needed by blink-cmp
taplo
vscode-extensions.vadimcn.vscode-lldb
# Rust
rust-analyzer
cargo # Needed by blink-cmp
taplo
vscode-extensions.vadimcn.vscode-lldb
# Vue
prettierd
vue-language-server
# Vue
prettierd
vue-language-server
# Svelte
nodePackages.svelte-language-server
# Svelte
nodePackages.svelte-language-server
# YAML
yaml-language-server
];
# YAML
yaml-language-server
]
++ pkgs.lib.optionals config.programs.neovim.ollama.enable [
# Needed by ollama.nvim
curl
ollamaPackage
];
};
xdg.configFile."nvim/lua" = {

View file

@ -1,111 +0,0 @@
{ pkgs, ... }:
{
# Enable GPG.
programs.gnupg.agent = {
enable = true;
enableSSHSupport = true;
};
# Enable fish system-wide to integrate with nixpkgs.
programs.fish.enable = true;
# Enable Steam.
programs.steam = {
enable = true;
remotePlay.openFirewall = true;
localNetworkGameTransfers.openFirewall = true;
# ^ Enables so we can transfer games to other computers in the network.
# Add Proton-GE to 'compatibilitytools.d'.
extraCompatPackages = with pkgs; [ proton-ge-bin ];
};
# Enable and configure gamemode.
programs.gamemode = {
enable = true;
enableRenice = true;
settings = {
gpu = {
apply_gpu_optimisations = "accept-responsibility";
gpu_device = 1;
amd_performance_level = "auto";
};
};
};
# Enable KDEConnect
programs.kdeconnect = {
enable = true;
package = pkgs.kdePackages.kdeconnect-kde;
};
# Enable Docker.
virtualisation.docker.enable = true;
# Enable virt-manager
programs.virt-manager.enable = true;
# Enable virtd and spice USB redirection
virtualisation.spiceUSBRedirection.enable = true;
virtualisation.libvirtd.enable = true;
# List packages installed in system profile. To search, run:
# $ nix search wget
environment.systemPackages = with pkgs; [
## Tools
# Utilities
bat
duf
fuseiso
lm_sensors
p7zip
tree
unrar
unzip
wget
zip
# File managing
sshfs
yazi
# Virtualization
docker-compose
quickemu
# Desktop
wl-clipboard
xclip
zoxide
(catppuccin-sddm.override # So SDDM finds the theme files.
{
flavor = "frappe";
font = "IBM Plex Sans";
fontSize = "11";
background = "${./theming/sddm/Background.jpg}";
loginBackground = true;
}
)
# Networking
gping
nmap
# Processes
(btop.override {
# AMD GPU support
rocmSupport = true;
})
killall
# Filter
fzf
ripgrep
## Libraries
libsForQt5.qt5.qtgraphicaleffects
libsForQt5.qt5.qtquickcontrols2
];
}

View file

@ -1,41 +0,0 @@
{
pkgs,
lib,
config,
...
}:
{
# Enable polkit,
security.polkit.enable = true;
# install an agent to interface with it,
environment.systemPackages = with pkgs; [ polkit_gnome ];
# And enable GNOME keyring for registering keys.
services.gnome.gnome-keyring.enable = true;
# Enable flatpak to all users.
services.flatpak.enable = true;
services.postgresql = {
identMap = lib.mkIf config.services.postgresql.enable ''
# MAP_NAME SYSTEM_USER DB_USER
superuser_map root postgres
superuser_map postgres postgres
superuser_map /^(.*)$ \1
'';
authentication = lib.mkIf config.services.postgresql.enable (
lib.mkOverride 10 ''
# TYPE DATABASE USER ADDRESS METHOD MAP
local all all peer map=superuser_map
host all all 127.0.0.1/32 md5
host all all ::1/128 md5
local replication all peer map=superuser_map
host replication all 127.0.0.1/32 ident map=superuser_map
host replication all ::1/128 ident map=superuser_map
''
);
};
}

View file

@ -1,15 +0,0 @@
{ ... }:
{
# Enable sound with pipewire.
services.pulseaudio.enable = false;
services.pipewire = {
enable = true;
audio.enable = true;
alsa.enable = true;
alsa.support32Bit = true;
pulse.enable = true;
};
}

View file

@ -1,12 +0,0 @@
{ ... }:
{
# Set the default fonts for the system.
fonts.fontconfig = {
defaultFonts = {
serif = [ "IBM Plex Serif" ];
sansSerif = [ "IBM Plex Sans" ];
monospace = [ "IBM Plex Mono" ];
};
};
}

View file

@ -0,0 +1,18 @@
# READ THIS BEFORE PROCEEDING
Below is a checklist of changes you need to do before rebuilding your system.
## Generate your system configuration and replace the placeholders.
You can achieve this by running `sudo nixos-generate-config`, then overwrite `hardware-configuration.nix` and
`configuration.nix` with the contents of the files found in `/etc/nixos`.
## Replace placeholder text
In `flake.nix` you will find `your-hostname-here`, replace with your machine's current hostname.
In `home-manager.nix` you have to replace:
- `your-username-here` with your user's username;
- `your-home-directory-here` with the path of your home directory, usually the same as your username;
- `your-hostname-here` with your machine's current hostname;
- `your-flake-location-here` with where you are storing the flake.

View file

@ -0,0 +1 @@
{ ... }: { }

View file

@ -0,0 +1,48 @@
{
description = "NixOS System Flake";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
# Ideally using nixos-unstable since my configuration
# is based off of this channel.
home-manager = {
url = "github:nix-community/home-manager";
inputs.nixpkgs.follows = "nixpkgs";
};
linuxware = {
url = "github:wizardlink/linuxware";
inputs.nixpkgs.follows = "nixpkgs"; # Pin to your local `nixpkgs` if you use the unstable channel.
};
};
outputs =
{
home-manager,
nixpkgs,
linuxware,
...
}@inputs:
let
system = "x86_64-linux";
in
{
your-hostname-here =
let
specialArgs = inputs;
modules = [
./configuration.nix
home-manager.nixosModules.home-manager
{
home-manager.extraSpecialArgs = inputs;
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
home-manager.users.wizardlink = import ./home-manager.nix;
}
linuxware.nixosModules.hyprland
];
in
nixpkgs.lib.nixosSystem { inherit system specialArgs modules; };
};
}

View file

@ -0,0 +1 @@
{ ... }: { }

View file

@ -0,0 +1,98 @@
{
config,
pkgs,
linuxware,
...
}:
{
imports = [
linuxware.homeManagerModules.emacs
linuxware.homeManagerModules.hyprland
linuxware.homeManagerModules.neovim
];
# Home Manager needs a bit of information about you and the paths it should
# manage.
home.username = "your-username-here";
home.homeDirectory = "/home/your-home-directory-here";
# This value determines the Home Manager release that your configuration is
# compatible with. This helps avoid breakage when a new Home Manager release
# introduces backwards incompatible changes.
#
# You should not change this value, even if you update Home Manager. If you do
# want to update the value, then make sure to first check the Home Manager
# release notes.
home.stateVersion = "24.11"; # Please read the comment before changing.
# The home.packages option allows you to install Nix packages into your
# environment.
home.packages = [
# # Adds the 'hello' command to your environment. It prints a friendly
# # "Hello, world!" when run.
# pkgs.hello
# # It is sometimes useful to fine-tune packages, for example, by applying
# # overrides. You can do that directly here, just don't forget the
# # parentheses. Maybe you want to install Nerd Fonts with a limited number of
# # fonts?
# (pkgs.nerdfonts.override { fonts = [ "FantasqueSansMono" ]; })
# # You can also create simple shell scripts directly inside your
# # configuration. For example, this adds a command 'my-hello' to your
# # environment:
# (pkgs.writeShellScriptBin "my-hello" ''
# echo "Hello, ${config.home.username}!"
# '')
];
# Home Manager is pretty good at managing dotfiles. The primary way to manage
# plain files is through 'home.file'.
home.file = {
# # Building this configuration will create a copy of 'dotfiles/screenrc' in
# # the Nix store. Activating the configuration will then make '~/.screenrc' a
# # symlink to the Nix store copy.
# ".screenrc".source = dotfiles/screenrc;
# # You can also set the file content immediately.
# ".gradle/gradle.properties".text = ''
# org.gradle.console=verbose
# org.gradle.daemon.idletimeout=3600000
# '';
};
# Home Manager can also manage your environment variables through
# 'home.sessionVariables'. These will be explicitly sourced when using a
# shell provided by Home Manager. If you don't want to manage your shell
# through Home Manager then you have to manually source 'hm-session-vars.sh'
# located at either
#
# ~/.nix-profile/etc/profile.d/hm-session-vars.sh
#
# or
#
# ~/.local/state/nix/profiles/profile/etc/profile.d/hm-session-vars.sh
#
# or
#
# /etc/profiles/per-user/wizardlink/etc/profile.d/hm-session-vars.sh
#
home.sessionVariables = {
# EDITOR = "emacs";
};
# Let Home Manager install and manage itself.
programs.home-manager.enable = true;
programs.neovim = {
# Enable Neovim, pre-configured by `linuxware`.
enable = true;
# Configure nixd
nixd = {
hostname = "your-hostname-here";
location = "your-flake-location-here";
};
};
}

17
packages/README.md Normal file
View file

@ -0,0 +1,17 @@
## [zenergy](https://github.com/BoukeHaarsma23/zenergy/)
This is a kernel driver that adds the ability for user to fetch power draw data from AMD CPUs. I maintain it in
[nixpkgs], so you shouldn't use this package _unless_ it is broken in your current
version of [nixpkgs].
## wb32dfu-udev-rules
This package installs the udev rules necessary to allow flashing QMK/Vial onto keyboards that use WB32-DFU bootloaders.
It is also meant to be used in tandem with [NixOS] using the
[`services.udev.packages`](https://search.nixos.org/options?query=services.udev.packages) configuration.
<!-- REFERENCES -->
[nixpkgs]: https://github.com/NixOS/nixpkgs/
[nixos]: https://nixos.org

51
shared/README.md Normal file
View file

@ -0,0 +1,51 @@
In this directory you will find the configuration for [NixOS] and [Home Manager] that I share across multiple machines.
## File structure
### ./nixos
- `default.nix`
- _Entry point._
- `common.nix`
- _General configuration and packages._
- `desktop.nix`
- _Desktop specific configuration._
- `gaming.nix`
- _Gaming related configuration._
- `hardware.nix`
- _Hardware specific configuration._
- `system.nix`
- _Configuration pertaining the system._
- `virtualization.nix`
- _Virtualization packages and configuration._
### ./home-manager
- `default.nix`
- _Entry point._
- `common.nix`
- _General and misc. packages alongside uncategorized dotfiles._
- `gaming.nix`
- _Packages and dotfiles pertaining games/gaming._
- `theming.nix`
- _Theming of the system and it's packages._
- `dotfiles/`
- _Program specific user configuration._
- `scripts/`
- _Contains scripts that I may use day to day._
#### Screenshots
Waybar:
![image](/assets/screenshots/waybar.png)
Rofi:
![image](/assets/screenshots/rofi.png)
<!-- REFERENCES -->
[nixos]: https://nixos.org
[home manager]: https://github.com/nix-community/home-manager

View file

@ -1,21 +1,18 @@
{ pkgs, ... }:
{ pkgs, clipboard-sync, ... }:
{
# Let Home Manager install and manage itself.
programs.home-manager.enable = true;
home.sessionVariables = {
NIXOS_OZONE_WL = "1";
QT_QPA_PLATFORM = "wayland";
};
home.file = {
# Configuration for gamemode, for running games with optimizations.
".config/gamemode.ini".source = ./programs/gamemode.ini;
# My utility scripts
".local/share/scripts" = {
source = ./scripts;
recursive = true;
};
# Configuration for mako, a notification daemon.
".config/mako".source = ./programs/mako;
".config/mako".source = ./dotfiles/mako;
# Configure pipewire for microphone noise supression.
".config/pipewire/pipewire.conf.d/99-input-denoising.conf".text = ''
@ -53,17 +50,6 @@
}
]
'';
# Configure DXVK
".config/dxvk.conf".text = ''
dxvk.enableGraphicsPipelineLibrary = Auto
'';
# My utility scripts
".local/share/scripts" = {
source = ./scripts;
recursive = true;
};
};
# Configure XDG
@ -77,4 +63,74 @@
"x-scheme-handler/https" = [ "firefox.desktop" ];
"x-scheme-handler/unknown" = [ "firefox.desktop" ];
};
home.packages = with pkgs; [
# # You can also create simple shell scripts directly inside your
# # configuration. For example, this adds a command 'my-hello' to your
# # environment:
# (pkgs.writeShellScriptBin "my-hello" ''
# echo "Hello, ${config.home.username}!"
# '')
## Tools
# Utilities
fastfetch
firefox
pavucontrol
protonvpn-gui
qbittorrent
qdirstat
speedcrunch
vlc
yt-dlp
zathura
# Personal utilities
anki
ledger
(vesktop.override {
# FIXME: Need to pin until https://github.com/NixOS/nixpkgs/issues/380429 gets resolved.
electron = electron_33;
})
# Editing
libreoffice
# Creative work
aseprite
blender
krita
lmms
orca-slicer
shotcut
vcv-rack
vhs
## Entertainment
jellyfin-media-player
## Libraries
libsForQt5.kdegraphics-thumbnailers
libsForQt5.kio-extras
rnnoise-plugin
## Development
beekeeper-studio
godot_4
hoppscotch
lazygit
## Desktop environment
clipboard-sync.packages.${pkgs.stdenv.hostPlatform.system}.default
cliphist
grim
libsForQt5.ark
loupe
mako
slurp
swww
# Mail client
thunderbird
];
}

View file

@ -3,7 +3,8 @@
{
imports = [
./common.nix
./packages.nix
./dotfiles
./gaming.nix
./theming.nix
];
}

View file

@ -4,12 +4,9 @@
imports = [
./alacritty.nix
./direnv
./emacs
./fish
./git.nix
./hyprland
./mangohud.nix
./neovim
./obs-studio.nix
./rofi
./spotify

View file

@ -1,6 +1,11 @@
{ pkgs, ... }:
{ ... }:
{
home.file = {
# Cattpuccin theme for fish shell.
".config/fish/themes/Catppuccin-Frappe.theme".source = ./Catppuccin-Frappe.theme;
};
programs.fish = {
enable = true;

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