Compare commits

..

1 Commits

Author SHA1 Message Date
aad01c1271 Add nixos-unstable-small to temporarily override pyside6
All checks were successful
Run nix flake check / flake-check (push) Successful in 4m42s
2024-11-20 15:36:48 +01:00
87 changed files with 2103 additions and 1714 deletions

View File

@@ -2,12 +2,12 @@ keys:
- &admin_torjus age1lznyk4ee7e7x8n92cq2n87kz9920473ks5u9jlhd3dczfzq4wamqept56u
- &server_gunter age1whxf34vjdndqzwgm7yyaexdm46gdnv9sf3nal7qqyjr0nyhhndlsrmc0g3
- &server_magicman age1stlqqspmt5fepyz35udrwr5avf9zuju79f787p26pu2d2j08yqps2q2t2c
- &server_prismo age1lznyk4ee7e7x8n92cq2n87kz9920473ks5u9jlhd3dczfzq4wamqept56u
creation_rules:
- path_regex: secrets/[^/]+\.(yaml|json|env|ini|toml)
key_groups:
- age:
- *admin_torjus
- *server_magicman
- path_regex: secrets/gunter/[^/]+\.(yaml|json|env|ini|toml)
key_groups:
- age:
@@ -18,8 +18,12 @@ creation_rules:
- age:
- *admin_torjus
- *server_magicman
- path_regex: secrets/prismo/[^/]+\.(yaml|json|env|ini|toml)
key_groups:
- age:
- *admin_torjus
- *server_prismo
- path_regex: secrets/torjus/[^/]+\.(yaml|json|env|ini|toml)
key_groups:
- age:
- *admin_torjus
- *server_magicman

140
CLAUDE.md
View File

@@ -1,140 +0,0 @@
# CLAUDE.md
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
## Repository Overview
This is a NixOS configuration repository using flakes for managing multiple machines (gunter, magicman). It uses home-manager for user configurations and sops-nix for secrets management. Custom packages from private git repositories are integrated via flake inputs and overlays.
## Essential Commands
### Formatting
```bash
nix fmt # Format all Nix files (uses nixfmt-tree)
nix fmt . # Same as above
```
### Building & Testing
```bash
# Test build a specific host configuration
nix build .#nixosConfigurations.gunter.config.system.build.toplevel
nix build .#nixosConfigurations.magicman.config.system.build.toplevel
# Enter development shell (includes act, actionlint, yamllint)
nix develop
```
If config clearly only affects one host, bulding for just the relevant host is enough.
Otherwise, build both.
If moving things around, you can use `nix eval` before and after changes to check that things remain the same.
```
nix eval .#nixosConfigurations.magicman.config.nix.settings.substituters --json | jq
```
### Common Operations
```bash
# Check flake without building
nix flake check
# Show flake outputs
nix flake show
```
## Architecture
### Flake Structure
- **Inputs**: Uses both stable (nixos-25.05) and unstable nixpkgs channels
- **Overlays**: `overlay-stable` provides `pkgs.stable` for stable packages; custom overlays integrate private packages (ghettoptt, huecli, nixprstatus, natstonotify, nix-packages)
- **System**: x86_64-linux primary, with multi-platform devShell support
### Directory Organization
```
├── flake.nix # Main entrypoint with overlays and host definitions
├── hosts/ # Per-host system configurations
│ ├── gunter/ # Desktop with multi-monitor, nvidia, steam
│ └── magicman/ # Laptop configuration
├── home/ # Home-manager user configurations
│ ├── hosts/ # Per-host user settings (imports packages + programs)
│ ├── editor/ # Neovim configuration
│ ├── hyprland/ # Wayland compositor with custom options
│ ├── packages/ # Simple packages (no options)
│ ├── programs/ # Programs with home-manager options (dunst, git, firefox, etc.)
│ ├── services/ # User services (backup, ghettoptt, natstonotify)
│ ├── scripts/ # User scripts
│ ├── sops/ # User secrets configuration
│ ├── ssh/ # SSH configuration
│ └── zsh/ # Shell configuration
├── system/ # Shared system-level modules
│ ├── monitoring/ # logs.nix, metrics.nix
│ ├── fonts.nix # Font configuration
│ ├── locale.nix # Localization settings
│ ├── users.nix # User account definitions
│ └── ... # Other system modules
└── secrets/ # SOPS-encrypted secrets (don't modify)
```
### Configuration Pattern
- Each host's `default.nix` imports: `configuration.nix`, `hardware-configuration.nix`, host-specific modules, `../../system`, and `../../home/hosts/<hostname>`
- Home-manager imports are in `home/hosts/<hostname>/default.nix` which imports editor, hyprland, packages, programs, services, etc.
- Shared system config goes in `system/`, host-specific overrides in `hosts/<hostname>/`
### Hyprland Custom Options
The hyprland module in `home/hyprland/default.nix` provides custom options:
- `hyprland.monitors`: List of monitor configurations
- `hyprland.extraEnv`: Environment variables
- `hyprland.extraKeybinds`: Additional keybindings
- `hyprland.extraWorkspaces`: Named workspace definitions
- `hyprland.monitorVariables`: Monitor name variables (e.g., `$mon_left`)
- `hyprland.enableGrimblast`, `hyprland.enableWacom`, `hyprland.cursorNoHardware`: Feature flags
## Critical Workflow Rules
### Git Tracking for New Files
**CRITICAL**: Nix flakes ignore untracked files. When adding new files, run `git add <newfile>` BEFORE attempting to build. Builds will fail with "file not found" errors until files are git-tracked.
### Branching
Always create a new branch for changes. Never work directly on master branch.
### Formatting
Always run `nix fmt` before committing. Formatted Nix code is required.
### Commit Messages
Format: `topic: description`
Examples:
- `hyprland: convert deprecated windowrules`
- `packages: nixfmt-rfc-style renamed`
- `gunter: use beta nvidia driver`
Keep summaries concise. Only add commit body if needed for context.
### Forbidden Operations
- Don't run `nix flake update` (user manages input updates)
- Don't edit files in `secrets/` directory
- Don't modify `.sops.yaml`
- Don't use `nix-shell` (use `nix develop` instead)
- Don't mix stable/unstable packages arbitrarily
- Don't skip builds after configuration changes
### Adding Programs
- If no NixOS/home-manager options needed: add to `home/packages`
- If using options: create subdirectory in `home/programs/`
- Remember to `git add` new files before building
## Package Management
### Using Stable Packages
The `overlay-stable` provides access to stable nixpkgs via `pkgs.stable`:
```nix
environment.systemPackages = [ pkgs.stable.somePackage ];
```
Do not use packages from stable unless explicitly requested.
### Custom Packages
Custom packages from private repos are available via overlays:
- `pkgs.ghettoptt`
- `pkgs.huecli`
- `pkgs.nixprstatus`
- `pkgs.natstonotify`
- Plus packages from `nix-packages` overlay

View File

@@ -4,4 +4,5 @@ Configurations for:
* gunter
* magicman
* prismo

449
flake.lock generated
View File

@@ -1,5 +1,77 @@
{
"nodes": {
"flake-utils": {
"inputs": {
"systems": "systems"
},
"locked": {
"lastModified": 1710146030,
"narHash": "sha256-SZ5L6eA7HJ/nmkzGG7/ISclqe6oZdOZTNoesiInkXPQ=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "b1d9ab70662946ef0850d488da1c9019f3a9752a",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"flake-utils_2": {
"inputs": {
"systems": "systems_2"
},
"locked": {
"lastModified": 1710146030,
"narHash": "sha256-SZ5L6eA7HJ/nmkzGG7/ISclqe6oZdOZTNoesiInkXPQ=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "b1d9ab70662946ef0850d488da1c9019f3a9752a",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"flake-utils_3": {
"inputs": {
"systems": "systems_4"
},
"locked": {
"lastModified": 1726560853,
"narHash": "sha256-X6rJYSESBVr3hBoH0WbKE5KvhPU5bloyZ2L4K60/fPQ=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "c1dfcf08411b08f6b8615f7d8971a2bfa81d5e8a",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"flake-utils_4": {
"inputs": {
"systems": "systems_5"
},
"locked": {
"lastModified": 1726560853,
"narHash": "sha256-X6rJYSESBVr3hBoH0WbKE5KvhPU5bloyZ2L4K60/fPQ=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "c1dfcf08411b08f6b8615f7d8971a2bfa81d5e8a",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"ghettoptt": {
"inputs": {
"nixpkgs": [
@@ -28,11 +100,11 @@
]
},
"locked": {
"lastModified": 1770318660,
"narHash": "sha256-yFVde8QZK7Dc0Xa8eQDsmxLX4NJNfL1NKfctSyiQgMY=",
"lastModified": 1732025103,
"narHash": "sha256-qjEI64RKvDxRyEarY0jTzrZMa8ebezh2DEZmJJrpVdo=",
"owner": "nix-community",
"repo": "home-manager",
"rev": "471e6a065f9efed51488d7c51a9abbd387df91b8",
"rev": "a46e702093a5c46e192243edbd977d5749e7f294",
"type": "github"
},
"original": {
@@ -43,19 +115,18 @@
},
"huecli": {
"inputs": {
"flake-utils": "flake-utils",
"nixpkgs": [
"nixpkgs"
],
"pyproject-build-systems": "pyproject-build-systems",
"pyproject-nix": "pyproject-nix",
"uv2nix": "uv2nix"
"poetry2nix": "poetry2nix"
},
"locked": {
"lastModified": 1757974387,
"narHash": "sha256-vVFZTB3NxJCH91aaAtop3MEZcilPQ273epV1gcnQE4s=",
"lastModified": 1728336978,
"narHash": "sha256-7FX4K8QBH/9jiYyCMs2JyCTzlx1/D5Cw6upaFThSVg4=",
"ref": "master",
"rev": "b341e613337b87cef7a0f4ea05d677288cafa3fb",
"revCount": 33,
"rev": "700ece0bada9833fcfd3b6ce698cd74bc00e4493",
"revCount": 22,
"type": "git",
"url": "https://git.t-juice.club/torjus/huecli"
},
@@ -65,25 +136,48 @@
"url": "https://git.t-juice.club/torjus/huecli"
}
},
"natstonotify": {
"nix-github-actions": {
"inputs": {
"nixpkgs": [
"huecli",
"poetry2nix",
"nixpkgs"
]
},
"locked": {
"lastModified": 1739302828,
"narHash": "sha256-D6l5tAh1FDpdz9/tQC7kYhFPQzqI1HICwNh7fRejfrw=",
"ref": "master",
"rev": "bfcf518fe0b2fe19075667f7b22227376d102509",
"revCount": 7,
"type": "git",
"url": "https://git.t-juice.club/torjus/natstonotify"
"lastModified": 1703863825,
"narHash": "sha256-rXwqjtwiGKJheXB43ybM8NwWB8rO2dSRrEqes0S7F5Y=",
"owner": "nix-community",
"repo": "nix-github-actions",
"rev": "5163432afc817cf8bd1f031418d1869e4c9d5547",
"type": "github"
},
"original": {
"ref": "master",
"type": "git",
"url": "https://git.t-juice.club/torjus/natstonotify"
"owner": "nix-community",
"repo": "nix-github-actions",
"type": "github"
}
},
"nix-github-actions_2": {
"inputs": {
"nixpkgs": [
"nixprstatus",
"poetry2nix",
"nixpkgs"
]
},
"locked": {
"lastModified": 1720066371,
"narHash": "sha256-uPlLYH2S0ACj0IcgaK9Lsf4spmJoGejR9DotXiXSBZQ=",
"owner": "nix-community",
"repo": "nix-github-actions",
"rev": "622f829f5fe69310a866c8a6cd07e747c44ef820",
"type": "github"
},
"original": {
"owner": "nix-community",
"repo": "nix-github-actions",
"type": "github"
}
},
"nix-packages": {
@@ -93,11 +187,11 @@
]
},
"locked": {
"lastModified": 1757017925,
"narHash": "sha256-QC1SkvyU5nQ32lju2GYK9ozuh/JYWXfWK/T7OC6dVls=",
"lastModified": 1728153756,
"narHash": "sha256-kNpO8yC2MioSRc2SNxNM5egVvFjA2Ox0b4SAs6GnM8w=",
"ref": "master",
"rev": "7723cb45020e1f561f527779540faa5901d34e4d",
"revCount": 31,
"rev": "2fc840c15280d2dd3da1aba7272243b4aa11e611",
"revCount": 21,
"type": "git",
"url": "https://git.t-juice.club/torjus/nix-packages"
},
@@ -109,11 +203,11 @@
},
"nixpkgs": {
"locked": {
"lastModified": 1770197578,
"narHash": "sha256-AYqlWrX09+HvGs8zM6ebZ1pwUqjkfpnv8mewYwAo+iM=",
"lastModified": 1731676054,
"narHash": "sha256-OZiZ3m8SCMfh3B6bfGC/Bm4x3qc1m2SVEAlkV6iY7Yg=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "00c21e4c93d963c50d4c0c89bfa84ed6e0694df2",
"rev": "5e4fbfb6b3de1aa2872b76d49fafc942626e2add",
"type": "github"
},
"original": {
@@ -123,37 +217,52 @@
"type": "github"
}
},
"nixpkgs-stable": {
"nixpkgs-small": {
"locked": {
"lastModified": 1767313136,
"narHash": "sha256-16KkgfdYqjaeRGBaYsNrhPRRENs0qzkQVUooNHtoy2w=",
"lastModified": 1732007104,
"narHash": "sha256-qaWPxgLAvtIHTDcm0qJuc+WNYjcy4ZKigOyn2ag4ihM=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "ac62194c3917d5f474c1a844b6fd6da2db95077d",
"rev": "0705964c881cea8896474610188905ba41b59b08",
"type": "github"
},
"original": {
"owner": "nixos",
"ref": "nixos-25.05",
"ref": "nixos-unstable-small",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs-stable": {
"locked": {
"lastModified": 1731755305,
"narHash": "sha256-v5P3dk5JdiT+4x69ZaB18B8+Rcu3TIOrcdG4uEX7WZ8=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "057f63b6dc1a2c67301286152eb5af20747a9cb4",
"type": "github"
},
"original": {
"owner": "nixos",
"ref": "nixos-24.11",
"repo": "nixpkgs",
"type": "github"
}
},
"nixprstatus": {
"inputs": {
"flake-utils": "flake-utils_3",
"nixpkgs": [
"nixpkgs"
],
"pyproject-build-systems": "pyproject-build-systems_2",
"pyproject-nix": "pyproject-nix_2",
"uv2nix": "uv2nix_2"
"poetry2nix": "poetry2nix_2"
},
"locked": {
"lastModified": 1767871861,
"narHash": "sha256-Oh0Y9bTvvMm3JQH/C/8XLCeemgvMDbIgFh1NSYFyINY=",
"lastModified": 1729118937,
"narHash": "sha256-7xYCJXTh92OpKwfshYYnxrWmfNjqaH9SzQ0stuBARVM=",
"ref": "master",
"rev": "b4e3e6de659bf8c96b84dd47249c71b357dd50c2",
"revCount": 62,
"rev": "58b113d934f5d62f27dc50439b89fece4eb621f5",
"revCount": 37,
"type": "git",
"url": "https://git.t-juice.club/torjus/nixprstatus"
},
@@ -163,103 +272,53 @@
"url": "https://git.t-juice.club/torjus/nixprstatus"
}
},
"pyproject-build-systems": {
"poetry2nix": {
"inputs": {
"flake-utils": "flake-utils_2",
"nix-github-actions": "nix-github-actions",
"nixpkgs": [
"huecli",
"nixpkgs"
],
"pyproject-nix": [
"huecli",
"pyproject-nix"
],
"uv2nix": [
"huecli",
"uv2nix"
]
"systems": "systems_3",
"treefmt-nix": "treefmt-nix"
},
"locked": {
"lastModified": 1757296493,
"narHash": "sha256-6nzSZl28IwH2Vx8YSmd3t6TREHpDbKlDPK+dq1LKIZQ=",
"owner": "pyproject-nix",
"repo": "build-system-pkgs",
"rev": "5b8e37fe0077db5c1df3a5ee90a651345f085d38",
"lastModified": 1724208502,
"narHash": "sha256-TCRcEPSfgAw/t7kClmlr23s591N06mQCrhzlAO7cyFw=",
"owner": "nix-community",
"repo": "poetry2nix",
"rev": "884b66152b0c625b8220b570a31dc7acc36749a3",
"type": "github"
},
"original": {
"owner": "pyproject-nix",
"repo": "build-system-pkgs",
"owner": "nix-community",
"repo": "poetry2nix",
"type": "github"
}
},
"pyproject-build-systems_2": {
"poetry2nix_2": {
"inputs": {
"flake-utils": "flake-utils_4",
"nix-github-actions": "nix-github-actions_2",
"nixpkgs": [
"nixprstatus",
"nixpkgs"
],
"pyproject-nix": [
"nixprstatus",
"pyproject-nix"
],
"uv2nix": [
"nixprstatus",
"uv2nix"
]
"systems": "systems_6",
"treefmt-nix": "treefmt-nix_2"
},
"locked": {
"lastModified": 1763662255,
"narHash": "sha256-4bocaOyLa3AfiS8KrWjZQYu+IAta05u3gYZzZ6zXbT0=",
"owner": "pyproject-nix",
"repo": "build-system-pkgs",
"rev": "042904167604c681a090c07eb6967b4dd4dae88c",
"lastModified": 1729073785,
"narHash": "sha256-KaDC7emuamQblDdka+gkBUUdEjQf3YGYozMb+zomgSM=",
"owner": "nix-community",
"repo": "poetry2nix",
"rev": "795fddefc9f910671c1cf0752c29802ce27322d6",
"type": "github"
},
"original": {
"owner": "pyproject-nix",
"repo": "build-system-pkgs",
"type": "github"
}
},
"pyproject-nix": {
"inputs": {
"nixpkgs": [
"huecli",
"nixpkgs"
]
},
"locked": {
"lastModified": 1757246327,
"narHash": "sha256-6pNlGhwOIMfhe/RLjHdpXveKS4FyLHvlGe+KtjDild4=",
"owner": "pyproject-nix",
"repo": "pyproject.nix",
"rev": "8d77f342d66ad1601cdb9d97e9388b69f64d4c8e",
"type": "github"
},
"original": {
"owner": "pyproject-nix",
"repo": "pyproject.nix",
"type": "github"
}
},
"pyproject-nix_2": {
"inputs": {
"nixpkgs": [
"nixprstatus",
"nixpkgs"
]
},
"locked": {
"lastModified": 1764134915,
"narHash": "sha256-xaKvtPx6YAnA3HQVp5LwyYG1MaN4LLehpQI8xEdBvBY=",
"owner": "pyproject-nix",
"repo": "pyproject.nix",
"rev": "2c8df1383b32e5443c921f61224b198a2282a657",
"type": "github"
},
"original": {
"owner": "pyproject-nix",
"repo": "pyproject.nix",
"owner": "nix-community",
"repo": "poetry2nix",
"type": "github"
}
},
@@ -268,9 +327,9 @@
"ghettoptt": "ghettoptt",
"home-manager": "home-manager",
"huecli": "huecli",
"natstonotify": "natstonotify",
"nix-packages": "nix-packages",
"nixpkgs": "nixpkgs",
"nixpkgs-small": "nixpkgs-small",
"nixpkgs-stable": "nixpkgs-stable",
"nixprstatus": "nixprstatus",
"sops-nix": "sops-nix"
@@ -283,11 +342,11 @@
]
},
"locked": {
"lastModified": 1770145881,
"narHash": "sha256-ktjWTq+D5MTXQcL9N6cDZXUf9kX8JBLLBLT0ZyOTSYY=",
"lastModified": 1731954233,
"narHash": "sha256-vvXx1m2Rsw7MkbKJdpcICzz4YPgZPApGKQGhNZfkhOI=",
"owner": "Mic92",
"repo": "sops-nix",
"rev": "17eea6f3816ba6568b8c81db8a4e6ca438b30b7c",
"rev": "e39947d0ee8e341fa7108bd02a33cdfa24a1360e",
"type": "github"
},
"original": {
@@ -296,53 +355,135 @@
"type": "github"
}
},
"uv2nix": {
"inputs": {
"nixpkgs": [
"huecli",
"nixpkgs"
],
"pyproject-nix": [
"huecli",
"pyproject-nix"
]
},
"systems": {
"locked": {
"lastModified": 1757925761,
"narHash": "sha256-7Hwz0vfHuFqCo5v7Q07GQgLBWuPvZCuf/5/pk4NoADg=",
"owner": "pyproject-nix",
"repo": "uv2nix",
"rev": "780494c40895bb7419a73d942bee326291e80b3b",
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
"owner": "nix-systems",
"repo": "default",
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
"type": "github"
},
"original": {
"owner": "pyproject-nix",
"repo": "uv2nix",
"owner": "nix-systems",
"repo": "default",
"type": "github"
}
},
"uv2nix_2": {
"inputs": {
"nixpkgs": [
"nixprstatus",
"nixpkgs"
],
"pyproject-nix": [
"nixprstatus",
"pyproject-nix"
]
},
"systems_2": {
"locked": {
"lastModified": 1767701098,
"narHash": "sha256-CJhKZnWb3gumR9oTRjFvCg/6lYTGbZRU7xtvcyWIRwU=",
"owner": "pyproject-nix",
"repo": "uv2nix",
"rev": "9d357f0d2ce6f5f35ec7959d7e704452352eb4da",
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
"owner": "nix-systems",
"repo": "default",
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
"type": "github"
},
"original": {
"owner": "pyproject-nix",
"repo": "uv2nix",
"owner": "nix-systems",
"repo": "default",
"type": "github"
}
},
"systems_3": {
"locked": {
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
"owner": "nix-systems",
"repo": "default",
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
"type": "github"
},
"original": {
"id": "systems",
"type": "indirect"
}
},
"systems_4": {
"locked": {
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
"owner": "nix-systems",
"repo": "default",
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default",
"type": "github"
}
},
"systems_5": {
"locked": {
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
"owner": "nix-systems",
"repo": "default",
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default",
"type": "github"
}
},
"systems_6": {
"locked": {
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
"owner": "nix-systems",
"repo": "default",
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
"type": "github"
},
"original": {
"id": "systems",
"type": "indirect"
}
},
"treefmt-nix": {
"inputs": {
"nixpkgs": [
"huecli",
"poetry2nix",
"nixpkgs"
]
},
"locked": {
"lastModified": 1719749022,
"narHash": "sha256-ddPKHcqaKCIFSFc/cvxS14goUhCOAwsM1PbMr0ZtHMg=",
"owner": "numtide",
"repo": "treefmt-nix",
"rev": "8df5ff62195d4e67e2264df0b7f5e8c9995fd0bd",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "treefmt-nix",
"type": "github"
}
},
"treefmt-nix_2": {
"inputs": {
"nixpkgs": [
"nixprstatus",
"poetry2nix",
"nixpkgs"
]
},
"locked": {
"lastModified": 1727984844,
"narHash": "sha256-xpRqITAoD8rHlXQafYZOLvUXCF6cnZkPfoq67ThN0Hc=",
"owner": "numtide",
"repo": "treefmt-nix",
"rev": "4446c7a6fc0775df028c5a3f6727945ba8400e64",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "treefmt-nix",
"type": "github"
}
}

View File

@@ -2,8 +2,10 @@
description = "Torjus nixos config flake";
inputs = {
nixpkgs-stable.url = "github:nixos/nixpkgs?ref=nixos-25.05";
nixpkgs-stable.url = "github:nixos/nixpkgs?ref=nixos-24.11";
#nixpkgs-master.url = "github:nixos/nixpkgs?ref=master";
nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-unstable";
nixpkgs-small.url = "github:nixos/nixpkgs?ref=nixos-unstable-small";
home-manager = {
url = "github:nix-community/home-manager";
inputs.nixpkgs.follows = "nixpkgs";
@@ -11,6 +13,7 @@
sops-nix = {
url = "github:Mic92/sops-nix";
inputs.nixpkgs.follows = "nixpkgs";
#inputs.nixpkgs-stable.follows = "nixpkgs-stable";
};
ghettoptt = {
url = "git+https://git.t-juice.club/torjus/ghettoptt?ref=master";
@@ -28,22 +31,19 @@
url = "git+https://git.t-juice.club/torjus/nixprstatus?ref=master";
inputs.nixpkgs.follows = "nixpkgs";
};
natstonotify = {
url = "git+https://git.t-juice.club/torjus/natstonotify?ref=master";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs =
{
self,
nixpkgs,
# nixpkgs-master,
nixpkgs-stable,
nixpkgs-small,
nixprstatus,
sops-nix,
ghettoptt,
huecli,
natstonotify,
nix-packages,
...
}@inputs:
@@ -56,6 +56,23 @@
config.allowUnfree = true;
};
};
overlay-pyside6 =
final: prev:
let
small = import nixpkgs-small {
inherit system;
config.allowUnfree = true;
};
in
{
python312Packages = small.lib.warn "Using python312Packages from nixos-unstable-small #" small.python312Packages;
};
# overlay-master = final: prev: {
# master = import nixpkgs-master {
# inherit system;
# config.allowUnfree = true;
# };
# };
allSystems = [
"x86_64-linux"
"aarch64-linux"
@@ -67,16 +84,31 @@
commonOverlays = [
overlay-stable
# overlay-master
overlay-pyside6
ghettoptt.overlays.default
huecli.overlays.default
nix-packages.overlays.default
nixprstatus.overlays.default
natstonotify.overlays.default
];
in
{
formatter.${system} = nixpkgs.legacyPackages.${system}.nixfmt-tree;
nixosConfigurations = {
prismo = nixpkgs.lib.nixosSystem {
inherit system;
specialArgs = {
inherit inputs self user;
};
modules = [
(
{ config, pkgs, ... }:
{
nixpkgs.overlays = commonOverlays;
}
)
./hosts/prismo
sops-nix.nixosModules.sops
];
};
magicman = nixpkgs.lib.nixosSystem {
inherit system;
specialArgs = {

View File

@@ -5,28 +5,24 @@
enable = true;
defaultEditor = true;
vimAlias = true;
extraPackages = with pkgs; [
nodePackages_latest.nodejs
];
plugins = with pkgs.vimPlugins; [
catppuccin-nvim
cmp-buffer
cmp-cmdline
cmp-nvim-lsp
cmp_luasnip
copilot-cmp
copilot-lua
lsp-zero-nvim
lualine-nvim
luasnip
nvim-cmp
nvim-lspconfig
plenary-nvim
telescope-nvim
undotree
vim-floaterm
vim-fugitive
undotree
telescope-nvim
nvim-cmp
cmp-nvim-lsp
nvim-lspconfig
lsp-zero-nvim
vim-floaterm
luasnip
cmp_luasnip
lualine-nvim
vim-sleuth
copilot-lua
copilot-cmp
cmp-cmdline
cmp-buffer
catppuccin-nvim
(nvim-treesitter.withPlugins (p: [
p.tree-sitter-yaml
p.tree-sitter-nix
@@ -43,16 +39,16 @@
p.tree-sitter-markdown-inline
]))
];
initLua = ''
${builtins.readFile ./plugins.lua}
extraLuaConfig = ''
${builtins.readFile ./options.lua}
${builtins.readFile ./plugins.lua}
${builtins.readFile ./keybinds.lua}
'';
};
};
home.packages = with pkgs; [
# nix stuff
nixfmt
nixfmt-rfc-style
statix
# LSPs

View File

@@ -1,5 +1,4 @@
-- Keybinds
vim.keymap.set("n", "<Leader>ds", vim.diagnostic.open_float, { desc = "Show diagnostic" })
-- Term
vim.g.floaterm_keymap_toggle = '<leader>ft'

View File

@@ -11,8 +11,3 @@ vim.o.relativenumber = true
vim.o.tabstop = 4
vim.o.shiftwidth = 4
vim.o.expandtab = true
vim.o.termguicolors = true
vim.o.list = true
vim.o.listchars = 'tab:» ,trail:·,extends:»,precedes:«,nbsp:␣'

View File

@@ -17,11 +17,12 @@ lsp_zero.format_on_save({
['gopls'] = { 'go' },
['nil_ls'] = { 'nix' },
['lua_ls'] = { 'lua' },
['ts_ls'] = { 'typescript', 'javascript', 'typescriptreact' },
['ts_ls'] = { 'typescript', 'javascript' },
},
})
-- LSP: go
vim.lsp.config("gopls", {
local lspconfig = require('lspconfig')
lspconfig.gopls.setup({
settings = {
gopls = {
analyses = {
@@ -32,7 +33,6 @@ vim.lsp.config("gopls", {
}
}
})
vim.lsp.enable({ "gopls" })
-- GO: Automatically organize imports on save
vim.api.nvim_create_autocmd("BufWritePre", {
@@ -59,7 +59,7 @@ vim.api.nvim_create_autocmd("BufWritePre", {
})
-- LSP: nix
vim.lsp.config("nil_ls", {
lspconfig.nil_ls.setup({
autostart = true,
settings = {
['nil'] = {
@@ -69,10 +69,9 @@ vim.lsp.config("nil_ls", {
},
},
})
vim.lsp.enable({ "nil_ls" })
-- LSP: lua
vim.lsp.config("lua_ls", {
lspconfig.lua_ls.setup({
on_init = function(client)
local path = client.workspace_folders[1].name
if vim.loop.fs_stat(path .. '/.luarc.json') or vim.loop.fs_stat(path .. '/.luarc.jsonc') then
@@ -111,11 +110,9 @@ vim.lsp.config("lua_ls", {
}
}
})
vim.lsp.enable({ "lua_ls" })
-- LSP: ts/js
vim.lsp.config("ts_ls", {
lspconfig.ts_ls.setup({
init_options = {
plugins = {
},
@@ -123,16 +120,18 @@ vim.lsp.config("ts_ls", {
filetypes = {
"typescript",
"javascript",
"typescriptreact",
},
})
vim.lsp.enable({ "ts_ls" })
-- LSP: rust
lspconfig.rust_analyzer.setup {
}
-- LSP: python
-- Ruff server
vim.lsp.config("ruff", {
lspconfig.ruff.setup({
})
vim.lsp.enable({ "ruff" })
-- Ruff: automatically format on save
vim.api.nvim_create_autocmd("BufWritePre", {
@@ -159,7 +158,7 @@ vim.api.nvim_create_autocmd("LspAttach", {
})
-- Pyright
vim.lsp.config("pyright", {
lspconfig.pyright.setup {
settings = {
pyright = {
-- Using Ruff's import organizer
@@ -172,8 +171,13 @@ vim.lsp.config("pyright", {
},
},
},
})
vim.lsp.enable({ "pyright" })
}
-- LSP: C/C++
lspconfig.clangd.setup({})
-- LSP: zig
lspconfig.zls.setup({})
-- Telescope
require('telescope').setup({
@@ -188,7 +192,7 @@ require('telescope').setup({
})
-- Tresitter stuff
require('nvim-treesitter').setup {
require('nvim-treesitter.configs').setup {
ensure_installed = {},
auto_install = false,
highlight = { enable = true },
@@ -293,6 +297,6 @@ cmp.setup({
-- Colorscheme
require('catppuccin').setup {
}
require('catppuccin').setup({
})
vim.cmd.colorscheme "catppuccin"

49
home/gunter.nix Normal file
View File

@@ -0,0 +1,49 @@
{
pkgs,
inputs,
user,
...
}:
{
imports = [ inputs.home-manager.nixosModules.home-manager ];
home-manager = {
useUserPackages = true;
useGlobalPkgs = true;
extraSpecialArgs = {
inherit pkgs inputs user;
};
users.${user} =
{ pkgs, ... }:
{
imports = [
inputs.sops-nix.homeManagerModules.sops
./editor/neovim
./hyprland/gunter.nix
./packages
./programs/dunst
./programs/git
./programs/firefox
./programs/kitty
./programs/obs-studio
./programs/rofi
./programs/tmux
./programs/vscode
./scripts
./services/backup-home.nix
./services/ghettoptt.nix
./sops
./ssh
./zsh
];
firefox.enable = true;
tmux.enable = true;
hyprland.enable = true;
home = {
username = "${user}";
homeDirectory = "/home/${user}";
stateVersion = "23.11";
};
programs.home-manager.enable = true;
};
};
}

View File

@@ -1,116 +0,0 @@
{
pkgs,
inputs,
user,
...
}:
{
imports = [ inputs.home-manager.nixosModules.home-manager ];
home-manager = {
useUserPackages = true;
useGlobalPkgs = true;
extraSpecialArgs = {
inherit pkgs inputs user;
};
users.${user} =
{ pkgs, ... }:
{
imports = [
inputs.sops-nix.homeManagerModules.sops
../../editor/neovim
../../hyprland
../../packages
../../programs/dunst
../../programs/git
../../programs/firefox
../../programs/kitty
../../programs/obs-studio
../../programs/rofi
../../programs/streamcontroller
../../programs/tmux
../../programs/vscode
../../scripts
../../services/backup-home.nix
../../services/ghettoptt.nix
../../services/natstonotify.nix
../../sops
../../ssh
../../zsh
];
firefox.enable = true;
tmux.enable = true;
hyprland.enable = true;
hyprland.monitors = [
"$mon_top,1920x1080@60,2560x0,1"
"$mon_left,2560x1440@75,0x1080,1"
"$mon_center,2560x1440@120,2560x1080,1"
"$mon_right,2560x1440@75,5120x1080,1"
];
hyprland.extraEnv = [
"LIBVA_DRIVER_NAME,nvidia"
"GBM_BACKEND,nvidia-drm"
"WLR_NO_HARDWARE_CURSORS,1"
];
hyprland.enableGrimblast = true;
streamcontroller.enable = true;
hyprland.enableWacom = true;
hyprland.cursorNoHardware = true;
hyprland.extraWorkspaces = [
"name:T1, monitor:$mon_top, persistent:true, default:true"
"name:T2, monitor:$mon_top, persistent:true, default:false"
"name:L1, monitor:$mon_left, persistent:true, default:true"
"name:L2, monitor:$mon_left, persistent:true, default:false"
"name:R1, monitor:$mon_right, persistent:true, default:true"
"name:R2, monitor:$mon_right, persistent:true, default:false"
"name:c1, monitor:$mon_center, persistent:true, default:true"
"name:c2, monitor:$mon_center, persistent:true, default:false"
"name:c3, monitor:$mon_center, persistent:true, default:false"
"name:c4, monitor:$mon_center, persistent:true, default:false"
];
hyprland.monitorVariables = {
"$mon_top" = "desc:BNQ G2420HDBL T2B04424SL000";
"$mon_left" = "desc:Samsung Electric Company LS27A600U HNMT502389";
"$mon_center" = "desc:Acer Technologies XB271HU #ASPVEKfgZ8Dd";
"$mon_right" = "desc:Samsung Electric Company LS27A600U HNMT502390";
};
hyprland.extraKeybinds = [
"$mainMod,Print,exec,grimblast save active ~/tmp/$(date -Iseconds).png"
"$shiftMainMod,Print,exec,grimblast copy area"
",Print,exec,grimblast copy active"
"$mainMod,v,exec,sleep 0.5s && wl-paste | wtype -"
# Workspace keybinds
"$mainMod,1,workspace,name:c1"
"$mainMod,2,workspace,name:c2"
"$mainMod,3,workspace,name:c3"
"$mainMod,4,workspace,name:c4"
"$mainMod,5,workspace,5"
"$mainMod,6,workspace,6"
"$shiftMainMod,1,movetoworkspace,name:c1"
"$shiftMainMod,2,movetoworkspace,name:c2"
"$shiftMainMod,3,movetoworkspace,name:c3"
"$shiftMainMod,4,movetoworkspace,name:c4"
"$shiftMainMod,5,movetoworkspace,5"
"$shiftMainMod,6,movetoworkspace,6"
];
home = {
username = "${user}";
homeDirectory = "/home/${user}";
stateVersion = "23.11";
};
programs.home-manager.enable = true;
# Custom options
torjus.home.obs = {
enable = true;
withCuda = true;
};
};
};
}

View File

@@ -1,65 +0,0 @@
{
pkgs,
inputs,
user,
...
}:
{
imports = [ inputs.home-manager.nixosModules.home-manager ];
home-manager = {
useUserPackages = true;
useGlobalPkgs = true;
extraSpecialArgs = {
inherit pkgs inputs user;
};
users.${user} =
{ pkgs, ... }:
{
imports = [
inputs.sops-nix.homeManagerModules.sops
../../sops
../../editor/neovim
../../programs/firefox
../../programs/tmux
../../programs/dunst
../../programs/kitty
../../programs/rofi
../../programs/obs-studio
../../programs/vscode
../../programs/pywal
../../scripts
../../scripts/batlvl.nix
../../zsh
../../packages
../../hyprland
../../ssh
];
firefox.enable = true;
tmux.enable = true;
hyprland.enable = true;
hyprland.monitors = [ "eDP-1,1920x1080@60,0x0,1" ];
hyprland.extraKeybinds = [
# Workspace keybinds
"$mainMod,1,workspace,1"
"$mainMod,2,workspace,2"
"$mainMod,3,workspace,3"
"$mainMod,4,workspace,4"
"$mainMod,5,workspace,5"
"$mainMod,6,workspace,6"
"$shiftMainMod,1,movetoworkspace,1"
"$shiftMainMod,2,movetoworkspace,2"
"$shiftMainMod,3,movetoworkspace,3"
"$shiftMainMod,4,movetoworkspace,4"
"$shiftMainMod,5,movetoworkspace,5"
"$shiftMainMod,6,movetoworkspace,6"
];
home = {
username = "${user}";
homeDirectory = "/home/${user}";
stateVersion = "23.11";
};
torjus.home.obs.enable = true;
programs.home-manager.enable = true;
};
};
}

View File

@@ -1,297 +0,0 @@
{
pkgs,
lib,
config,
...
}:
with lib;
let
cfg = config.hyprland;
in
{
imports = [ ./waybar ];
options.hyprland = {
enable = mkEnableOption "Hyprland";
monitors = mkOption {
type = types.listOf types.str;
default = [ ];
example = [ "eDP-1,1920x1080@60,0x0,1" ];
description = "Hyprland monitor configuration";
};
extraEnv = mkOption {
type = types.listOf types.str;
default = [ ];
example = [
"LIBVA_DRIVER_NAME,nvidia"
"GBM_BACKEND,nvidia-drm"
];
description = "Extra environment variables for Hyprland";
};
enableGrimblast = mkEnableOption "grimblast screenshot keybinds";
enableWacom = mkEnableOption "Wacom tablet device configuration";
extraKeybinds = mkOption {
type = types.listOf types.str;
default = [ ];
example = [
"$mainMod,Print,exec,grimblast save active ~/tmp/screenshot.png"
];
description = "Extra keybinds for Hyprland";
};
extraWorkspaces = mkOption {
type = types.listOf types.str;
default = [ ];
example = [
"1, monitor:eDP-1, persistent:true, default:true"
"2, monitor:eDP-1, persistent:true"
];
description = "Extra workspace definitions for Hyprland";
};
monitorVariables = mkOption {
type = types.attrsOf types.str;
default = { };
example = {
"$mon_top" = "desc:BNQ G2420HDBL T2B04424SL000";
"$mon_left" = "desc:Samsung Electric Company LS27A600U HNMT502389";
};
description = "Monitor name variables for workspace configuration";
};
cursorNoHardware = mkEnableOption "disable hardware cursors";
};
config = mkIf cfg.enable {
home.packages =
with pkgs;
[
dunst
hyprpaper
rofi
slurp
swww
waybar
wl-clipboard
catppuccin-cursors.macchiatoLavender
bibata-cursors
libsForQt5.qt5.qtwayland
libsForQt5.qt5ct
]
++ optional cfg.enableGrimblast grimblast;
services.hyprpaper = {
enable = true;
settings = {
splash = false;
};
};
services.hypridle = {
enable = true;
settings = {
general = {
lock_cmd = "${pkgs.hyprlock}/bin/hyprlock";
ignore_dbus_inhibit = false;
};
listener = {
timeout = 240;
on-timeout = config.services.hypridle.settings.general.lock_cmd;
before_sleep_cmd = config.services.hypridle.settings.general.lock_cmd;
};
};
};
programs.hyprlock = {
enable = true;
settings = {
background = [
{
monitor = "";
path = "screenshot";
color = "rgba(17, 17, 17, 1.0)";
blur_passes = 3;
contrast = 0.8916;
brightness = 0.8172;
vibrancy = 0.1696;
vibrancy_darkness = 0.0;
}
];
general = {
grace = 0;
};
input-field = [
{
size = "250, 60";
outline_thickness = 2;
dots_size = 0.2;
dots_spacing = 0.2;
dots_center = true;
outer_color = "rgba(0, 0, 0, 0)";
inner_color = "rgba(0, 0, 0, 0.5)";
font_color = "rgb(200, 200, 200)";
fade_on_empty = false;
font_family = "JetBrains Mono Nerd Font Mono";
placeholder_text = "<i><span foreground=\"##cdd6f4\">Input Password...</span></i>";
hide_input = false;
position = "0, -120";
halign = "center";
valign = "center";
}
];
label = [
{
text = "cmd[update:2000] echo \"$(date +\"%b %d %H:%M\")\"";
color = "rgba(255, 255, 255, 0.6)";
font_size = 120;
font_family = "JetBrains Mono Nerd Font Mono ExtraBold";
position = "0, -300";
halign = "center";
valign = "top";
}
];
};
};
wayland.windowManager.hyprland = {
enable = true;
package = pkgs.hyprland;
systemd.enable = false;
settings = {
"$mainMod" = "SUPER";
"$shiftMainMod" = "SUPER_SHIFT";
"$term" = "kitty";
}
// cfg.monitorVariables
// {
monitor = cfg.monitors;
input = {
kb_layout = "no";
follow_mouse = 1;
};
device = optional cfg.enableWacom {
name = "wacom-one-by-wacom-m-pen";
};
cursor = optionalAttrs cfg.cursorNoHardware {
no_hardware_cursors = true;
};
env = [ "XDG_SESSION_TYPE,wayland" ] ++ cfg.extraEnv;
decoration = {
rounding = 10;
blur = {
enabled = true;
size = 3;
passes = 1;
xray = true;
};
};
general = {
gaps_in = 4;
gaps_out = 10;
border_size = 2;
layout = "dwindle";
};
animations = {
enabled = true;
bezier = "myBezier, 0.05, 0.9, 0.1, 1.05";
animation = [
"windows, 1, 7, myBezier"
"windowsOut, 1, 7, default, popin 80%"
"border, 1, 10, default"
"borderangle, 1, 8, default"
"fade, 1, 7, default"
"workspaces, 1, 6, default"
"specialWorkspace, 1, 4, default, fade"
];
};
dwindle = {
pseudotile = true;
preserve_split = true;
special_scale_factor = 0.85;
};
master = {
new_status = "master";
};
misc = {
force_default_wallpaper = 0;
disable_hyprland_logo = true;
};
ecosystem = {
no_update_news = true;
};
windowrule = [
{
name = "terminal_opacity";
"match:class" = "kitty";
opacity = 0.9;
}
];
workspace = [
"special:special, on-created-empty:kitty, rounding:true, decorate:false, border:false"
]
++ cfg.extraWorkspaces;
bindm = [
"$mainMod,mouse:272,movewindow"
"$shiftMainMod,mouse:272,resizewindow"
];
bind = [
# term
"$mainMod,Return,exec,$term"
# rofi
"$mainMod,D,exec,rofi-launcher"
"$mainMod,P,exec,rofi-rbw"
# hyprlock
"$shiftMainMod,l,exec,${pkgs.hyprlock}/bin/hyprlock"
# hyprland
"$mainMod,Q,killactive,"
"CTRLALT,Delete,exit,"
"$mainMod,Space,togglefloating,"
"$mainMod,F,fullscreen,"
# focus
"$mainMod,l,movefocus,l"
"$mainMod,h,movefocus,r"
"$mainMod,k,movefocus,u"
"$mainMod,j,movefocus,d"
# move
"$mainMod,h,movewindow,l"
"$mainMod,l,movewindow,r"
"$mainMod,k,movewindow,u"
"$mainMod,j,movewindow,d"
# Force opacity
"$shiftMainMod,o,exec, hl-no-opacity"
]
++ cfg.extraKeybinds
++ [
# Special workspace
"$mainMod,c,togglespecialworkspace"
"$shiftMainMod,c,movetoworkspace, special"
];
exec-once = [ ];
};
};
};
}

8
home/hyprland/gunter.nix Normal file
View File

@@ -0,0 +1,8 @@
{
imports = [
./hyprland_gunter.nix
./waybar
./xdg.nix
./cursor.nix
];
}

View File

@@ -0,0 +1,16 @@
{
config,
osConfig,
pkgs,
...
}:
{
home.packages = with pkgs; [ hypridle ];
xdg.configFile = {
"hypr/hypridle.conf" = {
source = config.lib.file.mkOutOfStoreSymlink ./. + "/hypridle_${osConfig.system.name}.conf";
target = "hypr/hypridle.conf";
};
};
}

View File

@@ -0,0 +1,12 @@
general {
lock_cmd = hyprlock # dbus/sysd lock command (loginctl lock-session)
# unlock_cmd = notify-send "unlock!" # same as above, but unlock
before_sleep_cmd = lockhelper # command ran before sleep
# after_sleep_cmd = # command ran after sleep
ignore_dbus_inhibit = false # whether to ignore dbus-sent idle-inhibit requests (used by e.g. firefox or steam)
}
listener {
timeout = 240 # in seconds
on-timeout = lockhelper # command to run when timeout has passed
}

View File

@@ -0,0 +1,19 @@
general {
lock_cmd = lockhelper # dbus/sysd lock command (loginctl lock-session)
# unlock_cmd = notify-send "unlock!" # same as above, but unlock
before_sleep_cmd = lockhelper # command ran before sleep
# after_sleep_cmd = lockhelper # command ran after sleep
ignore_dbus_inhibit = false # whether to ignore dbus-sent idle-inhibit requests (used by e.g. firefox or steam)
}
listener {
timeout = 240 # in seconds
on-timeout = lockhelper # command to run when timeout has passed
# on-resume = notify-send "Welcome back!" # command to run when activity is detected after timeout has fired.
}
listener {
timeout = 900
on-timeout = systemctl suspend # command to run when timeout has passed
# on-resume = notify-send "Welcome back!" # command to run when activity is detected after timeout has fired.
}

View File

@@ -0,0 +1,230 @@
{
inputs,
pkgs,
lib,
config,
...
}:
{
imports = [
./hyprlock.nix
./hypridle.nix
];
options.hyprland.enable = lib.mkEnableOption "Hyprland";
config = {
home.packages = with pkgs; [
dunst
# hyprlock
hyprpaper
rofi-wayland
slurp
swww
waybar
wl-clipboard
catppuccin-cursors.macchiatoLavender
bibata-cursors
# For potentially fixing some issues
libsForQt5.qt5.qtwayland
libsForQt5.qt5ct
];
wayland.windowManager.hyprland = {
enable = true;
package = pkgs.hyprland;
settings = {
"$mainMod" = "SUPER";
"$shiftMainMod" = "SUPER_SHIFT";
"$term" = "kitty";
# monitors
"$mon_top" = "desc:BNQ G2420HDBL T2B04424SL000";
"$mon_left" = "desc:Samsung Electric Company LS27A600U HNMT502389";
"$mon_center" = "desc:Acer Technologies XB271HU #ASPVEKfgZ8Dd";
"$mon_right" = "desc:Samsung Electric Company LS27A600U HNMT502390";
monitor = [
# "$mon_top,1920x1080@60,2560x0,1" # top T2B04424SL000
"DP-6,1920x1080@60,2560x0,1" # top T2B04424SL000 60
# "$mon_left,2560x1440@75,0x1080,1" # left
"DP-8,2560x1440@75,0x1080,1" # left 75hz
# "$mon_center,2560x1440@120,2560x1080,1" # main #ASPVEKfgZ8Dd
"DP-5,2560x1440@144,2560x1080,1" # main #ASPVEKfgZ8Dd 120hz
# "$mon_right,2560x1440@75,5120x1080,1" # right
"DP-7,2560x1440@75,5120x1080,1" # right 75hz
];
input = {
kb_layout = "no";
follow_mouse = 1;
};
cursor = {
no_hardware_cursors = true;
};
env = [
"LIBVA_DRIVER_NAME,nvidia"
"XDG_SESSION_TYPE,wayland"
"GBM_BACKEND,nvidia-drm"
# "__GLX_VENDOR_LIBRARY_NAME,nvidia"
"WLR_NO_HARDWARE_CURSORS,1"
];
decoration = {
rounding = 10;
drop_shadow = true;
shadow_range = 4;
shadow_render_power = 3;
blur = {
enabled = true;
size = 3;
passes = 1;
xray = true;
};
};
general = {
gaps_in = 4;
gaps_out = 10;
border_size = 2;
layout = "dwindle";
};
animations = {
enabled = true;
bezier = [
"myBezier, 0.05, 0.9, 0.1, 1.05"
"easeInB, 0.6, -0.28, 0.735, 0.045"
];
animation = [
"windows, 1, 7, myBezier"
"windowsOut, 1, 7, default, popin 80%"
"border, 1, 10, default"
"borderangle, 1, 8, default"
"fade, 1, 7, default"
"workspaces, 1, 6, easeInB, slidefadevert"
"specialWorkspace, 1, 4, default, fade"
];
};
dwindle = {
pseudotile = true;
preserve_split = true;
special_scale_factor = 0.85;
};
master = {
new_status = "master";
};
misc = {
force_default_wallpaper = 0;
disable_hyprland_logo = true;
};
windowrulev2 = [
"opacity 0.95 override 0.7 override,class:^(Alacritty)$"
"opacity 0.95 override 0.7 override,class:^(kitty)$"
];
workspace = [
"name:T1, monitor:$mon_top, persistent:true, default:true"
"name:T2, monitor:$mon_top, persistent:true, default:false"
"name:L1, monitor:$mon_left, persistent:true, default:true"
"name:L2, monitor:$mon_left, persistent:true, default:false"
"name:R1, monitor:$mon_right, persistent:true, default:true"
"name:R2, monitor:$mon_right, persistent:true, default:false"
"name:c1, monitor:$mon_center, persistent:true, default:true"
"name:c2, monitor:$mon_center, persistent:true, default:false"
"name:c3, monitor:$mon_center, persistent:true, default:false"
"name:c4, monitor:$mon_center, persistent:true, default:false"
"special:special, on-created-empty:kitty, rounding:true, decorate:false, border:false"
];
bindm = [
"$mainMod,mouse:272,movewindow"
"$shiftMainMod,mouse:272,resizewindow"
];
bindr = [
# mumble ptt release
# ",code:202,exec,mumble rpc stoptalking"
# ",code:202,exec,pamixer --source 63 -m"
# ",code:202,exec,sleep 0.5 && pamixer --default-source -m"
];
bind = [
# term
"$mainMod,Return,exec,$term"
# hyprlock
"$shiftMainMod,l,exec,lockhelper"
# rofi
"$mainMod,D,exec,rofi-launcher"
"$mainMod,P,exec,rofi-rbw"
# hyprland
"$mainMod,Q,killactive,"
"CTRLALT,Delete,exit,"
"$mainMod,Space,togglefloating,"
"$mainMod,F,fullscreen,"
# focus
"$mainMod,l,movefocus,l"
"$mainMod,h,movefocus,r"
"$mainMod,k,movefocus,u"
"$mainMod,j,movefocus,d"
# move
"$mainMod,h,movewindow,l"
"$mainMod,l,movewindow,r"
"$mainMod,k,movewindow,u"
"$mainMod,j,movewindow,d"
# Force opacity
"$shiftMainMod,o,exec, hl-no-opacity"
# grimblast
"$mainMod,Print,exec,grimblast save active ~/tmp/$(date -Iseconds).png"
"$shiftMainMod,Print,exec,grimblast copy area"
",Print,exec,grimblast copy active"
# mumble ptt click
# ",code:202,exec,mumble rpc starttalking"
#",code:202,pass,^(info\.mumble\.Mumble)$"
# ",code:202,exec,pamixer --default-source -u"
",code:202,pass,^discord$"
# Paste to wtype
"$mainMod,v,exec,sleep 0.5s && wl-paste | wtype -"
# worspace switching
"$mainMod,1,workspace,name:c1"
"$mainMod,2,workspace,name:c2"
"$mainMod,3,workspace,name:c3"
"$mainMod,4,workspace,name:c4"
"$mainMod,5,workspace,5"
"$mainMod,6,workspace,6"
# Move window to workspace
"$shiftMainMod,1,movetoworkspace,name:c1"
"$shiftMainMod,2,movetoworkspace,name:c2"
"$shiftMainMod,3,movetoworkspace,name:c3"
"$shiftMainMod,4,movetoworkspace,name:c4"
"$shiftMainMod,5,movetoworkspace,5"
"$shiftMainMod,6,movetoworkspace,6"
# Special workspace
"$mainMod,c,togglespecialworkspace"
"$shiftMainMod,c,movetoworkspace, special"
];
exec-once = [
"waybar"
"hyprpaper & sleep 10 && randomwp"
"easyeffects --gapplication-service"
"hypridle"
"streamcontroller -b"
# "dunst"
];
};
};
};
}

View File

@@ -0,0 +1,171 @@
{
inputs,
pkgs,
lib,
config,
...
}:
{
imports = [
./hyprlock.nix
./hypridle.nix
];
options.hyprland.enable = lib.mkEnableOption "Hyprland";
config = {
home.packages = with pkgs; [
dunst
# hyprlock
hyprpaper
rofi-wayland
slurp
swww
waybar
wl-clipboard
catppuccin-cursors.macchiatoLavender
bibata-cursors
# For potentially fixing some issues
libsForQt5.qt5.qtwayland
libsForQt5.qt5ct
];
wayland.windowManager.hyprland = {
enable = true;
package = pkgs.hyprland;
settings = {
"$mainMod" = "SUPER";
"$shiftMainMod" = "SUPER_SHIFT";
"$term" = "kitty";
monitor = [ "eDP-1,1920x1080@60,0x0,1" ];
input = {
kb_layout = "no";
follow_mouse = 1;
};
env = [ "XDG_SESSION_TYPE,wayland" ];
decoration = {
rounding = 10;
drop_shadow = true;
shadow_range = 4;
shadow_render_power = 3;
blur = {
enabled = true;
size = 3;
passes = 1;
xray = true;
};
};
general = {
gaps_in = 4;
gaps_out = 10;
border_size = 2;
layout = "dwindle";
};
animations = {
enabled = true;
bezier = "myBezier, 0.05, 0.9, 0.1, 1.05";
animation = [
"windows, 1, 7, myBezier"
"windowsOut, 1, 7, default, popin 80%"
"border, 1, 10, default"
"borderangle, 1, 8, default"
"fade, 1, 7, default"
"workspaces, 1, 6, default"
"specialWorkspace, 1, 4, default, fade"
];
};
dwindle = {
pseudotile = true;
preserve_split = true;
special_scale_factor = 0.85;
};
master = {
new_status = "master";
};
misc = {
force_default_wallpaper = 0;
disable_hyprland_logo = true;
};
windowrulev2 = [
"opacity 0.95 override 0.7 override,class:^(Alacritty)$"
"opacity 0.95 override 0.7 override,class:^(kitty)$"
];
workspace = [
"special:special, on-created-empty:kitty, rounding:true, decorate:false, border:false"
];
bindm = [ "ALT,mouse:272,movewindow" ];
bindr = [
# mumble ptt release
# ",code:202,exec,mumble rpc stoptalking"
# ",code:202,exec,pamixer --source 63 -m"
# ",code:202,exec,sleep 0.5 && pamixer --default-source -m"
];
bind = [
# term
"$mainMod,Return,exec,$term"
# rofi
"$mainMod,D,exec,rofi-launcher"
"$mainMod,P,exec,rofi-rbw"
# hyprlock
"$shiftMainMod,l,exec,lockhelper"
# hyprland
"$mainMod,Q,killactive,"
"CTRLALT,Delete,exit,"
"$mainMod,Space,togglefloating,"
"$mainMod,F,fullscreen,"
# focus
"$mainMod,l,movefocus,l"
"$mainMod,h,movefocus,r"
"$mainMod,k,movefocus,u"
"$mainMod,j,movefocus,d"
# move
"$mainMod,h,movewindow,l"
"$mainMod,l,movewindow,r"
"$mainMod,k,movewindow,u"
"$mainMod,j,movewindow,d"
# Force opacity
"$shiftMainMod,o,exec, hl-no-opacity"
# mumble ptt click
# ",code:202,exec,mumble rpc starttalking"
#",code:202,pass,^(info\.mumble\.Mumble)$"
# ",code:202,exec,pamixer --default-source -u"
# ",code:202,pass,^discord$"
# worspace switching
"$mainMod,1,workspace,1"
"$mainMod,2,workspace,2"
"$mainMod,3,workspace,3"
"$mainMod,4,workspace,4"
"$mainMod,5,workspace,5"
"$mainMod,6,workspace,6"
# Special workspace
"$mainMod,c,togglespecialworkspace"
"$shiftMainMod,c,movetoworkspace, special"
];
exec-once = [
"waybar"
"hyprpaper & sleep 2 && randomwp"
"hypridle"
# "dunst"
];
};
};
};
}

View File

@@ -0,0 +1,159 @@
{
inputs,
pkgs,
lib,
config,
...
}:
{
options.hyprland.enable = lib.mkEnableOption "Hyprland";
config = {
home.packages = with pkgs; [
dunst
# hyprlock
hyprpaper
rofi-wayland
slurp
swww
waybar
wl-clipboard
catppuccin-cursors.macchiatoLavender
bibata-cursors
# For potentially fixing some issues
libsForQt5.qt5.qtwayland
libsForQt5.qt5ct
];
wayland.windowManager.hyprland = {
enable = true;
package = pkgs.hyprland;
settings = {
"$mainMod" = "SUPER";
"$shiftMainMod" = "SUPER_SHIFT";
"$term" = "kitty";
monitor = [ ];
input = {
kb_layout = "no";
follow_mouse = 1;
};
env = [ "XDG_SESSION_TYPE,wayland" ];
decoration = {
rounding = 0;
drop_shadow = true;
shadow_range = 4;
shadow_render_power = 3;
blur = {
enabled = true;
size = 3;
passes = 1;
xray = true;
};
};
general = {
gaps_in = 4;
gaps_out = 10;
border_size = 2;
layout = "dwindle";
};
animations = {
enabled = true;
bezier = "myBezier, 0.05, 0.9, 0.1, 1.05";
animation = [
"windows, 1, 7, myBezier"
"windowsOut, 1, 7, default, popin 80%"
"border, 1, 10, default"
"borderangle, 1, 8, default"
"fade, 1, 7, default"
"workspaces, 1, 6, default"
];
};
dwindle = {
pseudotile = true;
preserve_split = true;
};
master = {
new_status = "master";
};
misc.force_default_wallpaper = -1;
windowrulev2 = [
"opacity 0.95 override 0.7 override,class:^(Alacritty)$"
"opacity 0.95 override 0.7 override,class:^(kitty)$"
];
workspace = [
"name:mumble, monitor:$mon_top, persistent:true, default:true"
"name:left, monitor:$mon_left, persistent:true, default:true"
"name:right, monitor:$mon_right, persistent:true, default:true"
"name:main 1, monitor:$mon_center, persistent:true, default:true"
"name:main 2, monitor:$mon_center, persistent:true, default:true"
];
bindm = [ "ALT,mouse:272,movewindow" ];
bindr = [
# mumble ptt release
# ",code:202,exec,mumble rpc stoptalking"
# ",code:202,exec,pamixer --source 63 -m"
# ",code:202,exec,sleep 0.5 && pamixer --default-source -m"
];
bind = [
# term
"$mainMod,Return,exec,$term"
# rofi
"$mainMod,D,exec,rofi-launcher"
"$mainMod,P,exec,rofi-rbw"
# hyprland
"$mainMod,Q,killactive,"
"CTRLALT,Delete,exit,"
"$mainMod,Space,togglefloating,"
"$mainMod,F,fullscreen,"
# focus
"$mainMod,l,movefocus,l"
"$mainMod,h,movefocus,r"
"$mainMod,k,movefocus,u"
"$mainMod,j,movefocus,d"
# move
"$mainMod,h,movewindow,l"
"$mainMod,l,movewindow,r"
"$mainMod,k,movewindow,u"
"$mainMod,j,movewindow,d"
# Force opacity
"$shiftMainMod,o,exec, hl-no-opacity"
# mumble ptt click
# ",code:202,exec,mumble rpc starttalking"
#",code:202,pass,^(info\.mumble\.Mumble)$"
# ",code:202,exec,pamixer --default-source -u"
",code:202,pass,^discord$"
# worspace switching
"$mainMod,1,workspace,name:main 1"
"$mainMod,2,workspace,name:main 2"
"$mainMod,3,workspace,3"
"$mainMod,4,workspace,4"
"$mainMod,5,workspace,5"
"$mainMod,6,workspace,6"
];
exec-once = [
"waybar"
"hyprpaper & sleep 2 && randomwp"
"easyeffects --gapplication-service"
# "dunst"
];
};
};
};
}

View File

@@ -0,0 +1,91 @@
# BACKGROUND
background {
monitor = DP-5
path = /tmp/lockscreen/DP-5.png
blur_passes = 3
contrast = 0.8916
brightness = 0.8172
vibrancy = 0.1696
vibrancy_darkness = 0.0
}
background {
monitor = DP-6
path = /tmp/lockscreen/DP-6.png
blur_passes = 3
contrast = 0.8916
brightness = 0.8172
vibrancy = 0.1696
vibrancy_darkness = 0.0
}
background {
monitor = DP-7
path = /tmp/lockscreen/DP-7.png
blur_passes = 3
contrast = 0.8916
brightness = 0.8172
vibrancy = 0.1696
vibrancy_darkness = 0.0
}
background {
monitor = DP-8
path = /tmp/lockscreen/DP-8.png
blur_passes = 3
contrast = 0.8916
brightness = 0.8172
vibrancy = 0.1696
vibrancy_darkness = 0.0
}
# GENERAL
general {
no_fade_in = false
grace = 0
disable_loading_bar = true
}
# INPUT FIELD
input-field {
monitor =
size = 250, 60
outline_thickness = 2
dots_size = 0.2 # Scale of input-field height, 0.2 - 0.8
dots_spacing = 0.2 # Scale of dots' absolute size, 0.0 - 1.0
dots_center = true
outer_color = rgba(0, 0, 0, 0)
inner_color = rgba(0, 0, 0, 0.5)
font_color = rgb(200, 200, 200)
fade_on_empty = false
font_family = JetBrains Mono Nerd Font Mono
placeholder_text = <i><span foreground="##cdd6f4">Input Password...</span></i>
hide_input = false
position = 0, -120
halign = center
valign = center
}
# TIME
label {
monitor =
text = cmd[update:2000] echo "$(date +"%b %d %H:%M")"
#color = $foreground
color = rgba(255, 255, 255, 0.6)
font_size = 120
font_family = JetBrains Mono Nerd Font Mono ExtraBold
position = 0, -300
halign = center
valign = top
}
## USER
#label {
# monitor =
# text = Hi there, $USER
# color = $foreground
# #color = rgba(255, 255, 255, 0.6)
# font_size = 25
# font_family = JetBrains Mono Nerd Font Mono
# position = 0, -40
# halign = center
# valign = center
#}

View File

@@ -0,0 +1,78 @@
source = ~/.cache/wal/colors-hyprland.conf
# BACKGROUND
background {
monitor =
path = /tmp/lockscreen/eDP-1.png
blur_passes = 3
contrast = 0.8916
brightness = 0.8172
vibrancy = 0.1696
vibrancy_darkness = 0.0
}
# GENERAL
general {
no_fade_in = false
grace = 0
disable_loading_bar = true
}
# INPUT FIELD
input-field {
monitor =
size = 250, 60
outline_thickness = 2
dots_size = 0.2 # Scale of input-field height, 0.2 - 0.8
dots_spacing = 0.2 # Scale of dots' absolute size, 0.0 - 1.0
dots_center = true
outer_color = rgba(0, 0, 0, 0)
inner_color = rgba(0, 0, 0, 0.5)
font_color = rgb(200, 200, 200)
fade_on_empty = false
font_family = JetBrains Mono Nerd Font Mono
placeholder_text = <i><span foreground="##cdd6f4">Input Password...</span></i>
hide_input = false
position = 0, -120
halign = center
valign = center
}
# TIME
label {
monitor =
text = cmd[update:1000] echo "$(date +"%b %d %H:%M")"
color = $foreground
#color = rgba(255, 255, 255, 0.6)
font_size = 120
font_family = JetBrains Mono Nerd Font Mono ExtraBold
position = 0, -300
halign = center
valign = top
}
## USER
#label {
# monitor =
# text = Hi there, $USER
# color = $foreground
# #color = rgba(255, 255, 255, 0.6)
# font_size = 25
# font_family = JetBrains Mono Nerd Font Mono
# position = 0, -40
# halign = center
# valign = center
#}
# Battery level
label {
monitor =
text = cmd[update:1000] echo "$(batlvl)"
color = $foreground
#color = rgba(255, 255, 255, 0.6)
font_size = 18
# font_family = JetBrainsMono, Font Awesome 6 Free Solid
font_family = JetBrains Mono Nerd Font Mono
position = 0, -20
halign = center
valign = bottom
}

View File

@@ -0,0 +1 @@
splash = false

View File

@@ -0,0 +1,8 @@
{
imports = [
./hyprland_magicman.nix
./waybar
./xdg.nix
./cursor.nix
];
}

8
home/hyprland/prismo.nix Normal file
View File

@@ -0,0 +1,8 @@
{
imports = [
./hyprland_prismo.nix
./waybar
./xdg.nix
./cursor.nix
];
}

View File

@@ -6,7 +6,6 @@ from datetime import datetime, date, timedelta
SECRET_DIR = "/home/torjus/.config/sops-nix/secrets"
def sonarr_url():
xdg_dir = os.environ["XDG_RUNTIME_DIR"]
if not xdg_dir:
@@ -14,31 +13,26 @@ def sonarr_url():
with open(f"{SECRET_DIR}/sonarr_base_url") as f:
return f.read().strip()
def radarr_url():
with open(f"{SECRET_DIR}/radarr_base_url") as f:
return f.read().strip()
def make_header(api_key: str):
return {"X-Api-Key": api_key, "Accept": "application/json"}
def get_sonarr_key():
with open(f"{SECRET_DIR}/sonarr_api_key") as f:
return f.read().strip()
def get_radarr_key():
with open(f"{SECRET_DIR}/radarr_api_key") as f:
return f.read().strip()
def get_sonarr_history(since: datetime | None = None):
def get_sonarr_history(since: datetime|None=None):
api_key = get_sonarr_key()
if not since:
since = datetime.combine(date.today() - timedelta(days=1), datetime.min.time())
url = f"{sonarr_url()}/api/v3/history/since"
since = datetime.combine(date.today()-timedelta(days=1),datetime.min.time())
url = f"{sonarr_url()}/api/history/since"
url += f"?date={since.isoformat()}"
response = requests.get(url, headers=make_header(api_key))
response.raise_for_status()
@@ -50,11 +44,10 @@ def get_sonarr_history(since: datetime | None = None):
items.append(item["sourceTitle"])
return items
def get_radarr_history(since: datetime | None = None):
def get_radarr_history(since: datetime|None=None):
api_key = get_radarr_key()
if not since:
since = datetime.combine(date.today() - timedelta(days=7), datetime.min.time())
since = datetime.combine(date.today()-timedelta(days=7),datetime.min.time())
url = f"{radarr_url()}/api/v3/history/since"
url += f"?date={since.isoformat()}"
response = requests.get(url, headers=make_header(api_key))
@@ -67,17 +60,12 @@ def get_radarr_history(since: datetime | None = None):
items.append(item["sourceTitle"])
return items
if __name__ == "__main__":
sonarr_items = get_sonarr_history()
radarr_items = get_radarr_history()
output = {
"text": f"Son: {len(sonarr_items)}|Rad: {len(radarr_items)}",
"tooltip": "Radarr: \n"
+ "\n".join(radarr_items)
+ "\n"
+ "Sonarr: \n"
+ "\n".join(sonarr_items),
"tooltip": "Radarr: \n" + "\n".join(radarr_items) + "\n" + "Sonarr: \n" + "\n".join(sonarr_items)
}
print(json.dumps(output))

View File

@@ -5,6 +5,14 @@
...
}:
let
flakestat = pkgs.writeShellApplication {
name = "flakestat";
runtimeInputs = with pkgs; [
git
jq
];
text = builtins.readFile ./flakestat.sh;
};
arrhist = pkgs.stdenv.mkDerivation {
name = "arrhist";
propagatedBuildInputs = [
@@ -14,9 +22,8 @@ let
dontUnpack = true;
installPhase = "install -Dm755 ${./arrhist.py} $out/bin/arrhist";
};
cfg = osConfig.host.capabilities;
withArrhist = cfg.enableArrhist;
withBattery = cfg.hasBattery;
withArrhist = if (osConfig.system.name == "gunter") then true else false;
withBattery = if (osConfig.system.name == "magicman") then true else false;
in
{
sops.secrets."sonarr_base_url" = { };
@@ -38,7 +45,7 @@ in
programs.waybar = {
enable = true;
systemd = {
enable = true; # disable it,autostart it in hyprland conf
enable = false; # disable it,autostart it in hyprland conf
target = "graphical-session.target";
};
style = ''
@@ -138,6 +145,7 @@ in
#network,
#battery,
#custom-powermenu,
#custom-flakestat,
#custom-arrhist {
padding-left: 12px;
padding-right: 12px;
@@ -154,11 +162,12 @@ in
settings = [
(
let
volInterval = toString cfg.volumeScrollStep;
volInterval = if (osConfig.system.name == "gunter") then "5" else "1";
in
{
"layer" = "top";
"position" = "top";
modules-left = [ "custom/flakestat" ];
modules-center = [ "hyprland/workspaces" ];
modules-right = [
(lib.mkIf (withArrhist) "custom/arrhist")
@@ -236,6 +245,12 @@ in
""
];
};
"custom/flakestat" = {
"exec" = "${flakestat}/bin/flakestat";
"format" = " {}";
"return-type" = "json";
"interval" = 600;
};
}
// lib.optionalAttrs (withArrhist) {
"custom/arrhist" = {

View File

@@ -0,0 +1,55 @@
#!/usr/bin/env bash
set -eo pipefail
# Args:
# $1 text
# $2 tooltip
# $3 error-code
print_output() {
local text="$1"
local tooltip="$2"
local error_code="$3"
if [ -z "$error_code" ]; then
output=$(jq -n \
--arg text "$text" \
--arg tooltip "$tooltip" \
--unbuffered \
--compact-output \
'{text: $text, tooltip: $tooltip}')
else
output=$(jq -n \
--arg text "$text" \
--arg tooltip "$tooltip" \
--unbuffered \
--compact-output \
'{text: $text, tooltip: $tooltip}')
fi
echo "$output"
}
FLAKE_DIR="/home/torjus/nixos"
NIXPKGS_DIR="/home/torjus/git/nixpkgs"
flake_metadata=$(nix flake metadata --json "$FLAKE_DIR" 2>/dev/null)
unstable_input=$(echo "$flake_metadata" | jq '.locks.nodes.root.inputs.nixpkgs')
unstable_rev=$(echo "$flake_metadata" | jq -r ".locks.nodes.$unstable_input.locked.rev")
unstable_branch=$(echo "$flake_metadata" | jq -r ".locks.nodes.$unstable_input.original.ref")
cd "$NIXPKGS_DIR" || print_output "?" "Could not find git repo dir" 1
if ! git fetch -q --all; then
print_output "?" "Unable to fetch commits" 1
exit 1
fi
if ! unstable_commit_count=$(git rev-list --count "$unstable_rev..origin/$unstable_branch"); then
print_output "?" "Unable to list commits" 1
exit 1
fi
text="$unstable_commit_count"
tooltip="${unstable_branch}: ${unstable_commit_count}"
print_output "$text" "$tooltip" 0

9
home/hyprland/xdg.nix Normal file
View File

@@ -0,0 +1,9 @@
{ config, ... }:
{
xdg.configFile = {
"hypr/hyprpaper.conf" = {
source = config.lib.file.mkOutOfStoreSymlink ./. + "/hyprpaper.conf";
target = "hypr/hyprpaper.conf";
};
};
}

37
home/i3/default.nix Normal file
View File

@@ -0,0 +1,37 @@
{
config,
lib,
pkgs,
...
}:
let
mod = "Mod4";
in
{
xsession.windowManager.i3 = {
enable = true;
config = {
modifier = mod;
keybindings = lib.mkOptionDefault {
"${mod}+Enter" = "exec kitty";
# Focus
"${mod}+j" = "focus left";
"${mod}+k" = "focus down";
"${mod}+l" = "focus up";
"${mod}+semicolon" = "focus right";
# Move
"${mod}+Shift+j" = "move left";
"${mod}+Shift+k" = "move down";
"${mod}+Shift+l" = "move up";
"${mod}+Shift+semicolon" = "move right";
# My multi monitor setup
"${mod}+m" = "move workspace to output DP-2";
"${mod}+Shift+m" = "move workspace to output DP-5";
};
};
};
}

49
home/magicman.nix Normal file
View File

@@ -0,0 +1,49 @@
{
pkgs,
inputs,
user,
...
}:
{
imports = [ inputs.home-manager.nixosModules.home-manager ];
home-manager = {
useUserPackages = true;
useGlobalPkgs = true;
extraSpecialArgs = {
inherit pkgs inputs user;
};
users.${user} =
{ pkgs, ... }:
{
imports = [
inputs.sops-nix.homeManagerModules.sops
./sops
./editor/neovim
./programs/firefox
./programs/tmux
./programs/dunst
./programs/kitty
./programs/rofi
./programs/obs-studio
./programs/vscode
./programs/pywal
./programs/zellij
./scripts
./scripts/batlvl.nix
./zsh
./packages
./hyprland/magicman.nix
./ssh
];
firefox.enable = true;
tmux.enable = true;
hyprland.enable = true;
home = {
username = "${user}";
homeDirectory = "/home/${user}";
stateVersion = "23.11";
};
programs.home-manager.enable = true;
};
};
}

View File

@@ -1,19 +1,17 @@
{ pkgs, osConfig, ... }:
let
withCuda = osConfig.host.capabilities.hasCuda;
withCuda = if (osConfig.system.name == "gunter") then true else false;
in
{
imports = [
./zoom.nix
./tacl.nix
];
home.packages = with pkgs; [
# CLI utils
act
age
bat
bzip2
chromium
claude-code
croc
devenv
distrobox
@@ -24,8 +22,10 @@ in
ffmpeg
file
fzf
glib
grimblast
ijq
incus
jq
kitty
kubectl
@@ -35,22 +35,21 @@ in
nvd
nurl
nwg-look
mosh
most
pinentry-gtk2
pinentry
pre-commit
pulseaudio
pulsemixer
rbw
restic
ripgrep
sidequest
sops
sshfs
step-cli
tea
tldr
tokei
unzip
ventoy
wtype
# Non-CLI stuff
@@ -61,27 +60,30 @@ in
mpv
mumble
pamixer
pwvucontrol
(prismlauncher.override {
jdks = [
jdk21
jdk17
jdk8
temurin-jre-bin-25
temurin-jre-bin-17
];
})
rofi-rbw-wayland
spicetify-cli
spotify
tcpdump
virt-manager
# omnissa-horizon-client
vmware-horizon-client
yt-dlp
# k8s tools
cilium-cli
cmctl
k9s
krew
kubernetes-helm
talosctl
# Go stuff
go
gopls
delve
gopls
# js/ts
nodejs
nodePackages.pnpm
typescript
# Py stuff
(python312.withPackages (
@@ -90,7 +92,7 @@ in
ipython
]
))
uv
poetry
ruff
# rust stuff
@@ -104,20 +106,13 @@ in
nixprstatus
# Stuff with overrides
# Btop
(btop.override { cudaSupport = withCuda; })
# PrismLauncher
prismlauncher
# Extract logcli from grafana-loki
(pkgs.linkFarm "logcli" [
{
name = "bin/logcli";
path = "${pkgs.grafana-loki}/bin/logcli";
}
])
(lutris.override {
extraLibraries = pkgs: [
nspr
xorg.libXdamage
];
})
# From nix-packages flake
path-of-building-beta
awakened-poe-trade
];
}

View File

@@ -1,30 +0,0 @@
{ pkgs, ... }:
{
home.packages = [
(pkgs.python3Packages.buildPythonApplication rec {
pname = "tacl";
version = "3.9.0";
pyproject = true;
src = pkgs.fetchFromGitHub {
owner = "unioslo";
repo = "tsd-api-client";
rev = "v${version}";
sha256 = "sha256-R8fSAhpdjspIoLy3m6NnHZBCBTSLQGWOqAiDkBZlWOc=";
};
build-system = with pkgs.python3Packages; [
poetry-core
poetry-dynamic-versioning
];
dependencies = with pkgs.python3Packages; [
pyyaml
click
humanfriendly
libnacl
requests
rich
];
})
];
}

View File

@@ -1,107 +0,0 @@
{
lib,
stdenv,
fetchurl,
makeWrapper,
makeDesktopItem,
copyDesktopItems,
xorg,
gtk2,
sqlite,
openal,
cairo,
libGLU,
SDL2,
freealut,
libglvnd,
pipewire,
libpulseaudio,
dotnet-runtime_8,
}:
stdenv.mkDerivation rec {
pname = "vintagestory";
version = "1.20.0-rc.8";
src = fetchurl {
url = "https://cdn.vintagestory.at/gamefiles/unstable/vs_client_linux-x64_${version}.tar.gz";
hash = "sha256-/MPR6PAkZv93zT6YbJatg67aRYfzp9vFRY82gtVksAs=";
};
nativeBuildInputs = [
makeWrapper
copyDesktopItems
];
buildInputs = [ dotnet-runtime_8 ];
runtimeLibs = lib.makeLibraryPath (
[
gtk2
sqlite
openal
cairo
libGLU
SDL2
freealut
libglvnd
pipewire
libpulseaudio
]
++ (with xorg; [
libX11
libXi
libXcursor
])
);
desktopItems = [
(makeDesktopItem {
name = "vintagestory";
desktopName = "Vintage Story";
exec = "vintagestory";
icon = "vintagestory";
comment = "Innovate and explore in a sandbox world";
categories = [ "Game" ];
})
];
installPhase = ''
runHook preInstall
mkdir -p $out/share/vintagestory $out/bin $out/share/pixmaps $out/share/fonts/truetype
cp -r * $out/share/vintagestory
cp $out/share/vintagestory/assets/gameicon.xpm $out/share/pixmaps/vintagestory.xpm
cp $out/share/vintagestory/assets/game/fonts/*.ttf $out/share/fonts/truetype
runHook postInstall
'';
preFixup = ''
sed -i 's/net7.0/net8.0/' $out/share/vintagestory/Vintagestory.runtimeconfig.json
sed -i 's/7.0.0/8.0.11/' $out/share/vintagestory/Vintagestory.runtimeconfig.json
makeWrapper ${dotnet-runtime_8}/bin/dotnet $out/bin/vintagestory \
--prefix LD_LIBRARY_PATH : "${runtimeLibs}" \
--add-flags $out/share/vintagestory/Vintagestory.dll
makeWrapper ${dotnet-runtime_8}/bin/dotnet $out/bin/vintagestory-server \
--prefix LD_LIBRARY_PATH : "${runtimeLibs}" \
--add-flags $out/share/vintagestory/VintagestoryServer.dll
''
+ ''
find "$out/share/vintagestory/assets/" -not -path "*/fonts/*" -regex ".*/.*[A-Z].*" | while read -r file; do
local filename="$(basename -- "$file")"
ln -sf "$filename" "''${file%/*}"/"''${filename,,}"
done
'';
meta = with lib; {
description = "In-development indie sandbox game about innovation and exploration";
homepage = "https://www.vintagestory.at/";
license = licenses.unfree;
maintainers = with maintainers; [
artturin
gigglesquid
];
};
}

View File

@@ -1,17 +1,16 @@
{ pkgs, lib, ... }:
# let
# version = "6.2.6.2503";
# zoom-override = pkgs.zoom-us.overrideAttrs (old: {
# inherit version;
# src = pkgs.fetchurl {
# url = "https://zoom.us/client/${version}/zoom_x86_64.pkg.tar.xz";
# hash = "sha256-qhymegXkXSl9fK/5klSi5uRPwFVN88QH/5EVGaBUbfc=";
# };
# });
# in
let
version = "6.2.6.2503";
zoom-override = pkgs.zoom-us.overrideAttrs (old: {
inherit version;
src = pkgs.fetchurl {
url = "https://zoom.us/client/${version}/zoom_x86_64.pkg.tar.xz";
hash = "sha256-qhymegXkXSl9fK/5klSi5uRPwFVN88QH/5EVGaBUbfc=";
};
});
in
{
home.packages = [
pkgs.zoom-us
#(lib.warn "Using overridden zoom version" zoom-override)
(lib.warn "Using overridden zoom version" zoom-override)
];
}

48
home/prismo.nix Normal file
View File

@@ -0,0 +1,48 @@
{
pkgs,
inputs,
user,
...
}:
{
imports = [ inputs.home-manager.nixosModules.home-manager ];
home-manager = {
useUserPackages = true;
useGlobalPkgs = true;
extraSpecialArgs = {
inherit pkgs inputs user;
};
users.${user} =
{ pkgs, ... }:
{
imports = [
inputs.sops-nix.homeManagerModules.sops
./sops
./editor/neovim
./programs/firefox
./programs/tmux
./programs/dunst
./programs/kitty
./programs/rofi
./programs/obs-studio
./programs/vscode
./scripts
./zsh
./packages
./hyprland/hyprland_prismo.nix
./ssh
./services/backup-home.nix
./services/ghettoptt.nix
];
firefox.enable = true;
tmux.enable = true;
hyprland.enable = true;
home = {
username = "${user}";
homeDirectory = "/home/${user}";
stateVersion = "23.11";
};
programs.home-manager.enable = true;
};
};
}

View File

@@ -1,4 +1,6 @@
{
config,
lib,
pkgs,
...
}:
@@ -12,12 +14,13 @@
};
settings = {
global = {
rounded = "yes";
origin = "top-right";
monitor = "4";
alignment = "left";
vertical_alignment = "center";
width = "(0, 400)";
height = "(0, 400)";
width = "400";
height = "400";
scale = 0;
gap_size = 0;
progress_bar = true;
@@ -41,7 +44,7 @@
format = "<b>%s</b>\\n%b"; # format = "<span foreground='#f3f4f5'><b>%s %p</b></span>\n%b"
frame_color = "#232323";
frame_width = 1;
offset = "(15, 15)";
offset = "15x15";
horizontal_padding = 10;
icon_position = "left";
indicate_hidden = "yes";
@@ -51,6 +54,7 @@
mouse_middle_click = "close_current";
mouse_right_click = "close_all";
padding = 10;
plain_text = "no";
separator_height = 2;
show_indicators = "yes";
shrink = "no";

View File

@@ -2,13 +2,8 @@
{
programs.git = {
enable = true;
settings = {
user = {
email = "torjus@usit.uio.no";
name = "Torjus Håkestad";
};
};
userName = "Torjus Håkestad";
userEmail = "torjus@usit.uio.no";
lfs.enable = true;

View File

@@ -1,64 +1,46 @@
{
pkgs,
lib,
config,
osConfig,
...
}:
{
options.torjus.home = {
obs = {
enable = lib.mkOption {
type = lib.types.bool;
default = false;
description = "Whether to enable obs.";
};
withCuda = lib.mkOption {
type = lib.types.bool;
default = false;
description = "Enable cuda for obs-related packages.";
};
};
};
let
withCuda = osConfig.system.name == "gunter";
config = lib.mkIf config.torjus.home.obs.enable {
programs.obs-studio =
let
withCuda = config.torjus.home.obs.withCuda;
onnxruntime-gpu = (pkgs.onnxruntime.override { cudaSupport = withCuda; });
obs-backgroundremoval-gpu = (
(pkgs.obs-studio-plugins.obs-backgroundremoval.override { onnxruntime = onnxruntime-gpu; })
.overrideAttrs
(
final: prev: {
version = "1.3.3";
src = pkgs.fetchFromGitHub {
owner = "royshil";
repo = "obs-backgroundremoval";
rev = final.version;
hash = "sha256-NDe71iDnVcnMilGr5kdbemq8jEKd3WW45tbMwxjqUwo=";
};
nativeBuildInputs = prev.nativeBuildInputs ++ [ pkgs.pkg-config ];
cmakeFlags = [
"--preset ubuntu-x86_64"
"-DCMAKE_MODULE_PATH:PATH=${final.src}/cmake"
"-DUSE_SYSTEM_ONNXRUNTIME=ON"
"-DVCPKG_TARGET_TRIPLET="
"-DUSE_PKGCONFIG=ON"
];
}
)
);
in
{
enable = true;
package = pkgs.obs-studio.override {
cudaSupport = withCuda;
onnxruntime-gpu = (pkgs.onnxruntime.override { cudaSupport = withCuda; }).overrideAttrs (old: {
# TODO: Remove when fixed in nixpkgs
# https://github.com/NixOS/nixpkgs/blob/nixos-unstable/pkgs/development/libraries/onnxruntime/default.nix#L154
buildInputs = old.buildInputs ++ [ pkgs.cudaPackages.nccl ];
});
obs-backgrounremoval-gpu = (
(pkgs.obs-studio-plugins.obs-backgroundremoval.override { onnxruntime = onnxruntime-gpu; })
.overrideAttrs
(old: {
version = "1.1.14-beta";
src = pkgs.fetchFromGitHub {
owner = "occ-ai";
repo = "obs-backgroundremoval";
rev = "012a7f45fe4cb5363abee654d05c5cba4235feb5";
hash = "sha256-ud9RfnbMXfOaIhkUYG7zyR4SxZhj3rZd9b4+8P4jBYs=";
};
plugins = with pkgs.obs-studio-plugins; [
obs-pipewire-audio-capture
obs-shaderfilter
obs-backgroundremoval-gpu
];
};
cmakeFlags =
if withCuda then
(lib.lists.remove "-DDISABLE_ONNXRUNTIME_GPU=ON" old.cmakeFlags)
else
old.cmakeFlags;
})
);
in
{
programs.obs-studio = {
enable = true;
plugins =
with pkgs.obs-studio-plugins;
[
obs-pipewire-audio-capture
obs-shaderfilter
]
++ lib.optionals withCuda [ obs-backgrounremoval-gpu ];
};
}

View File

@@ -1,35 +0,0 @@
{
pkgs,
lib,
config,
...
}:
with lib;
let
cfg = config.streamcontroller;
in
{
options.streamcontroller = {
enable = mkEnableOption "streamcontroller service";
};
config = mkIf cfg.enable {
systemd.user.services.streamcontroller = {
Unit = {
Description = "Streamcontroller service";
PartOf = [ "graphical-session.target" ];
After = [ "graphical-session.target" ];
Requisite = [ "graphical-session.target" ];
};
Service = {
ExecStart = "${pkgs.streamcontroller}/bin/streamcontroller -b";
Restart = "on-failure";
};
Install = {
WantedBy = [ "graphical-session.target" ];
};
};
};
}

View File

@@ -2,29 +2,19 @@
{
programs.vscode = {
enable = true;
profiles.default = {
enableUpdateCheck = true;
enableExtensionUpdateCheck = true;
userSettings = {
"window.titleBarStyle" = "custom";
"rust-analyzer.testExplorer" = true;
"rust-analyzer.restartServerOnConfigChange" = true;
"direnv.restart.automatic" = true;
};
extensions = with pkgs.vscode-extensions; [
bbenoist.nix
catppuccin.catppuccin-vsc
catppuccin.catppuccin-vsc-icons
github.copilot
github.copilot-chat
golang.go
mkhl.direnv
ms-python.python
ms-vscode-remote.remote-ssh
rooveterinaryinc.roo-cline
rust-lang.rust-analyzer
vscodevim.vim
];
enableUpdateCheck = true;
enableExtensionUpdateCheck = true;
extensions = with pkgs.vscode-extensions; [
catppuccin.catppuccin-vsc
catppuccin.catppuccin-vsc-icons
golang.go
vscodevim.vim
ms-python.python
ms-vscode-remote.remote-ssh
bbenoist.nix
];
userSettings = {
"window.titleBarStyle" = "custom";
};
};
}

View File

@@ -1,8 +1,6 @@
{ pkgs, config, ... }:
{
imports = [
./noita-helper.nix
];
imports = [ ./lockhelper.nix ];
home.file.".local/bin/hl-no-opacity" = {
source = ./hl-no-opacity.sh;
executable = true;

View File

@@ -0,0 +1,14 @@
{ pkgs, ... }:
let
lockhelper = pkgs.writeShellApplication {
name = "lockhelper";
runtimeInputs = with pkgs; [
grim
jq
];
text = (builtins.readFile ./lockhelper.sh);
};
in
{
home.packages = [ lockhelper ];
}

View File

@@ -0,0 +1,18 @@
#!/usr/bin/env bash
set -eo pipefail
mkdir -p /tmp/lockscreen || true
monitors=$(hyprctl monitors -j | jq -r '.[] | select( .name | contains ("DP")) | .name')
while IFS= read -r m; do
grim -o "$m" "/tmp/lockscreen/$m.png" || true
done <<< "$monitors"
# Only lock if not already running
if [ -z "$(pgrep hyprlock)" ]
then
exec hyprlock
else
echo "Already locked"
fi

View File

@@ -1,14 +0,0 @@
{ pkgs, ... }:
let
noita-helper = pkgs.writeShellApplication {
name = "noita-helper";
runtimeInputs = with pkgs; [
grim
jq
];
text = (builtins.readFile ./noita-helper.sh);
};
in
{
home.packages = [ noita-helper ];
}

View File

@@ -1,50 +0,0 @@
#!/usr/bin/env bash
SAVE_DIR="/home/torjus/.local/share/Steam/steamapps/compatdata/881100/pfx/drive_c/users/steamuser/AppData/LocalLow/Nolla_Games_Noita"
RESTIC_REPOSITORY="/home/$(whoami)/tmp/noita-backup"
export RESTIC_REPOSITORY
export RESTIC_PASSWORD="noita"
function start {
echo "Doing initial backup"
restic backup -q "$SAVE_DIR"
echo "Backup done"
echo "Mounting tmpfs for save folder..."
sudo mount -o size=2G,noswap -t tmpfs none "$SAVE_DIR"
echo "Restoring initial backup..."
restic restore "latest:$SAVE_DIR" --target "$SAVE_DIR"
echo "Ready to play Noita!"
echo "Remember to run $0 stop when done."
while true
do
restic backup -q "$SAVE_DIR"
echo "Periodic backup done..."
sleep 10m
done
}
function stop {
restic backup -q $SAVE_DIR
sudo umount $SAVE_DIR
restic restore latest:$SAVE_DIR --target $SAVE_DIR
echo "Backup and unmount done..."
}
if [ "$#" -ne 1 ]; then
echo "Usage: $0 {start|stop}"
exit 1
fi
if [ "$1" == "start" ]; then
start
elif [ "$1" == "stop" ]; then
stop
else
echo "Usage: $0 {start|stop}"
exit 1
fi

View File

@@ -26,6 +26,11 @@ if [ -z "$wallpaper_path" ]; then
exit 1
fi
if ! command -v hyprpaper &> /dev/null; then
echo "Could not find hyprpaper command"
exit 1
fi
echo "setting $wallpaper_path as wallpaper"
hyprctl hyprpaper unload all
hyprctl hyprpaper preload "$wallpaper_path"

View File

@@ -1,14 +1,5 @@
{
pkgs,
config,
lib,
osConfig,
...
}:
{ pkgs, config, ... }:
let
cfg = osConfig.host.capabilities;
backupEnabled = cfg.backupRepository != null && cfg.backupPassword != null;
# Backup home script
backup-home = pkgs.writeShellApplication {
name = "backup-home";
@@ -21,8 +12,8 @@ let
];
text = ''
echo "========== BACKUP HOME STARTING =========="
export RESTIC_PASSWORD="${cfg.backupPassword}"
export RESTIC_REPOSITORY="${cfg.backupRepository}"
export RESTIC_PASSWORD="gunter.home.2rjus.net"
export RESTIC_REPOSITORY="rest:http://10.69.12.52:8000/gunter.home.2rjus.net"
SECRET_PATH="$XDG_CONFIG_HOME/sops-nix/secrets/gotify_backup_home"
if ! [ -f "$SECRET_PATH" ]; then
@@ -53,8 +44,6 @@ let
--exclude '/home/torjus/.npm' \
--exclude '/home/torjus/.factorio/mods' \
--exclude '/home/torjus/.zoom' \
--exclude '/home/torjus/Games' \
--exclude '/home/torjus/nobackup' \
--exclude '/home/torjus/git/nixpkgs'
retval=$?
if [ $retval -ne 0 ]; then
@@ -62,7 +51,7 @@ let
retval=$?
if [ $retval -ne 0 ]; then
curl "https://gotify.t-juice.club/message?token=$GOTIFY_TOKEN" \
-F "title=Backup of home@${osConfig.networking.hostName} failed!" \
-F "title=Backup of home@gunter failed!" \
-F "message=Please check status of backup-home service"
fi
fi
@@ -101,9 +90,9 @@ let
};
in
{
sops.secrets."gotify_backup_home" = lib.mkIf backupEnabled { };
sops.secrets."gotify_backup_home" = { };
systemd.user.services.backup-home = lib.mkIf backupEnabled {
systemd.user.services.backup-home = {
Unit = {
Description = "Backup home directory";
After = [
@@ -116,7 +105,7 @@ in
ExecStart = "${backup-home}/bin/backup-home";
};
};
systemd.user.timers.backup-home = lib.mkIf backupEnabled {
systemd.user.timers.backup-home = {
Unit = {
Description = "Backup home directory";
After = [ "network.target" ];

View File

@@ -1,21 +0,0 @@
{ pkgs, config, ... }:
{
sops.secrets."nats_nkey" = { };
systemd.user.services.natstonotify = {
Unit = {
Description = "Run natstonotify";
After = [ "sops-nix.service" ];
};
Service = {
Environment = [
"NATS_URL=nats://nats1.home.2rjus.net:4222"
"NATS_NKEY_FILE=${config.sops.secrets.nats_nkey.path}"
];
Type = "simple";
ExecStart = "${pkgs.natstonotify}/bin/natstonotify server";
};
Install = {
WantedBy = [ "graphical-session.target" ];
};
};
}

View File

@@ -18,37 +18,27 @@ in
{
programs.ssh = {
enable = true;
enableDefaultConfig = false;
controlMaster = "auto";
matchBlocks = {
"bmo.uio.no-on-eduroam" = (
lib.mkIf (osConfig.host.capabilities.hasEduroamAccess) (
lib.hm.dag.entryBefore [ "bmo.uio.no" "*" ] {
lib.mkIf (osConfig.system.name == "magicman") (
lib.hm.dag.entryBefore [ "bmo.uio.no" ] {
match = "host bmo.uio.no exec \"nmcli -g GENERAL.STATE c s eduroam|grep -q -E '\\bactiv'\"";
hostname = "bmo.uio.no";
forwardAgent = false;
serverAliveInterval = 30;
controlMaster = "auto";
controlPath = "/run/user/%i/ssh-cm-%C";
}
)
);
"bmo.uio.no" = lib.hm.dag.entryBefore [ "*" ] {
"bmo.uio.no" = {
setEnv = {
# TERM = "xterm-256color";
};
hostname = "bmo.uio.no";
forwardAgent = false;
proxyJump = "torjus@rlogin.uio.no";
serverAliveInterval = 30;
controlMaster = "auto";
controlPath = "/run/user/%i/ssh-cm-%C";
};
"*" = {
serverAliveInterval = 30;
controlMaster = "auto";
};
};
};
services.ssh-agent.enable = true;
}

View File

@@ -24,7 +24,7 @@
nrebuild = "sudo nixos-rebuild switch --flake /home/${user}/nixos";
ndiffbuild = "sudo nixos-rebuild build --flake /home/${user}/nixos && nvd diff /run/current-system /home/${user}/nixos/result";
};
initContent = ''
initExtra = ''
bindkey -v
bindkey '^R' history-incremental-search-backward
@@ -32,8 +32,7 @@
autoload -Uz promptinit
promptinit
prompt pure
export MANPAGER="nvim +Man!"
export LOKI_ADDR="http://monitoring01:3100"
export PATH="''${KREW_ROOT:-$HOME/.krew}/bin:$PATH"
# Aliases
alias ls=eza

View File

@@ -9,7 +9,7 @@
{
imports = [
./hardware-configuration.nix
../../system/monitoring
../../system/monitoring.nix
];
# Sops stuff
@@ -23,20 +23,15 @@
# Bootloader stuff
boot = {
blacklistedKernelModules = [
"mt7921e"
"mt7921_common"
"mt792x_lib"
"mt76_connac_lib"
"mt76"
];
# Kernel stuff
# kernelPackages = lib.warn "Pinned to kernel 6.12 due to issues" pkgs.linuxPackages_6_12;
kernelParams = [ "module_blacklist=amdgpu" ];
kernel.sysctl = {
"vm.max_map_count" = 262144;
};
# kernelPackages = pkgs.linuxPackages_xanmod_latest;
kernelPackages = pkgs.linuxPackages_latest;
# kernelPackages = lib.warn "Pinned to kernel 6.10 due to nvidia fbdev trouble!" pkgs.linuxPackages_6_10;
kernelParams = [
"quiet"
"splash"
"rd.systemd.show_status=false"
];
extraModprobeConfig = ''
options v4l2loopback exclusive_caps=1 card_label="Virtual Camera"
@@ -44,39 +39,31 @@
# Bootloader stuff
loader.systemd-boot = {
enable = true;
configurationLimit = 10;
memtest86.enable = true;
};
loader.efi = {
canTouchEfiVariables = true;
};
supportedFilesystems = [ "nfs" ];
};
# Networking stuff
networking.hostName = "gunter"; # Define your hostname.
networking.firewall.allowedTCPPorts = [ 8989 ];
# Additional nix caches for homelab and CUDA
nix.settings = {
substituters = [
"https://nix-cache.home.2rjus.net"
"https://cuda-maintainers.cachix.org"
];
trusted-substituters = [
"https://nix-cache.home.2rjus.net"
"https://cuda-maintainers.cachix.org"
];
trusted-public-keys = [
"nix-cache.home.2rjus.net-1:2kowZOG6pvhoK4AHVO3alBlvcghH20wchzoR0V86UWI="
"cuda-maintainers.cachix.org-1:0dq3bujKpuEPMCX6U4WylrUDZ9JyUG0VpVZa7CNfq5E="
];
networking.networkmanager.enable = true;
networking.nftables.enable = true;
networking.firewall = {
enable = true;
};
# Set time stuff
time.timeZone = "Europe/Oslo";
# Enable graphics
hardware.graphics = {
enable = true;
extraPackages = with pkgs; [
libva-vdpau-driver
vaapiVdpau
nvidia-vaapi-driver
];
};
@@ -89,21 +76,18 @@
open = true;
nvidiaSettings = false;
package = config.boot.kernelPackages.nvidiaPackages.beta;
# package =
# lib.warn "nvidia driver override to use 580.82.07"
# config.boot.kernelPackages.nvidiaPackages.mkDriver
# {
# version = "580.82.07";
# sha256_64bit = "sha256-Bh5I4R/lUiMglYEdCxzqm3GLolQNYFB0/yJ/zgYoeYw=";
# sha256_aarch64 = lib.fakeHash;
# openSha256 = "sha256-8/7ZrcwBMgrBtxebYtCcH5A51u3lAxXTCY00LElZz08=";
# settingsSha256 = lib.fakeHash;
# persistencedSha256 = lib.fakeSha256;
# };
package = config.boot.kernelPackages.nvidiaPackages.latest;
# package = config.boot.kernelPackages.nvidiaPackages.mkDriver {
# version = "560.28.03";
# sha256_64bit = "sha256-martv18vngYBJw1IFUCAaYr+uc65KtlHAMdLMdtQJ+Y=";
# sha256_aarch64 = lib.fakeHash;
# openSha256 = "sha256-asGpqOpU0tIO9QqceA8XRn5L27OiBFuI9RZ1NjSVwaM=";
# settingsSha256 = lib.fakeHash;
# persistencedSha256 = lib.fakeSha256;
# };
};
# Setup nvidia video drivers
# Setup hyprland
# nixpkgs.overlays = [
# (self: super: {
# hyprland = super.hyprland.override {
@@ -111,20 +95,58 @@
# };
# })
# ];
services.xserver.enable = true;
services.xserver.videoDrivers = [ "nvidia" ];
# Host capabilities
host.capabilities = {
hasCuda = true;
hasBattery = false;
formFactor = "desktop";
volumeScrollStep = 5;
enableArrhist = true;
hasEduroamAccess = false;
backupRepository = "rest:http://10.69.12.52:8000/gunter.home.2rjus.net";
backupPassword = "gunter.home.2rjus.net";
services.xserver.displayManager.gdm.wayland = true;
services.xserver.displayManager.lightdm.enable = false;
services.xserver.displayManager.startx.enable = true;
services.xserver.windowManager.i3.enable = true;
programs.hyprland = {
enable = true;
xwayland.enable = true;
portalPackage = pkgs.xdg-desktop-portal-hyprland;
};
# Setup common XDG env vars
environment.sessionVariables = rec {
XDG_CACHE_HOME = "$HOME/.cache";
XDG_CONFIG_HOME = "$HOME/.config";
XDG_DATA_HOME = "$HOME/.local/share";
XDG_STATE_HOME = "$HOME/.local/state";
XDG_BIN_HOME = "$HOME/.local/bin";
PATH = [ "${XDG_BIN_HOME}" ];
};
# Setup xdg portal
xdg.portal = {
enable = true;
xdgOpenUsePortal = true;
extraPortals = (
with pkgs;
[
# unstable.xdg-desktop-portal-hyprland
xdg-desktop-portal-gtk
]
);
};
# Enable flakes
nix.settings = {
experimental-features = [
"nix-command"
"flakes"
];
trusted-users = [
"root"
"torjus"
];
substituters = [ "https://cuda-maintainers.cachix.org" ];
trusted-public-keys = [
"cuda-maintainers.cachix.org-1:0dq3bujKpuEPMCX6U4WylrUDZ9JyUG0VpVZa7CNfq5E="
];
};
nixpkgs.config.allowUnfree = true;
# Install system-wide packages
environment.systemPackages = with pkgs; [
curl
@@ -135,7 +157,7 @@
wget
v4l-utils
nmap
pciutils
(lib.mkIf (config.system.name == "gunter") pciutils)
# X shit
# xorg.xorgserver

View File

@@ -1,6 +0,0 @@
{ pkgs, lib, ... }:
{
hardware.nvidia-container-toolkit = {
enable = true;
};
}

View File

@@ -1,17 +1,18 @@
{
inputs,
self,
pks,
...
}:
{
imports = [
./configuration.nix
./hardware-configuration.nix
./steamuser.nix
./nfs.nix
./ollama.nix
./streamdeck.nix
./ratbagd.nix
./container.nix
../../system
../../home/hosts/gunter
./steam.nix
../../home/gunter.nix
];
}

View File

@@ -25,9 +25,7 @@
"kvm-amd"
"v4l2loopback"
];
boot.extraModulePackages = with config.boot.kernelPackages; [
v4l2loopback
];
boot.extraModulePackages = with config.boot.kernelPackages; [ v4l2loopback ];
fileSystems."/" = {
device = "/dev/disk/by-uuid/a7d4b697-fffa-4bcb-9dd7-cbbd6121a50c";

View File

@@ -1,20 +0,0 @@
{ ... }:
{
services.hostapd = {
enable = true;
radios = {
wlp13s0 = {
countryCode = "NO";
wifi6.enable = true;
networks.wlp13s0 = {
ssid = "TESTLOL";
band = "5g";
authentication = {
wpaPassword = "lol passord";
mode = "wpa2-sha256";
};
};
};
};
};
}

View File

@@ -2,15 +2,11 @@
{
services.ollama = {
enable = true;
package = pkgs.ollama-cuda;
acceleration = "cuda";
};
services.open-webui = {
enable = true;
package = pkgs.stable.open-webui;
# enable = lib.warn "Open WebUI is disabled" false;
environment = {
VECTOR_DB = "pgvector";
PGVECTOR_DB_URL = "postgresql://openwebui:openwebui@pgdb1.home.2rjus.net:5432/openwebui";
DO_NOT_TRACK = "True";
SCARF_NO_ANALYTICS = "True";
OLLAMA_API_BASE_URL = "http://127.0.0.1:11434";
@@ -18,8 +14,4 @@
};
port = 11444;
};
# Ensure networking is ok before starting
systemd.services.open-webui.after = [ "network-online.target" ];
systemd.services.open-webui.wants = [ "network-online.target" ];
}

View File

@@ -1,5 +0,0 @@
{ pkgs, ... }:
{
services.ratbagd.enable = true;
environment.systemPackages = with pkgs; [ piper ];
}

View File

@@ -1,5 +0,0 @@
{ ... }:
{
programs.steam.enable = true;
programs.gamemode.enable = true;
}

View File

@@ -0,0 +1,23 @@
{ pkgs, ... }:
{
environment.shells = with pkgs; [ zsh ];
services.xserver.desktopManager.xfce.enable = true;
programs.steam.enable = true;
programs.gamemode.enable = true;
services.flatpak.enable = true;
users.users.steam = {
isNormalUser = true;
initialPassword = "steam";
home = "/home/steam";
description = "Steam user";
shell = pkgs.zsh;
# Install some user packages
packages = with pkgs; [
firefox
mumble
easyeffects
];
};
}

View File

@@ -1,4 +1,6 @@
{
config,
lib,
pkgs,
...
}:
@@ -8,13 +10,23 @@
# Bootloader stuff
boot.kernelParams = [
"quiet"
"splash"
"rd.systemd.show_status=false"
"acpi_backlight=native"
"video=efifb:nobgrt"
"loglevel=3"
"rd.udev.log_level=3"
];
boot.kernelPackages = pkgs.linuxPackages_latest;
boot.loader.systemd-boot.configurationLimit = 3;
boot.loader.systemd-boot = {
enable = true;
configurationLimit = 3;
};
boot.loader.efi = {
canTouchEfiVariables = true;
};
boot.initrd.systemd.enable = true;
boot.plymouth = {
@@ -28,32 +40,23 @@
# Networking stuff
networking.hostName = "magicman"; # Define your hostname.
hardware = {
enableRedistributableFirmware = true;
enableAllFirmware = true;
# Enable opengl
graphics = {
enable = true;
extraPackages = with pkgs; [
intel-media-driver
libva-vdpau-driver
libvdpau-va-gl
];
};
networking.networkmanager.enable = true;
networking.nftables.enable = true;
networking.firewall = {
enable = true;
};
# Host capabilities
host.capabilities = {
hasCuda = false;
hasBattery = true;
formFactor = "laptop";
volumeScrollStep = 1;
enableArrhist = false;
hasEduroamAccess = true;
backupRepository = null;
backupPassword = null;
# Set time stuff
time.timeZone = "Europe/Oslo";
# Enable opengl
hardware.graphics = {
enable = true;
extraPackages = with pkgs; [
intel-media-driver
vaapiVdpau
libvdpau-va-gl
];
};
# Bluetooth stuff
@@ -73,11 +76,63 @@
};
};
# Setup hyprland
services.xserver.enable = true;
services.xserver.displayManager = {
gdm.wayland = true;
lightdm.enable = false;
};
programs.hyprland = {
enable = true;
xwayland.enable = true;
portalPackage = pkgs.xdg-desktop-portal-hyprland;
};
# TRIM
services.fstrim.enable = true;
# TLP
services.tlp.enable = true;
# Brillo
hardware.brillo.enable = true;
# Setup common XDG env vars
environment.sessionVariables = rec {
XDG_CACHE_HOME = "$HOME/.cache";
XDG_CONFIG_HOME = "$HOME/.config";
XDG_DATA_HOME = "$HOME/.local/share";
XDG_STATE_HOME = "$HOME/.local/state";
XDG_BIN_HOME = "$HOME/.local/bin";
PATH = [ "${XDG_BIN_HOME}" ];
};
# Setup xdg portal
xdg.portal = {
enable = true;
xdgOpenUsePortal = true;
extraPortals = (
with pkgs;
[
# xdg-desktop-portal-hyprland
xdg-desktop-portal-gtk
]
);
};
programs.steam.enable = true;
# Enable flakes
nix.settings.experimental-features = [
"nix-command"
"flakes"
];
nix.settings.trusted-users = [
"root"
"torjus"
];
nixpkgs.config.allowUnfree = true;
# Install system-wide packages
environment.systemPackages = with pkgs; [
vim

View File

@@ -8,8 +8,7 @@
imports = [
./configuration.nix
./hardware-configuration.nix
./laptop.nix
../../system
../../home/hosts/magicman
../../home/magicman.nix
];
}

View File

@@ -1,21 +0,0 @@
{ ... }:
{
hardware.brillo.enable = true;
powerManagement.enable = true;
services.tlp.enable = true;
services.auto-cpufreq = {
enable = true;
settings = {
battery = {
governor = "powersave";
turbo = "never";
};
charger = {
governor = "performance";
turbo = "auto";
};
};
};
}

View File

@@ -0,0 +1,103 @@
{
config,
lib,
pkgs,
...
}:
{
imports = [ ./hardware-configuration.nix ];
# Sops stuff
sops.defaultSopsFile = ../../secrets/prismo/secrets.yaml;
sops.age.keyFile = "/var/lib/sops-nix/key.txt";
sops.age.generateKey = true;
sops.secrets."gotify_tokens/backup-home" = { };
# Bootloader stuff
boot.kernelParams = [
"quiet"
"splash"
"rd.systemd.show_status=false"
];
boot.loader.systemd-boot = {
enable = true;
configurationLimit = 10;
};
boot.loader.efi = {
canTouchEfiVariables = true;
};
# Networking stuff
networking.hostName = "prismo"; # Define your hostname.
networking.networkmanager.enable = true;
networking.nftables.enable = true;
networking.firewall = {
enable = true;
};
# Set time stuff
time.timeZone = "Europe/Oslo";
# Enable opengl
hardware.graphics = {
enable = true;
extraPackages = with pkgs; [
intel-media-driver
vaapiVdpau
libvdpau-va-gl
];
};
# Setup hyprland
services.xserver.enable = true;
programs.hyprland = {
enable = true;
xwayland.enable = true;
portalPackage = pkgs.xdg-desktop-portal-hyprland;
};
# Setup common XDG env vars
environment.sessionVariables = rec {
XDG_CACHE_HOME = "$HOME/.cache";
XDG_CONFIG_HOME = "$HOME/.config";
XDG_DATA_HOME = "$HOME/.local/share";
XDG_STATE_HOME = "$HOME/.local/state";
XDG_BIN_HOME = "$HOME/.local/bin";
PATH = [ "${XDG_BIN_HOME}" ];
};
# Setup xdg portal
xdg.portal = {
enable = true;
xdgOpenUsePortal = true;
extraPortals = (
with pkgs;
[
xdg-desktop-portal-hyprland
xdg-desktop-portal-gtk
]
);
};
# Enable flakes
nix.settings.experimental-features = [
"nix-command"
"flakes"
];
nixpkgs.config.allowUnfree = true;
# Install system-wide packages
environment.systemPackages = with pkgs; [
vim
wget
curl
git
];
# Do NOT change this value unless you have manually inspected all the changes it would make to your configuration,
# and migrated your data accordingly.
#
# For more information, see `man configuration.nix` or https://nixos.org/manual/nixos/stable/options#opt-system.stateVersion .
system.stateVersion = "23.11"; # Did you read the comment?
}

14
hosts/prismo/default.nix Normal file
View File

@@ -0,0 +1,14 @@
{
inputs,
self,
pks,
...
}:
{
imports = [
./configuration.nix
./hardware-configuration.nix
../../system
../../home/prismo.nix
];
}

View File

@@ -0,0 +1,54 @@
# Do not modify this file! It was generated by nixos-generate-config
# and may be overwritten by future invocations. Please make changes
# to /etc/nixos/configuration.nix instead.
{
config,
lib,
pkgs,
modulesPath,
...
}:
{
imports = [ (modulesPath + "/installer/scan/not-detected.nix") ];
boot = {
initrd = {
availableKernelModules = [
"xhci_pci"
"ahci"
"usb_storage"
"sd_mod"
"rtsx_pci_sdmmc"
];
kernelModules = [ ];
luks.devices."cryptroot".device = "/dev/disk/by-uuid/f71b0ace-f38f-435f-a07a-007f9cfe4919";
};
kernelModules = [ "kvm-intel" ];
extraModulePackages = [ ];
};
fileSystems."/" = {
device = "/dev/disk/by-uuid/91a0dbc4-426f-4b7b-a49e-063d1d0e59fb";
fsType = "xfs";
};
fileSystems."/boot" = {
device = "/dev/disk/by-uuid/AF2D-FAD0";
fsType = "vfat";
};
swapDevices = [ { device = "/dev/disk/by-uuid/67da36a8-69df-4541-88cd-cba7cbc40b4c"; } ];
# Enables DHCP on each ethernet and wireless interface. In case of scripted networking
# (the default) this is the recommended approach. When using systemd-networkd it's
# still possible to use this option, but it's recommended to use it in conjunction
# with explicit per-interface declarations with `networking.interfaces.<interface>.useDHCP`.
networking.useDHCP = lib.mkDefault true;
# networking.interfaces.enp0s31f6.useDHCP = lib.mkDefault true;
# networking.interfaces.wlp2s0.useDHCP = lib.mkDefault true;
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
}

View File

@@ -0,0 +1,48 @@
{
lib,
buildGoModule,
fetchFromGitHub,
installShellFiles,
}:
buildGoModule rec {
pname = "openpomodoro-cli";
version = "0.3.0";
src = fetchFromGitHub {
owner = "open-pomodoro";
repo = "openpomodoro-cli";
rev = "v${version}";
hash = "sha256-h/o4yxrZ8ViHhN2JS0ZJMfvcJBPCsyZ9ZQw9OmKnOfY=";
};
vendorHash = "sha256-BR9d/PMQ1ZUYWSDO5ID2bkTN+A+VbaLTlz5t0vbkO60=";
ldflags = [
"-s"
"-w"
];
GOWORK = "off";
subPackages = [ "cmd/pomodoro" ];
nativeBuildInputs = [ installShellFiles ];
# postInstall = ''
# installShellCompletion --cmd talosctl \
# --bash <($out/bin/talosctl completion bash) \
# --fish <($out/bin/talosctl completion fish) \
# --zsh <($out/bin/talosctl completion zsh)
# '';
doCheck = false; # no tests
meta = with lib; {
description = "A command-line Pomodoro tracker which uses the Open Pomodoro Format";
mainProgram = "pomodoro";
homepage = "https://github.com/open-pomodoro/openpomodoro-cli";
license = licenses.mit;
# maintainers = with maintainers; [ flokli ];
};
}

View File

@@ -0,0 +1,21 @@
test: ENC[AES256_GCM,data:MtSN,iv:ag/LDkk0DgE6QPjB/08RhEw3LzQHDOkRH0/4OBn8KUU=,tag:FeiJfjtbd4MCwNmCezH44A==,type:str]
sops:
kms: []
gcp_kms: []
azure_kv: []
hc_vault: []
age:
- recipient: age1lznyk4ee7e7x8n92cq2n87kz9920473ks5u9jlhd3dczfzq4wamqept56u
enc: |
-----BEGIN AGE ENCRYPTED FILE-----
YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSBhaGtaL0tkVFFuTk9ka0Rz
bHRpN0UyZFQxTG1ZSTRxSmI4eHJhbVM1ZWs0Cmx5UkdrSFNsRGU1eWRyU0hEcElH
WWJLWHdNTVR4RVpGYlcwMlJ4b2J5eHcKLS0tIGkrTWpNdVdERHpvaHZRdGxHN1Mr
WDJGWFA1M2kxQ1hHKzRwRTY4WUZwN2MKQIT//FEdXYWfEkI1knDD3uN+KMaIDtmR
H64031YMvAh67fVGekRv72S5DWzrft/Zr2libKpsN7T4G9fxGihhEw==
-----END AGE ENCRYPTED FILE-----
lastmodified: "2024-10-02T20:56:45Z"
mac: ENC[AES256_GCM,data:WQKHFMPmEvDTHS4eYYVcpsX7j8Xef9SV0VKNAbQh0hnZPMJEll4jtzR8sub2tUEt9/I1PvngXMWz6pPmINwOKRI+L3+gTSdg9QgPiikjE6wDA2qbpv9pd14uH22ABmCjkTeEZ9R+b9KbBl0GtMQof1sdTL9nUDrr9Fyfrr/UXs4=,iv:4DgDhwb2ksh2THtR/H5PiO57vF4yKSZ6FyCjWBqCQQI=,tag:dczk4ZAI8k6dareobGmt/w==,type:str]
pgp: []
unencrypted_suffix: _unencrypted
version: 3.9.0

View File

@@ -3,7 +3,6 @@ sonarr_api_key: ENC[AES256_GCM,data:mg19hxs+DY6wsLjt4FupjavwmnmMJAP2Us5i1Rt/yyk=
sonarr_base_url: ENC[AES256_GCM,data:0HiHIX4KcPEE62Ti1fLH230rC1A7xYg=,iv:mkAnl6t2H5xP9RPjTsbSZkfbrgli/7XKnPE5aGuZpTo=,tag:P2osFM60Jk8qkXJgLaGpjg==,type:str]
radarr_api_key: ENC[AES256_GCM,data:Db1ISKTF+m2H1on55/4vdGticfqBdxfIzKHBxC9LAx4=,iv:NhiG4SmsRYIunW1ljFbxeHvRoi9fOVE+9DJn6kmZ6oI=,tag:DoJzo56CW3kJlySYmB8NYQ==,type:str]
radarr_base_url: ENC[AES256_GCM,data:3UgOPQMblYhm0ysRB6VVosvZToIM5IA=,iv:o/s0bVBrjrma2Df2LlCCFL5Ks80063/4mABc6vzDrYg=,tag:eHKntLPM9yRRkMfIWSpIdg==,type:str]
nats_nkey: ENC[AES256_GCM,data:TcIDFkFXB1+qfTqLylDI46w4/+Cy9XdXyXS26qCbwDaDoQNaRUsC6dw94mbT37352IWOCypTY0hweA==,iv:DC5GQyIXbNSx/mOLAOWTf5AyeFeViLxbKTMgZEfTEXE=,tag:krxk/dnZ58a8dcuWb7zhnA==,type:str]
sops:
kms: []
gcp_kms: []
@@ -13,23 +12,14 @@ sops:
- recipient: age1lznyk4ee7e7x8n92cq2n87kz9920473ks5u9jlhd3dczfzq4wamqept56u
enc: |
-----BEGIN AGE ENCRYPTED FILE-----
YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSBnaUlVOWtoRTFvMHljV0Fu
TFp2Ym1jcThqbWRjUjdNSnhxRUsrOWl6S3dBCmh0L0YzaXNlRTFHMXFHTGc1T3I2
WE03WjJCSlJSV2lmSExTWDBQRnlOcDAKLS0tIFJoeEM5b0IrdWxTRWhvNnd0c3NG
dENGdjJteFFaQTNFaDgvSGV2UEtyT0EKbdg4atS91rB99l7zKKkfPzKk4T5Mq2x5
bX825DPrxauAhvrT7ca/A2OwA4kaFuxPrQGd3VOPAXTVhlbcFgIAdw==
YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSBDdDRDc0UvaWY4U0loZzQ0
bDZCMitGbGVYaGJyUXNrZGpnZHJlWHRkK3drCnJ2TlovSUI0OEVrV2FBbVdlSm1z
OE9lYXNMSXpCS0NMSkZDcjhtWENOUTAKLS0tIEZFMnVqcktwWkR5VHBGQXdobXlp
Q3gxalhGVjNlS3B3YlFsK0VQMUFITEUKE87+RpOG6ucXHHQ0DMQ9F3yo0n1aXbv7
OX5ibHU7RroUQwFmDj87u59VUTvpWRQjsBW4c4WrZRk9KcjwinZZZQ==
-----END AGE ENCRYPTED FILE-----
- recipient: age1stlqqspmt5fepyz35udrwr5avf9zuju79f787p26pu2d2j08yqps2q2t2c
enc: |
-----BEGIN AGE ENCRYPTED FILE-----
YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSAvSEZJWldRcmJ3c1BjbUpT
bmZXSmlHU0hVRTV3SG91bXpiTXhZd1RkY0Y4ClBxc0RabWJmMi8reHZYWnlmK3pC
bUw5V2FEV0pZdkZEMTJ5ZDZXWDM2NjgKLS0tIGZ6dEZ4dERYQXFRQTVkRHhycndz
dkgwQlRrdEp6b2FIVnowaDlUMEZpeHcK2icvVv+UpbcdVErRjjQhlQb6PuluC/K7
Vy8Rh7dTn++bSEdGidDNGYeUQBrVy2qooq04lQqbeOOrdmXVhTamdA==
-----END AGE ENCRYPTED FILE-----
lastmodified: "2025-02-11T19:22:47Z"
mac: ENC[AES256_GCM,data:vd8O5y1GNDTDrlundbNZcGRAQzKLDly4qyxTqRO2JrnDYOqD/vQ8TqRQYiUgGY+5AcgjoLMER8keE8OUmcngN16cbGx1zKTpdqyHb7B2KR7ZfWOjW5kTk5KWM1gLDA4hA2GBEjHFBPGKdcrjURek9MrT+iM+qArbizSjWlKuehc=,iv:cicEnvWynZizJqrUzPIzbJWl6O8uL65Vs7fAYsuqSNA=,tag:l5jBXQfFedVE/VccZh+1qQ==,type:str]
lastmodified: "2024-04-25T19:19:54Z"
mac: ENC[AES256_GCM,data:VGBiDi71DHAXLhi7XC0XSTqnSwcJXv1Lj53qriFER7BXXZNPUdbeknlYR+KMdL3hgKGiK+ElWK5foDAy6jpl1H3U7Y9B4d40pVZSzEoN+fCwUgfP+yym1HwKZZoJok2ksXZIL4MZyZSNS+ONjDeFEcyHobIx8pRThxic3CcvptI=,iv:QwnFcYeIWibx5q8C/ur1eE8F9vbyGHg5raInDHBoyVs=,tag:JJWEYAyVhfny4hWrKBAKig==,type:str]
pgp: []
unencrypted_suffix: _unencrypted
version: 3.9.4
version: 3.8.1

View File

@@ -1,13 +0,0 @@
{ pkgs, lib, ... }:
{
boot.loader.systemd-boot.enable = true;
boot.loader.efi.canTouchEfiVariables = true;
boot.kernelPackages = lib.mkDefault pkgs.linuxPackages_latest;
boot.kernelParams = lib.mkBefore [
"quiet"
"splash"
"rd.systemd.show_status=false"
];
}

View File

@@ -1,22 +1,14 @@
{
imports = [
./boot.nix
./fonts.nix
./fwupd.nix
./git.nix
./greetd.nix
./host-capabilities.nix
./hyprland.nix
./label.nix
./libvirt.nix
./locale.nix
./networking.nix
./nix-config.nix
./podman.nix
./root-ca.nix
./security.nix
./services.nix
./users.nix
./xdg.nix
./label.nix
];
}

View File

@@ -5,13 +5,17 @@
fira-code
fira-code-symbols
font-awesome
nerd-fonts.jetbrains-mono
nerd-fonts.fira-code
nerd-fonts.droid-sans-mono
nerd-fonts.dejavu-sans-mono
(nerdfonts.override {
fonts = [
"JetBrainsMono"
"FiraCode"
"DroidSansMono"
"DejaVuSansMono"
];
})
noto-fonts
noto-fonts-cjk-sans
noto-fonts-color-emoji
noto-fonts-emoji
noto-fonts-monochrome-emoji
source-sans-pro
twemoji-color-font

View File

@@ -4,7 +4,7 @@
enable = true;
settings = {
default_session = {
command = "${pkgs.tuigreet}/bin/tuigreet --time --cmd \"uwsm start default\"";
command = "${pkgs.greetd.tuigreet}/bin/tuigreet --time --cmd \"dbus-run-session Hyprland\"";
user = "greeter";
};
};

View File

@@ -1,64 +0,0 @@
{ lib, ... }:
with lib;
{
options.host.capabilities = {
# Hardware capabilities
hasCuda = mkOption {
type = types.bool;
default = false;
description = "Whether the host has CUDA-capable GPU (for btop, OBS, etc.)";
};
hasBattery = mkOption {
type = types.bool;
default = false;
description = "Whether the host has a battery (laptop)";
};
# Form factor
formFactor = mkOption {
type = types.enum [
"desktop"
"laptop"
];
default = "desktop";
description = "Physical form factor of the host";
};
# UI behavior customizations
volumeScrollStep = mkOption {
type = types.int;
default = 5;
description = "Volume adjustment step percentage for scroll wheel";
};
# Service-specific features
enableArrhist = mkOption {
type = types.bool;
default = false;
description = "Enable Sonarr/Radarr monitoring widget (arrhist)";
};
# Network environment features
hasEduroamAccess = mkOption {
type = types.bool;
default = false;
description = "Whether this host can connect to eduroam (for SSH config)";
};
# Backup configuration
backupRepository = mkOption {
type = types.nullOr types.str;
default = null;
description = "Restic backup repository URL for this host";
example = "rest:http://10.69.12.52:8000/gunter.home.2rjus.net";
};
backupPassword = mkOption {
type = types.nullOr types.str;
default = null;
description = "Restic backup password identifier for this host";
example = "gunter.home.2rjus.net";
};
};
}

View File

@@ -1,12 +0,0 @@
{ pkgs, ... }:
{
services.xserver.enable = true;
services.displayManager.gdm.wayland = true;
programs.hyprland = {
enable = true;
withUWSM = true;
xwayland.enable = true;
portalPackage = pkgs.xdg-desktop-portal-hyprland;
};
}

View File

@@ -6,6 +6,9 @@
package = pkgs.qemu_kvm;
runAsRoot = true;
swtpm.enable = true;
ovmf = {
enable = true;
};
};
};
}

View File

@@ -1,14 +0,0 @@
{ ... }:
{
time.timeZone = "Europe/Oslo";
i18n = {
supportedLocales = [
"en_US.UTF-8/UTF-8"
"nb_NO.UTF-8/UTF-8"
];
extraLocaleSettings = {
LC_TIME = "nb_NO.UTF-8";
};
};
}

37
system/monitoring.nix Normal file
View File

@@ -0,0 +1,37 @@
{ pkgs, ... }:
{
environment.systemPackages = with pkgs; [
prometheus-node-exporter
prometheus-systemd-exporter
];
systemd.services."node-exporter" = {
enable = true;
unitConfig = {
Description = "Prometheus Node Exporter";
After = [ "network.target" ];
};
serviceConfig = {
ExecStart = "${pkgs.prometheus-node-exporter}/bin/node_exporter";
};
wantedBy = [ "multi-user.target" ];
};
systemd.services."systemd-exporter" = {
enable = true;
unitConfig = {
Description = "Prometheus Systemd Exporter";
After = [ "network.target" ];
};
serviceConfig = {
ExecStart = "${pkgs.prometheus-systemd-exporter}/bin/systemd_exporter";
};
wantedBy = [ "multi-user.target" ];
};
networking.firewall.allowedTCPPorts = [
9100
9558
8989
];
}

View File

@@ -1,7 +0,0 @@
{ ... }:
{
imports = [
./metrics.nix
./logs.nix
];
}

View File

@@ -1,39 +0,0 @@
{ ... }:
{
services.promtail = {
enable = true;
configuration = {
server = {
http_listen_address = "0.0.0.0";
http_listen_port = 9099;
grpc_listen_address = "0.0.0.0";
grpc_listen_port = 9098;
};
clients = [
{
url = "http://monitoring01.home.2rjus.net:3100/loki/api/v1/push";
}
];
scrape_configs = [
{
job_name = "journal";
journal = {
json = true;
};
relabel_configs = [
{
source_labels = [ "__journal__systemd_unit" ];
target_label = "systemd_unit";
}
{
source_labels = [ "__journal__hostname" ];
target_label = "host";
}
];
}
];
};
};
}

View File

@@ -1,18 +0,0 @@
{ ... }:
{
services.prometheus.exporters = {
node = {
enable = true;
openFirewall = true;
enabledCollectors = [
"systemd"
"logind"
];
};
smartctl = {
enable = true;
openFirewall = true;
devices = [ "/dev/nvme0n1" ];
};
};
}

View File

@@ -1,8 +0,0 @@
{ lib, ... }:
{
networking.networkmanager.enable = true;
networking.nftables.enable = true;
networking.firewall.enable = true;
networking.firewall.allowedTCPPorts = lib.mkDefault [ ];
networking.firewall.allowedUDPPorts = lib.mkDefault [ ];
}

View File

@@ -1,24 +0,0 @@
{ ... }:
{
nixpkgs.config.allowUnfree = true;
nix.settings = {
experimental-features = [
"nix-command"
"flakes"
];
trusted-users = [
"root"
"torjus"
];
substituters = [ "https://cache.nixos.org" ];
trusted-substituters = [ "https://cache.nixos.org" ];
trusted-public-keys = [
"cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY="
];
};
}

View File

@@ -1,12 +0,0 @@
-----BEGIN CERTIFICATE-----
MIIBxDCCAWmgAwIBAgIQQCSzuOLIKLj1dGbC+NFttjAKBggqhkjOPQQDAjBAMRow
GAYDVQQKExFob21lLjJyanVzLm5ldCBDQTEiMCAGA1UEAxMZaG9tZS4ycmp1cy5u
ZXQgQ0EgUm9vdCBDQTAeFw0yNDEwMjEwOTEyNDRaFw0zNDEwMTkwOTEyNDRaMEAx
GjAYBgNVBAoTEWhvbWUuMnJqdXMubmV0IENBMSIwIAYDVQQDExlob21lLjJyanVz
Lm5ldCBDQSBSb290IENBMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEGDE4ss9y
9msphQ/Sa/tAoEaGoDHQcg5oRcxWL5SZYjUPNl+zbRZzqkvCz2S1XrHJPiPWbyJX
cZAlPxbwZrWDyKNFMEMwDgYDVR0PAQH/BAQDAgEGMBIGA1UdEwEB/wQIMAYBAf8C
AQEwHQYDVR0OBBYEFPZx6AahX5diBMChZbv5N4dh+vCTMAoGCCqGSM49BAMCA0kA
MEYCIQC6yqMM9/s1Dct5jlq0NAGsDA68hVTDcO3RP61lxQlfBwIhAL1jlmIwaSJc
TjdIMjPQ3ombBRqDJBDvDr8o6oOUjret
-----END CERTIFICATE-----

View File

@@ -1,9 +0,0 @@
{ pkgs, ... }:
{
security.pki = {
certificateFiles = [
"${pkgs.cacert}/etc/ssl/certs/ca-bundle.crt"
./root-ca.crt
];
};
}

View File

@@ -12,6 +12,7 @@
locate = {
enable = true;
package = pkgs.plocate;
localuser = null;
};
};
}

View File

@@ -1,17 +0,0 @@
{ pkgs, ... }:
{
environment.sessionVariables = rec {
XDG_CACHE_HOME = "$HOME/.cache";
XDG_CONFIG_HOME = "$HOME/.config";
XDG_DATA_HOME = "$HOME/.local/share";
XDG_STATE_HOME = "$HOME/.local/state";
XDG_BIN_HOME = "$HOME/.local/bin";
PATH = [ "${XDG_BIN_HOME}" ];
};
xdg.portal = {
enable = true;
xdgOpenUsePortal = true;
extraPortals = with pkgs; [ xdg-desktop-portal-gtk ];
};
}