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 ## 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 ### 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. 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 | | Package | License | Original Link |
| ------------------- | ------- | ---------------------------------------------------------------------------------| | ------------------- | ------- | ---------------------------------------------------------------------- |
| BeautyLine (Garuda) | GPLv3 | https://gitlab.com/garuda-linux/themes-and-settings/artwork/beautyline | | BeautyLine (Garuda) | GPLv3 | https://gitlab.com/garuda-linux/themes-and-settings/artwork/beautyline |
| Magna Splash 6 | GPLv3 | https://www.pling.com/p/2136626/ | | Magna Splash 6 | GPLv3 | https://www.pling.com/p/2136626/ |
| Rescrobbled | GPLv3 | https://github.com/NixOS/nixpkgs/pull/274553 (unmerged nixpkgs PR by negatethis) |

63
flake.lock generated
View file

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

View file

@ -5,11 +5,6 @@
# General NixOS config # General NixOS config
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
nixpkgs-24-11.url = "github:NixOS/nixpkgs/nixos-24.11"; 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 (hyperfluent)
nixos-grub-themes = { nixos-grub-themes = {
url = "github:jeslie0/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"; system = "x86_64-linux";
pkgs = nixpkgs.legacyPackages.${system}; pkgs = nixpkgs.legacyPackages.${system};
secrets = import ./secrets.nix; secrets = import ./secrets.nix;
@ -61,10 +56,6 @@
modules = [ modules = [
./hosts/laptop ./hosts/laptop
# Better command-not-found
nix-index-database.nixosModules.nix-index
{ programs.nix-index-database.comma.enable = true; }
# Home manager # Home manager
home-manager.nixosModules.home-manager home-manager.nixosModules.home-manager
./home-manager ./home-manager
@ -83,7 +74,6 @@
# the path to your home.nix. # the path to your home.nix.
modules = [ modules = [
plasma-manager.homeManagerModules.plasma-manager plasma-manager.homeManagerModules.plasma-manager
./home-manager/custom-modules
./home-manager/home.nix ./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.useGlobalPkgs = true;
home-manager.useUserPackages = true; home-manager.useUserPackages = true;
home-manager.sharedModules = [ home-manager.sharedModules = [ inputs.plasma-manager.homeManagerModules.plasma-manager ];
inputs.plasma-manager.homeManagerModules.plasma-manager
./custom-modules
];
home-manager.extraSpecialArgs = { home-manager.extraSpecialArgs = {
inherit inputs system secrets; inherit inputs system secrets;
}; };

View file

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

View file

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

View file

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

View file

@ -7,7 +7,6 @@
# Video # Video
jellyfin-media-player jellyfin-media-player
vlc
# Chat # Chat
element-desktop element-desktop
@ -23,8 +22,6 @@
# Programming # Programming
nixd # NixD LSP for .nix files nixd # NixD LSP for .nix files
clang
clang-tools
deno deno
# :3 # :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 = [ imports = [
./btop.nix
./konsole.nix
./starship.nix
./zsh.nix ./zsh.nix
./starship.nix
./konsole.nix
./btop.nix
]; ];
} }

View file

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

View file

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

View file

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

View file

@ -2,30 +2,29 @@
{ {
# Configure dual-gpu AMD+Nvidia # Configure dual-gpu AMD+Nvidia
hardware.graphics.enable = true; hardware.graphics.enable = true;
services.xserver.videoDrivers = ["amdgpu"]; services.xserver.videoDrivers = ["nvidia" "amdgpu"];
# services.xserver.videoDrivers = ["nvidia" "amdgpu"]; hardware.nvidia = {
# hardware.nvidia = { modesetting.enable = true;
# modesetting.enable = true;
# # Experimental nvidia power management # Experimental nvidia power management
# powerManagement.enable = false; powerManagement.enable = false;
# # Experimentally turn off Nvidia GPU when not in use # Experimentally turn off Nvidia GPU when not in use
# powerManagement.finegrained = true; 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 # Configure dual-gpu offloading
# prime = { prime = {
# amdgpuBusId = "PCI:4:0:0"; amdgpuBusId = "PCI:4:0:0";
# nvidiaBusId = "PCI:1:0:0"; nvidiaBusId = "PCI:1:0:0";
# offload = { offload = {
# enable = true; enable = true;
# enableOffloadCmd = true; enableOffloadCmd = true;
# }; };
# }; };
# }; };
} }

View file

@ -1,4 +1,4 @@
{ pkgs, inputs, ... }: { pkgs, ... }:
{ {
# Install system packages # Install system packages
environment.systemPackages = with pkgs; [ environment.systemPackages = with pkgs; [
@ -22,10 +22,6 @@
# Install zsh # Install zsh
programs.zsh.enable = true; 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 # Manage default firefox web browser install
programs.firefox = { programs.firefox = {
enable = true; 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 # The API key to use for google custom search lyrics backend
google_api_key = null; 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 = { passwords = {