Compare commits

..

No commits in common. "cf5f661546840c8584319cfc1b1c91ca25848962" and "aa79cea063b1a41497d27b4af4dfda36e038d509" have entirely different histories.

20 changed files with 77 additions and 319 deletions

View file

@ -2,7 +2,7 @@
## Config Setup
The three main parts of my config are the `home-manager/`, `hosts/`, and `packages/` folders. In addition to these, I also have a `secrets.nix` file which needs to be populated with secrets as structured in `secrets.example.nix`. Soon, I will have a way to export and import this file to/from a bitwarden vault, for backup purposes.
The three main parts of my config are the `home-manager/`, `hosts/`, and `packages/` folders.
### Home manager
@ -16,8 +16,7 @@ This folder contains sub-folders for each of my NixOS hosts, of which there is o
This folder contains all of my personally-made nix packages. This is mainly just packages I can't seem to find on the interwebs, like some themes. Theoretically they could be used by someone else, but I haven't quite made my config modular yet, so don't try.
| Package | License | Original Link |
| ------------------- | ------- | ---------------------------------------------------------------------------------|
| BeautyLine (Garuda) | GPLv3 | https://gitlab.com/garuda-linux/themes-and-settings/artwork/beautyline |
| Magna Splash 6 | GPLv3 | https://www.pling.com/p/2136626/ |
| Rescrobbled | GPLv3 | https://github.com/NixOS/nixpkgs/pull/274553 (unmerged nixpkgs PR by negatethis) |
| Package | License | Original Link |
| ------------------- | ------- | ---------------------------------------------------------------------- |
| BeautyLine (Garuda) | GPLv3 | https://gitlab.com/garuda-linux/themes-and-settings/artwork/beautyline |
| Magna Splash 6 | GPLv3 | https://www.pling.com/p/2136626/ |

63
flake.lock generated
View file

@ -25,11 +25,11 @@
},
"locked": {
"dir": "/pkgs/firefox-addons",
"lastModified": 1733135686,
"narHash": "sha256-++1Btq9w+ZPQYP45X3G1iXEXwllo3b2UdeKVwQdUAoQ=",
"lastModified": 1733087703,
"narHash": "sha256-WKdLy5t8SH9HBtajC8BZb+V4n0FaP71aUUYLuku46Rk=",
"owner": "rycee",
"repo": "nur-expressions",
"rev": "074cadca26132cbd19f44ae5a45072f28f050ed9",
"rev": "d4cbff4dda07726005224b33cf2cc5dc4a2c4211",
"type": "gitlab"
},
"original": {
@ -50,11 +50,11 @@
]
},
"locked": {
"lastModified": 1733159850,
"narHash": "sha256-IrFkgBWFzzujwG4gt4iXj2ncx4BH3Yc4M5VdwN/Y/Ss=",
"lastModified": 1732670254,
"narHash": "sha256-5z4pN4FnhZ/LedFrMmEhzCqFORd2cj227Jm1I2Lj4Zg=",
"owner": "nix-community",
"repo": "flake-firefox-nightly",
"rev": "d20be2e9c1b201e4253e79a200f0a2ed7fc27441",
"rev": "c7eb601bd2d36aa4b9b6cdddc5793a36d77c0f06",
"type": "github"
},
"original": {
@ -152,11 +152,11 @@
]
},
"locked": {
"lastModified": 1733133928,
"narHash": "sha256-gU40r9AfpIr4eq+0noM8yH1Hxf+EA3dqfIpFtQl8Y1E=",
"lastModified": 1733085484,
"narHash": "sha256-dVmNuUajnU18oHzBQWZm1BQtANCHaqNuxTHZQ+GN0r8=",
"owner": "nix-community",
"repo": "home-manager",
"rev": "873e39d5f4437d2f3ab06881fea8e63e45e1d011",
"rev": "c1fee8d4a60b89cae12b288ba9dbc608ff298163",
"type": "github"
},
"original": {
@ -172,11 +172,11 @@
"nixpkgs-lib": "nixpkgs-lib"
},
"locked": {
"lastModified": 1733055216,
"narHash": "sha256-yB2y7tGJxDI/SDQ0D7b6ocRtLTPm93u8ybdIKQGXRDE=",
"lastModified": 1732450403,
"narHash": "sha256-qYjJeHYUHDgfDsvMpIf9TRz0oAoMwvYP75XHObDjWIg=",
"owner": "nix-community",
"repo": "lib-aggregate",
"rev": "f67bf0781c69a46bf3a1469f83c98518aa3054c3",
"rev": "c817444fb8a3042c26be57d8640fb744bc1b516c",
"type": "github"
},
"original": {
@ -188,11 +188,11 @@
"mozilla": {
"flake": false,
"locked": {
"lastModified": 1733136220,
"narHash": "sha256-Ga8AP/YPsKDVF5LcNN8v3RiLgnEeW7zBk9GyX7wa9Ug=",
"lastModified": 1704373101,
"narHash": "sha256-+gi59LRWRQmwROrmE1E2b3mtocwueCQqZ60CwLG+gbg=",
"owner": "mozilla",
"repo": "nixpkgs-mozilla",
"rev": "ad7af231a95acf65ccc4afa0c766f5c0674ad3f1",
"rev": "9b11a87c0cc54e308fa83aac5b4ee1816d5418a2",
"type": "github"
},
"original": {
@ -201,26 +201,6 @@
"type": "github"
}
},
"nix-index-database": {
"inputs": {
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1733024876,
"narHash": "sha256-vy9Q41hBE7Zg0yakF79neVgb3i3PQMSMR7uHPpPywFE=",
"owner": "nix-community",
"repo": "nix-index-database",
"rev": "6e0b7f81367069589a480b91603a10bcf71f3103",
"type": "github"
},
"original": {
"owner": "nix-community",
"repo": "nix-index-database",
"type": "github"
}
},
"nixos-grub-themes": {
"inputs": {
"nixpkgs": [
@ -243,11 +223,11 @@
},
"nixpkgs": {
"locked": {
"lastModified": 1733015953,
"narHash": "sha256-t4BBVpwG9B4hLgc6GUBuj3cjU7lP/PJfpTHuSqE+crk=",
"lastModified": 1732837521,
"narHash": "sha256-jNRNr49UiuIwaarqijgdTR2qLPifxsVhlJrKzQ8XUIE=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "ac35b104800bff9028425fec3b6e8a41de2bbfff",
"rev": "970e93b9f82e2a0f3675757eb0bfc73297cc6370",
"type": "github"
},
"original": {
@ -275,11 +255,11 @@
},
"nixpkgs-lib": {
"locked": {
"lastModified": 1733015484,
"narHash": "sha256-qiyO0GrTvbp869U4VGX5GhAZ00fSiPXszvosY1AgKQ8=",
"lastModified": 1732410305,
"narHash": "sha256-/hxIKRTBsdrnudJWDGaBN8wIjHovqVAVxXdi8ByVtck=",
"owner": "nix-community",
"repo": "nixpkgs.lib",
"rev": "0e4fdd4a0ab733276b6d2274ff84ae353f17129e",
"rev": "87b6978992e2eb605732fba842cad0a7e14b2047",
"type": "github"
},
"original": {
@ -316,7 +296,6 @@
"firefox-addons": "firefox-addons",
"firefox-nightly": "firefox-nightly",
"home-manager": "home-manager",
"nix-index-database": "nix-index-database",
"nixos-grub-themes": "nixos-grub-themes",
"nixpkgs": "nixpkgs",
"nixpkgs-24-11": "nixpkgs-24-11",

View file

@ -5,11 +5,6 @@
# General NixOS config
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
nixpkgs-24-11.url = "github:NixOS/nixpkgs/nixos-24.11";
# Nixpkgs index for command-not-found support
nix-index-database = {
url = "github:nix-community/nix-index-database";
inputs.nixpkgs.follows = "nixpkgs";
};
# NixOS Grub Themes (hyperfluent)
nixos-grub-themes = {
url = "github:jeslie0/nixos-grub-themes";
@ -50,7 +45,7 @@
};
};
outputs = inputs@{ nixpkgs, home-manager, plasma-manager, nix-index-database, ... }: let
outputs = inputs@{ nixpkgs, home-manager, plasma-manager, ... }: let
system = "x86_64-linux";
pkgs = nixpkgs.legacyPackages.${system};
secrets = import ./secrets.nix;
@ -61,10 +56,6 @@
modules = [
./hosts/laptop
# Better command-not-found
nix-index-database.nixosModules.nix-index
{ programs.nix-index-database.comma.enable = true; }
# Home manager
home-manager.nixosModules.home-manager
./home-manager
@ -83,7 +74,6 @@
# the path to your home.nix.
modules = [
plasma-manager.homeManagerModules.plasma-manager
./home-manager/custom-modules
./home-manager/home.nix
];

View file

@ -1,6 +0,0 @@
{ ... }:
{
imports = [
./rescrobbled.nix
];
}

View file

@ -1,85 +0,0 @@
{ pkgs, lib, config, ... }:
let tomlFormat = pkgs.formats.toml { }; in {
options = {
services.custom.rescrobbled = {
enable = lib.mkEnableOption "rescrobbled";
package = lib.mkOption {
type = lib.types.package;
default = (pkgs.callPackage ../../packages/rescrobbled {});
defaultText = lib.literalExpression "pkgs.rescrobbled";
description = "The package to use for rescrobbled";
};
session = lib.mkOption {
type = lib.types.str;
description = ''
The session token to use for last.fm.
This can be found by setting a last.fm API key & secret,
and then manually running the daemon. Then, the session token
will be located at {file}`$XDG_CONFIG_HOME/rescrobbled/session`.
'';
default = null;
};
settings = lib.mkOption {
type = tomlFormat.type;
default = {};
example = lib.literalExpression ''
lastfm-key = "Last.fm API key"
lastfm-secret = "Last.fm API secret"
min-play-time = 0
player-whitelist = [ "Player MPRIS identity or bus name" ]
filter-script = "path/to/script"
[[listenbrainz]]
url = "Custom API URL"
token = "User token"
'';
description = ''
Configuration written to
{file}`$XDG_CONFIG_HOME/rescrobbled/config.toml`.
See <https://github.com/InputUsername/rescrobbled#configuration> for the full list
of options.
'';
};
};
};
config = let cfg = config.services.custom.rescrobbled; in lib.mkIf cfg.enable {
home.packages = [ cfg.package ];
xdg.configFile ={
"rescrobbled/config.toml" = lib.mkIf (cfg.settings != { }) {
enable = true;
source = tomlFormat.generate "rescrobbled-config" cfg.settings;
};
"rescrobbled/session" = lib.mkIf (cfg.settings != { }) {
enable = true;
# Force makes it easy to generate the session file, then add it to nix cfg without issues
force = true;
text = cfg.session;
};
};
systemd.user.services.rescrobbled = {
Unit = {
Description = "An MPRIS scrobbler";
Documentation = "https://github.com/InputUsername/rescrobbled";
Wants = "network-online.target";
After = "network-online.target";
};
Service = {
ExecStartPre = "${pkgs.coreutils}/bin/sleep 15"; # Avoid listenbrainz errors by adding delay till network is connected
ExecStart = "${cfg.package}/bin/rescrobbled";
};
Install.WantedBy = [ "default.target" ];
};
};
}

View file

@ -2,10 +2,7 @@
{
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
home-manager.sharedModules = [
inputs.plasma-manager.homeManagerModules.plasma-manager
./custom-modules
];
home-manager.sharedModules = [ inputs.plasma-manager.homeManagerModules.plasma-manager ];
home-manager.extraSpecialArgs = {
inherit inputs system secrets;
};

View file

@ -17,6 +17,5 @@
./modules/desktop.nix
./modules/gtk.nix
./modules/beets.nix
./modules/rescrobbled.nix
];
}

View file

@ -2,6 +2,5 @@
{
imports = [
./email.nix
./ssh.nix
];
}

View file

@ -8,33 +8,33 @@
matchBlocks = {
# Tailscale nodes
"vps" = {
hostname = "oracle-vps";
hostName = "oracle-vps";
user = "tyman";
port = 22;
};
"srv" = {
hostname = "old-lenovo-laptop";
hostName = "old-lenovo-laptop";
user = "ty";
port = 22;
};
"polyfrost" = {
hostname = "polyfrost-vps";
hostName = "polyfrost-vps";
user = "tyman";
port = 22;
};
# Git hosts
"forgejo" = {
hostname = "git.myriation.xyz";
hostName = "git.myriation.xyz";
user = "git";
port = 22;
};
"github" = {
hostname = "github.com";
hostName = "github.com";
user = "git";
port = 22;
};
"codeberg" = {
hostname = "codeberg.org";
hostName = "codeberg.org";
user = "git";
port = 22;
};

View file

@ -7,7 +7,6 @@
# Video
jellyfin-media-player
vlc
# Chat
element-desktop
@ -23,8 +22,6 @@
# Programming
nixd # NixD LSP for .nix files
clang
clang-tools
deno
# :3

View file

@ -1,21 +0,0 @@
{ secrets, lib, ... }:
{
services.custom.rescrobbled = let s = secrets.programs.rescrobbled; in lib.mkIf s.enable {
enable = true;
session = s.lastfm.session;
settings = {
player-whitelist = [ "elisa" ];
listenbrainz = lib.mkIf (s.listenbrainz.token != null) [
{
token = s.listenbrainz.token;
}
];
lastfm-key = lib.mkIf (s.lastfm.key != null && s.lastfm.secret != null) s.lastfm.key;
lastfm-secret = lib.mkIf (s.lastfm.key != null && s.lastfm.secret != null) s.lastfm.secret;
};
};
}

View file

@ -1,9 +1,9 @@
{ ... }:
{
imports = [
./btop.nix
./konsole.nix
./starship.nix
./zsh.nix
./starship.nix
./konsole.nix
./btop.nix
];
}

View file

@ -125,7 +125,7 @@
custom.date = {
disabled = false;
when = true;
command = ''date +"%b %-d %Y"'';
command = ''date +"%b %e %Y"'';
description = "The current local date";
style = "bg:238 fg:#E5B9E9 bold";
format = "[$output]($style)";

View file

@ -1,51 +1,33 @@
{ pkgs, inputs, system, ... }:
{
programs.vscode = let vscode-package = pkgs.vscodium; in {
programs.vscode = {
enable = true;
package = vscode-package;
package = pkgs.vscodium;
enableUpdateCheck = false;
enableExtensionUpdateCheck = false;
mutableExtensionsDir = false;
extensions = with (inputs.vscode-extensions.extensions."${system}".forVSCodeVersion (
# Get pkgs.vscodium version, and remove the 4th part (forVSCodeVersion only expects 3 parts)
# By using forVSCodeVersion, any unsupported versions are automatically excluded and this config
# won't build (rather than only finding out in vscode itself)
pkgs.lib.strings.concatStringsSep "." (
pkgs.lib.lists.take 3 (
pkgs.lib.strings.splitString "." vscode-package.version
)
)
)); (
(with open-vsx; [
# Language support
rust-lang.rust-analyzer # Rust
llvm-vs-code-extensions.vscode-clangd # C++
vadimcn.vscode-lldb # C++ Debugging
jnoortheen.nix-ide # Nix
tamasfe.even-better-toml # TOML
yzhang.markdown-all-in-one # Markdown
denoland.vscode-deno # Deno JS/TS
# Theming
pkief.material-icon-theme # Material icons
# Utilities
streetsidesoftware.code-spell-checker # Spellchecking
jeanp413.open-remote-ssh # Remote SSH
])
++ (with vscode-marketplace; [
yy0931.save-as-root # Save as root over SSH
])
);
extensions = with inputs.vscode-extensions.extensions."${system}".open-vsx; [
# Language support
rust-lang.rust-analyzer # Rust
llvm-vs-code-extensions.vscode-clangd # C++
vadimcn.vscode-lldb # C++ Debugging
jnoortheen.nix-ide # Nix
tamasfe.even-better-toml # TOML
yzhang.markdown-all-in-one # Markdown
denoland.vscode-deno # Deno JS/TS
# Theming
pkief.material-icon-theme # Material icons
# Utilities
streetsidesoftware.code-spell-checker # Spellchecking
];
userSettings = {
# Editor
"editor.fontFamily" = "'FiraCode Nerd Font Mono', 'Droid Sans Mono', 'monospace', monospace";
"editor.indentSize" = "tabSize";
"editor.tabSize" = 4;
"files.associations" = {
"*.hujson" = "jsonc";
};
# JJ
"files.watcherExclude" = {
"**/.git/objects/**" = true;

View file

@ -14,7 +14,6 @@
./nvidia.nix
./packages.nix
./sound.nix
./swap.nix
./users.nix
];
}

View file

@ -2,30 +2,29 @@
{
# Configure dual-gpu AMD+Nvidia
hardware.graphics.enable = true;
services.xserver.videoDrivers = ["amdgpu"];
# services.xserver.videoDrivers = ["nvidia" "amdgpu"];
# hardware.nvidia = {
# modesetting.enable = true;
services.xserver.videoDrivers = ["nvidia" "amdgpu"];
hardware.nvidia = {
modesetting.enable = true;
# # Experimental nvidia power management
# powerManagement.enable = false;
# Experimental nvidia power management
powerManagement.enable = false;
# # Experimentally turn off Nvidia GPU when not in use
# powerManagement.finegrained = true;
# Experimentally turn off Nvidia GPU when not in use
powerManagement.finegrained = true;
# open = false; # Open source module is still very much beta
open = false; # Open source module is still very much beta
# nvidiaSettings = true;
nvidiaSettings = true;
# # Configure dual-gpu offloading
# prime = {
# amdgpuBusId = "PCI:4:0:0";
# nvidiaBusId = "PCI:1:0:0";
# Configure dual-gpu offloading
prime = {
amdgpuBusId = "PCI:4:0:0";
nvidiaBusId = "PCI:1:0:0";
# offload = {
# enable = true;
# enableOffloadCmd = true;
# };
# };
# };
offload = {
enable = true;
enableOffloadCmd = true;
};
};
};
}

View file

@ -1,4 +1,4 @@
{ pkgs, inputs, ... }:
{ pkgs, ... }:
{
# Install system packages
environment.systemPackages = with pkgs; [
@ -22,10 +22,6 @@
# Install zsh
programs.zsh.enable = true;
# Disable default command-not-found (it doesn't work with flakes)
programs.command-not-found.enable = false;
programs.nix-index.enable = true;
# Manage default firefox web browser install
programs.firefox = {
enable = true;

View file

@ -1,7 +0,0 @@
{ ... }:
{
zramSwap = {
enable = true;
algorithm = "zstd";
};
}

View file

@ -1,44 +0,0 @@
{ lib
, bash
, fetchFromGitHub
, rustPlatform
, pkg-config
, openssl
, dbus
}:
rustPlatform.buildRustPackage rec {
pname = "rescrobbled";
version = "0.7.1";
src = fetchFromGitHub {
owner = "InputUsername";
repo = "rescrobbled";
rev = "v${version}";
hash = "sha256-1E+SeKjHCah+IFn2QLAyyv7jgEcZ1gtkh8iHgiVBuz4=";
};
cargoHash = "sha256-ZJbyYFvGTuXt1aqhGOATcDRrkTk7SorWXkN81sUoDdo=";
nativeBuildInputs = [ pkg-config ];
buildInputs = [ openssl dbus ];
postPatch = ''
# Required for tests
substituteInPlace src/filter.rs --replace '#!/usr/bin/bash' '#!${bash}/bin/bash'
'';
postInstall = ''
substituteInPlace rescrobbled.service --replace '%h/.cargo/bin/rescrobbled' "$out/bin/rescrobbled"
'';
meta = with lib; {
description = "MPRIS music scrobbler daemon";
homepage = "https://github.com/InputUsername/rescrobbled";
license = licenses.gpl3Plus;
mainProgram = "rescrobbled";
platforms = platforms.unix;
};
}

View file

@ -4,21 +4,6 @@
# The API key to use for google custom search lyrics backend
google_api_key = null;
};
rescrobbled = {
enable = false;
# The credentials to use for last.fm and listenbrainz
lastfm = {
key = null;
secret = null;
# Generated by manually running the rescrobbled daemon and reading $XDG_CONFIG_HOME/rescrobbled/session
session = null;
};
listenbrainz = {
token = null;
};
};
};
passwords = {