Compare commits

..

10 commits

71 changed files with 1208 additions and 400 deletions

3
.gitignore vendored
View file

@ -1 +1,2 @@
secrets.nix
secrets.nix
result

366
flake.lock generated
View file

@ -16,20 +16,42 @@
"type": "github"
}
},
"colmena": {
"inputs": {
"flake-compat": "flake-compat",
"flake-utils": "flake-utils",
"nix-github-actions": "nix-github-actions",
"nixpkgs": "nixpkgs",
"stable": "stable"
},
"locked": {
"lastModified": 1731527002,
"narHash": "sha256-dI9I6suECoIAmbS4xcrqF8r2pbmed8WWm5LIF1yWPw8=",
"owner": "zhaofengli",
"repo": "colmena",
"rev": "e3ad42138015fcdf2524518dd564a13145c72ea1",
"type": "github"
},
"original": {
"owner": "zhaofengli",
"repo": "colmena",
"type": "github"
}
},
"firefox-addons": {
"inputs": {
"flake-utils": "flake-utils",
"flake-utils": "flake-utils_2",
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"dir": "/pkgs/firefox-addons",
"lastModified": 1733875367,
"narHash": "sha256-eBMHOM1KvbK8dTrM4N8ytNl8NeJF4lLyoPBRae1CqKs=",
"lastModified": 1734648163,
"narHash": "sha256-AK7nqONfzyxUzqVVeRoniO6NRv4SaxPrXwuyY8jtCXs=",
"owner": "rycee",
"repo": "nur-expressions",
"rev": "bda0131e0a7b6b5b687f5ffd8a8622054e7c444d",
"rev": "2b5a7eb2719b146f6308dfa51c9a1c4b03d965a3",
"type": "gitlab"
},
"original": {
@ -42,7 +64,7 @@
"firefox-nightly": {
"inputs": {
"cachix": "cachix",
"flake-compat": "flake-compat",
"flake-compat": "flake-compat_2",
"lib-aggregate": "lib-aggregate",
"mozilla": "mozilla",
"nixpkgs": [
@ -50,11 +72,11 @@
]
},
"locked": {
"lastModified": 1733834155,
"narHash": "sha256-5A7EfzSmdApKmfHGtGZ4NQvMEpI/NI6VIzTNq9sUH4E=",
"lastModified": 1734743419,
"narHash": "sha256-MAl+QDhPVXypYKjLZ6WU5JLY8VjGt4lecdmwCkBwMN8=",
"owner": "nix-community",
"repo": "flake-firefox-nightly",
"rev": "f0ab3cfa3607e08169b1d87e63fe9b1e5a57f515",
"rev": "dfb2631ee449ba3df206cb8f1d9558f242851e0b",
"type": "github"
},
"original": {
@ -64,6 +86,22 @@
}
},
"flake-compat": {
"flake": false,
"locked": {
"lastModified": 1650374568,
"narHash": "sha256-Z+s0J8/r907g149rllvwhb4pKi8Wam5ij0st8PwAh+E=",
"owner": "edolstra",
"repo": "flake-compat",
"rev": "b4a34015c698c7793d592d66adbab377907a2be8",
"type": "github"
},
"original": {
"owner": "edolstra",
"repo": "flake-compat",
"type": "github"
}
},
"flake-compat_2": {
"locked": {
"lastModified": 1717312683,
"narHash": "sha256-FrlieJH50AuvagamEvWMIE6D2OAnERuDboFDYAED/dE=",
@ -78,7 +116,7 @@
"type": "github"
}
},
"flake-compat_2": {
"flake-compat_3": {
"flake": false,
"locked": {
"lastModified": 1696426674,
@ -95,6 +133,21 @@
}
},
"flake-utils": {
"locked": {
"lastModified": 1659877975,
"narHash": "sha256-zllb8aq3YO3h8B/U0/J1WBgAL8EX5yWf5pMj3G0NAmc=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "c0e246b9b83f637f4681389ecabcb2681b4f3af0",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"flake-utils_2": {
"locked": {
"lastModified": 1629284811,
"narHash": "sha256-JHgasjPR0/J1J3DRm4KxM4zTyAj4IOJY8vIl75v/kPI=",
@ -109,7 +162,7 @@
"type": "github"
}
},
"flake-utils_2": {
"flake-utils_3": {
"inputs": {
"systems": "systems"
},
@ -127,9 +180,9 @@
"type": "github"
}
},
"flake-utils_3": {
"flake-utils_4": {
"inputs": {
"systems": "systems_2"
"systems": "systems_3"
},
"locked": {
"lastModified": 1710146030,
@ -145,9 +198,9 @@
"type": "github"
}
},
"flake-utils_4": {
"flake-utils_5": {
"inputs": {
"systems": "systems_3"
"systems": "systems_4"
},
"locked": {
"lastModified": 1681202837,
@ -163,6 +216,30 @@
"type": "github"
}
},
"flatpaks": {
"inputs": {
"home-manager": [
"home-manager"
],
"nixpkgs": [
"nixpkgs"
],
"systems": "systems_2"
},
"locked": {
"lastModified": 1733581530,
"narHash": "sha256-W+orHmF+XpZosrBFAFRs7sS1iVKYveg9SutkzSXMVsI=",
"owner": "GermanBread",
"repo": "declarative-flatpak",
"rev": "b88bd5b65f8e7c35eec0a90cfd6e096b2e7f79c0",
"type": "github"
},
"original": {
"owner": "GermanBread",
"repo": "declarative-flatpak",
"type": "github"
}
},
"home-manager": {
"inputs": {
"nixpkgs": [
@ -170,11 +247,11 @@
]
},
"locked": {
"lastModified": 1733873195,
"narHash": "sha256-dTosiZ3sZ/NKoLKQ++v8nZdEHya0eTNEsaizNp+MUPM=",
"lastModified": 1734622215,
"narHash": "sha256-OOfI0XhSJGHblfdNDhfnn8QnZxng63rWk9eeJ2tCbiI=",
"owner": "nix-community",
"repo": "home-manager",
"rev": "f26aa4b76fb7606127032d33ac73d7d507d82758",
"rev": "1395379a7a36e40f2a76e7b9936cc52950baa1be",
"type": "github"
},
"original": {
@ -186,15 +263,15 @@
},
"lib-aggregate": {
"inputs": {
"flake-utils": "flake-utils_2",
"flake-utils": "flake-utils_3",
"nixpkgs-lib": "nixpkgs-lib"
},
"locked": {
"lastModified": 1733660018,
"narHash": "sha256-DHW2Hzyo8W6wVPGFaYLM9mKMH/qAtHJSUZ4ti7LHMCY=",
"lastModified": 1734264809,
"narHash": "sha256-94fu5E0gM8aMY0bX/ix7BWGf/e/OfGjoCtNrJfwL0dM=",
"owner": "nix-community",
"repo": "lib-aggregate",
"rev": "f710791be27b31ea1ee9c40a94d08bcbba99b3c0",
"rev": "46bedda9e45f2735f41ec3c01cba2b8ce7ba9808",
"type": "github"
},
"original": {
@ -219,6 +296,53 @@
"type": "github"
}
},
"nix-formatter-pack": {
"inputs": {
"nixpkgs": [
"nix-on-droid",
"nixpkgs"
],
"nmd": [
"nix-on-droid",
"nmd"
],
"nmt": "nmt"
},
"locked": {
"lastModified": 1705252799,
"narHash": "sha256-HgSTREh7VoXjGgNDwKQUYcYo13rPkltW7IitHrTPA5c=",
"owner": "Gerschtli",
"repo": "nix-formatter-pack",
"rev": "2de39dedd79aab14c01b9e2934842051a160ffa5",
"type": "github"
},
"original": {
"owner": "Gerschtli",
"repo": "nix-formatter-pack",
"type": "github"
}
},
"nix-github-actions": {
"inputs": {
"nixpkgs": [
"colmena",
"nixpkgs"
]
},
"locked": {
"lastModified": 1729742964,
"narHash": "sha256-B4mzTcQ0FZHdpeWcpDYPERtyjJd/NIuaQ9+BV1h+MpA=",
"owner": "nix-community",
"repo": "nix-github-actions",
"rev": "e04df33f62cdcf93d73e9a04142464753a16db67",
"type": "github"
},
"original": {
"owner": "nix-community",
"repo": "nix-github-actions",
"type": "github"
}
},
"nix-index-database": {
"inputs": {
"nixpkgs": [
@ -226,11 +350,11 @@
]
},
"locked": {
"lastModified": 1733629314,
"narHash": "sha256-U0vivjQFAwjNDYt49Krevs1murX9hKBFe2Ye0cHpgbU=",
"lastModified": 1734234111,
"narHash": "sha256-icEMqBt4HtGH52PU5FHidgBrNJvOfXH6VQKNtnD1aw8=",
"owner": "nix-community",
"repo": "nix-index-database",
"rev": "f1e477a7dd11e27e7f98b646349cd66bbabf2fb8",
"rev": "311d6cf3ad3f56cb051ffab1f480b2909b3f754d",
"type": "github"
},
"original": {
@ -239,6 +363,33 @@
"type": "github"
}
},
"nix-on-droid": {
"inputs": {
"home-manager": [
"home-manager"
],
"nix-formatter-pack": "nix-formatter-pack",
"nixpkgs": [
"nixpkgs"
],
"nixpkgs-docs": "nixpkgs-docs",
"nixpkgs-for-bootstrap": "nixpkgs-for-bootstrap",
"nmd": "nmd"
},
"locked": {
"lastModified": 1725658585,
"narHash": "sha256-P29z4Gt89n5ps1U7+qmIrj0BuRXGZQSIaOe2+tsPgfw=",
"owner": "nix-community",
"repo": "nix-on-droid",
"rev": "5d88ff2519e4952f8d22472b52c531bb5f1635fc",
"type": "github"
},
"original": {
"owner": "nix-community",
"repo": "nix-on-droid",
"type": "github"
}
},
"nixos-grub-themes": {
"inputs": {
"nixpkgs": [
@ -261,11 +412,11 @@
},
"nixpkgs": {
"locked": {
"lastModified": 1733759999,
"narHash": "sha256-463SNPWmz46iLzJKRzO3Q2b0Aurff3U1n0nYItxq7jU=",
"lastModified": 1730785428,
"narHash": "sha256-Zwl8YgTVJTEum+L+0zVAWvXAGbWAuXHax3KzuejaDyo=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "a73246e2eef4c6ed172979932bc80e1404ba2d56",
"rev": "4aa36568d413aca0ea84a1684d2d46f55dbabad7",
"type": "github"
},
"original": {
@ -275,29 +426,45 @@
"type": "github"
}
},
"nixpkgs-24-11": {
"nixpkgs-docs": {
"locked": {
"lastModified": 1733550349,
"narHash": "sha256-NcGumB4Lr6KSDq+nIqXtNA8QwAQKDSZT7N9OTGWbTrs=",
"lastModified": 1705957679,
"narHash": "sha256-Q8LJaVZGJ9wo33wBafvZSzapYsjOaNjP/pOnSiKVGHY=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "e2605d0744c2417b09f8bf850dfca42fcf537d34",
"rev": "9a333eaa80901efe01df07eade2c16d183761fa3",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixos-24.11",
"ref": "release-23.05",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs-for-bootstrap": {
"locked": {
"lastModified": 1720244366,
"narHash": "sha256-WrDV0FPMVd2Sq9hkR5LNHudS3OSMmUrs90JUTN+MXpA=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "49ee0e94463abada1de470c9c07bfc12b36dcf40",
"type": "github"
},
"original": {
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "49ee0e94463abada1de470c9c07bfc12b36dcf40",
"type": "github"
}
},
"nixpkgs-lib": {
"locked": {
"lastModified": 1733620091,
"narHash": "sha256-5WoMeCkaXqTZwwCNLRzyLxEJn8ISwjx4cNqLgqKwg9s=",
"lastModified": 1734224914,
"narHash": "sha256-hKWALzQ/RxxXdKWsLKXULru6XTag9Cc5exgVyS4a/AE=",
"owner": "nix-community",
"repo": "nixpkgs.lib",
"rev": "f4dc9a6c02e5e14d91d158522f69f6ab4194eb5b",
"rev": "538697b664a64fade8ce628d01f35d1f1fd82d77",
"type": "github"
},
"original": {
@ -308,16 +475,56 @@
},
"nixpkgs_2": {
"locked": {
"lastModified": 1682134069,
"narHash": "sha256-TnI/ZXSmRxQDt2sjRYK/8j8iha4B4zP2cnQCZZ3vp7k=",
"lastModified": 1734424634,
"narHash": "sha256-cHar1vqHOOyC7f1+tVycPoWTfKIaqkoe1Q6TnKzuti4=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "fd901ef4bf93499374c5af385b2943f5801c0833",
"rev": "d3c42f187194c26d9f0309a8ecc469d6c878ce33",
"type": "github"
},
"original": {
"id": "nixpkgs",
"type": "indirect"
"owner": "NixOS",
"ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"nmd": {
"inputs": {
"nixpkgs": [
"nix-on-droid",
"nixpkgs-docs"
],
"scss-reset": "scss-reset"
},
"locked": {
"lastModified": 1705050560,
"narHash": "sha256-x3zzcdvhJpodsmdjqB4t5mkVW22V3wqHLOun0KRBzUI=",
"owner": "~rycee",
"repo": "nmd",
"rev": "66d9334933119c36f91a78d565c152a4fdc8d3d3",
"type": "sourcehut"
},
"original": {
"owner": "~rycee",
"repo": "nmd",
"type": "sourcehut"
}
},
"nmt": {
"flake": false,
"locked": {
"lastModified": 1648075362,
"narHash": "sha256-u36WgzoA84dMVsGXzml4wZ5ckGgfnvS0ryzo/3zn/Pc=",
"owner": "rycee",
"repo": "nmt",
"rev": "d83601002c99b78c89ea80e5e6ba21addcfe12ae",
"type": "gitlab"
},
"original": {
"owner": "rycee",
"repo": "nmt",
"type": "gitlab"
}
},
"plasma-manager": {
@ -345,19 +552,37 @@
},
"root": {
"inputs": {
"colmena": "colmena",
"firefox-addons": "firefox-addons",
"firefox-nightly": "firefox-nightly",
"flatpaks": "flatpaks",
"home-manager": "home-manager",
"nix-index-database": "nix-index-database",
"nix-on-droid": "nix-on-droid",
"nixos-grub-themes": "nixos-grub-themes",
"nixpkgs": "nixpkgs",
"nixpkgs-24-11": "nixpkgs-24-11",
"nixpkgs": "nixpkgs_2",
"plasma-manager": "plasma-manager",
"sddm-sugar-candy-nix": "sddm-sugar-candy-nix",
"vscode-extensions": "vscode-extensions",
"vscode-server": "vscode-server"
}
},
"scss-reset": {
"flake": false,
"locked": {
"lastModified": 1631450058,
"narHash": "sha256-muDlZJPtXDIGevSEWkicPP0HQ6VtucbkMNygpGlBEUM=",
"owner": "andreymatin",
"repo": "scss-reset",
"rev": "0cf50e27a4e95e9bb5b1715eedf9c54dee1a5a91",
"type": "github"
},
"original": {
"owner": "andreymatin",
"repo": "scss-reset",
"type": "github"
}
},
"sddm-sugar-candy-nix": {
"inputs": {
"nixpkgs": [
@ -378,6 +603,22 @@
"type": "github"
}
},
"stable": {
"locked": {
"lastModified": 1730883749,
"narHash": "sha256-mwrFF0vElHJP8X3pFCByJR365Q2463ATp2qGIrDUdlE=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "dba414932936fde69f0606b4f1d87c5bc0003ede",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixos-24.05",
"repo": "nixpkgs",
"type": "github"
}
},
"systems": {
"locked": {
"lastModified": 1681028828,
@ -395,16 +636,16 @@
},
"systems_2": {
"locked": {
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
"lastModified": 1689347949,
"narHash": "sha256-12tWmuL2zgBgZkdoB6qXZsgJEH9LR3oUgpaQq2RbI80=",
"owner": "nix-systems",
"repo": "default",
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
"repo": "default-linux",
"rev": "31732fcf5e8fea42e59c2488ad31a0e651500f68",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default",
"repo": "default-linux",
"type": "github"
}
},
@ -423,20 +664,35 @@
"type": "github"
}
},
"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"
}
},
"vscode-extensions": {
"inputs": {
"flake-compat": "flake-compat_2",
"flake-utils": "flake-utils_3",
"flake-compat": "flake-compat_3",
"flake-utils": "flake-utils_4",
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1733795858,
"narHash": "sha256-K595Q2PrZv2iiumdBkwM2G456T2lKsLD71bn/fbJiQ0=",
"lastModified": 1734659394,
"narHash": "sha256-rI7fcI4+J+iAiCvQ0J3hECJJGD9cAVTAFRTj1xrX6Qo=",
"owner": "nix-community",
"repo": "nix-vscode-extensions",
"rev": "66ced222ef9235f90dbdd754ede3d6476722aaa9",
"rev": "1792f1bbfccbd5ebcb745250e4fc57067c6dfd9c",
"type": "github"
},
"original": {
@ -447,8 +703,10 @@
},
"vscode-server": {
"inputs": {
"flake-utils": "flake-utils_4",
"nixpkgs": "nixpkgs_2"
"flake-utils": "flake-utils_5",
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1729422940,

114
flake.nix
View file

@ -4,7 +4,11 @@
inputs = {
# General NixOS config
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
nixpkgs-24-11.url = "github:NixOS/nixpkgs/nixos-24.11";
# Colmena unstable
colmena = {
url = "github:zhaofengli/colmena";
# inputs.nixpkgs.follows = "nixpkgs";
};
# Nixpkgs index for command-not-found support
nix-index-database = {
url = "github:nix-community/nix-index-database";
@ -40,7 +44,7 @@
owner = "rycee";
repo = "nur-expressions";
dir = "/pkgs/firefox-addons";
inputs.nixpkgs.follows = "nixpkgs";
};
# VSCode extensions
@ -49,76 +53,58 @@
inputs.nixpkgs.follows = "nixpkgs";
};
# VSCode server support
vscode-server.url = "github:nix-community/nixos-vscode-server";
vscode-server = {
url = "github:nix-community/nixos-vscode-server";
inputs.nixpkgs.follows = "nixpkgs";
};
# Flatpak support
flatpaks = {
url = "github:GermanBread/declarative-flatpak";
inputs.nixpkgs.follows = "nixpkgs";
inputs.home-manager.follows = "home-manager";
};
# Nix-on-droid support
nix-on-droid = {
url = "github:nix-community/nix-on-droid";
inputs = {
nixpkgs.follows = "nixpkgs";
home-manager.follows = "home-manager";
};
};
};
outputs = inputs@{ nixpkgs, home-manager, plasma-manager, nix-index-database, vscode-server, ... }: let
system = "x86_64-linux";
pkgs = nixpkgs.legacyPackages.${system};
secrets = import ./secrets.nix;
outputs = inputs@{ self, nixpkgs, colmena, nix-on-droid, ... }: let
utils = import ./utils {
inherit inputs;
secrets = import ./secrets.nix;
};
in {
nixosConfigurations.ty-nixos = nixpkgs.lib.nixosSystem {
inherit system;
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
{
ty-home-manager-options = {
plasma.enable = true;
beets.enable = true;
firefox.enable = true;
thunderbird.enable = true;
rescrobbled.enable = true;
vscode.enable = true;
};
}
];
specialArgs = {
inherit inputs system secrets;
};
# Setup nixos-rebuild configurations
nixosConfigurations = {
"ty-nixos" = utils.createNixosSystem { entrypoint = ./hosts/laptop; };
"ty-laptop-server" = utils.createNixosSystem { entrypoint = ./hosts/laptop-server; };
};
nixosConfigurations."ty-laptop-server" = nixpkgs.lib.nixosSystem {
inherit system;
modules = [
./hosts/laptop-server
# 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
# Setup colmena configurations
colmena = utils.createColmenaHive {
hostConfigs = [
{
ty-home-manager-options = {
plasma.enable = false;
beets.enable = false;
firefox.enable = false;
thunderbird.enable = false;
rescrobbled.enable = false;
vscode.enable = false;
};
name = "ty-nixos";
entrypoint = ./hosts/laptop;
allowLocal = true;
}
{
name = "ty-laptop-server";
entrypoint = ./hosts/laptop-server;
sshHost = "old-lenovo-laptop";
}
# VSCode server support
vscode-server.nixosModules.default
({ pkgs, ... }: { services.vscode-server = { enable = true; nodejsPackage = pkgs.nodejs-18_x; installPath = "$HOME/.vscodium-server"; }; })
];
specialArgs = {
inherit inputs system secrets;
};
};
# Setup nix-on-droid configurations
nixOnDroidConfigurations.default = utils.createDroidSystem { entrypoint = ./nix-on-droid/ty-pixel; };
# Enable direct flake support for colmena
colmenaHive = colmena.lib.makeHive self.outputs.colmena;
};
}

View file

@ -1,7 +1,7 @@
{ lib, config, ... }:
{ ... }:
{
imports = [
./email.nix
./ssh.nix
];
}
}

View file

@ -1,6 +1,6 @@
{ lib, ty-home-manager-options, ... }:
{ lib, config, ... }:
{
accounts.email.accounts = lib.mkIf ty-home-manager-options.thunderbird.enable {
accounts.email.accounts = lib.mkIf config.meta.home-manager.email.enable {
PurelyMail = rec {
realName = "Tyler Beckman";
address = "ty@myriation.xyz";
@ -38,7 +38,7 @@
};
};
thunderbird.enable = true;
thunderbird.enable = config.meta.home-manager.email.thunderbird.enable;
};
Gmail = rec {
@ -62,7 +62,7 @@
smtp.tls.useStartTls = false;
thunderbird.enable = true;
thunderbird.enable = config.meta.home-manager.email.thunderbird.enable;
};
School = rec {

View file

@ -1,6 +1,6 @@
{ lib, secrets, ty-home-manager-options, ... }:
{ lib, secrets, config, ... }:
{
programs.beets = lib.mkIf ty-home-manager-options.beets.enable {
programs.beets = lib.mkIf config.meta.home-manager.beets.enable {
enable = true;
settings = {

View file

@ -0,0 +1,23 @@
{ ... }:
{
imports = [
# Directories
./accounts
./shell
./vcs
# Individual files
./beets.nix
./desktop.nix
./flatpak.nix
./firefox.nix
./gpg.nix
./gtk.nix
./packages.nix
./plasma.nix
./prismlauncher.nix
./rescrobbled.nix
./thunderbird.nix
./vscode.nix
./zed.nix
];
}

View file

@ -1,6 +1,6 @@
{ lib, ty-home-manager-options, ... }:
{ lib, config, ... }:
{
xdg.desktopEntries = lib.mkIf ty-home-manager-options.plasma.enable {
xdg.desktopEntries = lib.mkIf config.meta.home-manager.desktop.enable {
# Override vesktop for matching icon in beautyline (make it generic discord icon)
vesktop = {
categories = [ "Network" "InstantMessaging" "Chat" ];

View file

@ -1,6 +1,6 @@
{ pkgs, inputs, system, lib, ty-home-manager-options, ... }:
{ pkgs, inputs, system, lib, config, ... }:
{
programs.firefox = lib.mkIf ty-home-manager-options.firefox.enable {
programs.firefox = lib.mkIf config.meta.home-manager.firefox.enable {
enable = true;
policies = {
ExtensionSettings = {
@ -160,8 +160,8 @@
};
# NixOS Wiki Search
"NixOS Wiki" = {
urls = [{ template = "https://nixos.wiki/index.php?search={searchTerms}"; }];
iconUpdateURL = "https://nixos.wiki/favicon.png";
urls = [{ template = "https://wiki.nixos.org/w/index.php?search={searchTerms}"; }];
iconUpdateURL = "https://wiki.nixos.org/nixos.png";
updateInterval = 24 * 60 * 60 * 1000; # every day
definedAliases = [ "@nw" ];
};

View file

@ -0,0 +1,15 @@
{ lib, config, ... }:
{
xdg.systemDirs.data = lib.optionals
config.meta.home-manager.desktop.enable
[ "/var/lib/flatpak/exports/share" "${config.xdg.dataHome}/flatpak/exports/share" ];
services.flatpak = lib.mkIf config.meta.home-manager.desktop.enable {
enableModule = true;
packages = [
"sober:app/org.vinegarhq.Sober/x86_64/master"
];
remotes = {
sober = "https://sober.vinegarhq.org/sober.flatpakref";
};
};
}

View file

@ -1,4 +1,4 @@
{ pkgs, ... }:
{ pkgs, config, ... }:
{
programs.gpg = {
enable = true;
@ -56,9 +56,9 @@
enable = true;
enableSshSupport = true;
enableZshIntegration = true;
pinentryPackage = pkgs.pinentry-qt;
pinentryPackage = if (config.meta.home-manager.desktop.enable) then pkgs.pinentry-qt else pkgs.pinentry-tty;
sshKeys = [
"817A829FB1FB95441156F93C7F4FD04ACDDE5E48 0"
];
};
}
}

View file

@ -1,12 +1,12 @@
{ pkgs, lib, config, ty-home-manager-options, ... }:
{ pkgs, lib, config, ... }:
{
config = lib.mkIf ty-home-manager-options.plasma.enable {
config = lib.mkIf config.meta.home-manager.desktop.enable {
gtk = {
enable = true;
gtk2.configLocation = "${config.xdg.configHome}/gtk-2.0/gtkrc";
theme = {
theme = lib.mkIf config.meta.home-manager.desktop.plasma.enable {
name = "Breeze-Dark";
package = pkgs.kdePackages.breeze-gtk;
};

View file

@ -0,0 +1,91 @@
{ pkgs, inputs, system, lib, config, ... }:
{
home.packages =
## Packages that are always installed, no matter what
(with pkgs; [
# :3
fastfetch # Modern & faster neofetch alternative
# CLI Tools
ripgrep # Text searching and manipulation
jq # JSON filtering
eza # Directory lister
bat # File reading
doggo # DNS Requests
nmap # Network scanning
glow # Markdown rendering
tealdeer # TLDR
usbutils # `lsusb`
pciutils # `lspci`
unzip # Extract zip files
# Editor
neovim # CLI-Based editor
# Process tools
btop # Process monitor
hyperfine # CLI Benchmarker
])
## Packages that are only installed when a desktop environment is desired
++ (lib.optionals config.meta.home-manager.desktop.enable (with pkgs; [
# Documents
logseq # Outliner
libreoffice-qt6-fresh # Office-style editing
hunspell
hunspellDicts.en_US-large
# Video
jellyfin-media-player # Jellyfin electron client w/ MPV
vlc # Video file player
# Chat
element-desktop # Matrix client
vesktop # Discord client
signal-desktop # Signal client
# KDE Themes
vimix-cursors # Cursors
(pkgs.callPackage ../../packages/beautyline {}) # Icons
(pkgs.callPackage ../../packages/magna-splash-6 {}) # Splash
# Programming
jetbrains.idea-ultimate # Jetbrains IntelliJ Idea Ultimate IDE
jetbrains.rust-rover # Jetbrains Rust IDE
nixd # LSP for .nix files
gcc # GNU C++ Compiler
(lib.meta.hiPrio clang) # LLVM C++ Compiler (better than g++)
clang-tools # Clang language server
cling # C++ REPL
deno # Typescript & Javascript runtime
gnumake # Makefile support
httptoolkit # HTTP Interception
android-tools # ADB and the such
beekeeper-studio # SQL Database viewer
# Games
(heroic.override {
extraPkgs = pkgs: [
pkgs.gamemode
pkgs.gamescope
];
}) # GOG & Epic Games Launcher
# UI Tools
qalculate-qt # Calculator
# Process tools cont.
nvtopPackages.full # GPU Monitor, only really necessary if we have a GPU to look at
]))
## Packages that are only installed if plasma is used as the desktop environment
++ (lib.optionals config.meta.home-manager.desktop.plasma.enable (with pkgs.kdePackages; [
kate # IDE
elisa # Music
kdeconnect-kde # Phone sync
polkit-kde-agent-1 # Polkit authentication popup support
]))
## Firefox is only installed when requested
++ (lib.optionals config.meta.home-manager.firefox.enable [
# Firefox nightly
inputs.firefox-nightly.packages.${system}.firefox-nightly-bin
]);
}

View file

@ -1,6 +1,6 @@
{ pkgs, lib, ty-home-manager-options, ... }:
{ pkgs, lib, config, ... }:
{
programs.plasma = lib.mkIf ty-home-manager-options.plasma.enable {
programs.plasma = lib.mkIf config.meta.home-manager.desktop.plasma.enable {
enable = true;
workspace = {

View file

@ -0,0 +1,6 @@
{ config, lib, ... }:
{
programs.custom.prism-launcher = lib.mkIf config.meta.home-manager.desktop.enable {
enable = true;
};
}

View file

@ -0,0 +1,23 @@
{ secrets, lib, config, ... }:
{
config = lib.mkIf config.meta.home-manager.rescrobbled.enable {
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

@ -9,6 +9,7 @@
truecolor = true;
shown_boxes = "proc cpu mem net gpu0";
update_ms = 100;
temp_scale = "fahrenheit";
};
};
}

View file

@ -1,6 +1,6 @@
{ pkgs, lib, ty-home-manager-options, ... }:
{ pkgs, lib, config, ... }:
{
programs.konsole = lib.mkIf ty-home-manager-options.plasma.enable {
programs.konsole = lib.mkIf config.meta.home-manager.desktop.plasma.enable {
enable = true;
defaultProfile = "Primary";
profiles = {

View file

@ -57,10 +57,9 @@
hostname = {
disabled = false;
ssh_only = false;
ssh_symbol = "🌐 ";
trim_at = "";
style = "bg:prev_bg fg:prev_fg";
format = "[$ssh_symbol$hostname]($style)";
format = "[$hostname]($style)";
};
shell = {

View file

@ -3,7 +3,7 @@
# Zsh itself
programs.zsh = {
enable = true;
autosuggestion = {
enable = true;
strategy = [ "completion" ];
@ -24,8 +24,19 @@
bindkey "^H" backward-kill-word
bindkey "^Z" undo
'';
# Disable saving the history file, as it is handled by atuin
history = {
# Tell it to not save anything to disk
save = 0;
# If it still tries to save anything, have it write to /dev/null instead just in case
path = "/dev/null";
# We leave size at the default to allow zsh to have command history in memory
# for features like !! or !cmdname, but simply have it stop writing to disk
size = 10000;
};
};
# Atuin shell history
programs.atuin = {
enable = true;
@ -45,7 +56,7 @@
store_failed = true;
secrets_filter = true;
enter_accept = false;
stats = {
common_prefix = [ "sudo" "doas" ];
};
@ -56,4 +67,4 @@
};
};
};
}
}

View file

@ -1,6 +1,6 @@
{ pkgs, lib, ty-home-manager-options, ... }:
{ pkgs, lib, config, ... }:
{
programs.thunderbird = lib.mkIf ty-home-manager-options.thunderbird.enable {
programs.thunderbird = lib.mkIf config.meta.home-manager.email.thunderbird.enable {
enable = true;
package = pkgs.thunderbird-latest;
profiles = {

View file

@ -1,6 +1,6 @@
{ pkgs, inputs, system, lib, ty-home-manager-options, ... }:
{ pkgs, inputs, system, lib, config, ... }:
{
programs.vscode = lib.mkIf ty-home-manager-options.vscode.enable (
programs.vscode = lib.mkIf config.meta.home-manager.vscode.enable (
let vscode-package = pkgs.vscodium; in {
enable = true;
package = vscode-package;
@ -23,7 +23,7 @@
# Language support
rust-lang.rust-analyzer # Rust
llvm-vs-code-extensions.vscode-clangd # C++
vadimcn.vscode-lldb # C++ Debugging
# vadimcn.vscode-lldb # C++ Debugging
jnoortheen.nix-ide # Nix
tamasfe.even-better-toml # TOML
yzhang.markdown-all-in-one # Markdown
@ -38,12 +38,15 @@
mkhl.direnv # nix-direnv autoloading
cschlosser.doxdocgen # C++ Doxygen generator
tomoki1207.pdf # PDF Viewing
exodiusstudios.comment-anchors # Comment anchors and highlighting
])
++ (with vscode-marketplace; [
yy0931.save-as-root # Save as root over SSH
akiramiyakoda.cppincludeguard # Auto-insert header guards for header files
])
);
) ++ (with pkgs.vscode-extensions; [
vadimcn.vscode-lldb
]);
userSettings = {
# Editor

View file

@ -0,0 +1,79 @@
{ lib, config, pkgs, ... }:
{
programs.zed-editor = lib.mkIf config.meta.home-manager.vscode.enable {
enable = true;
extensions = [
# Language support
"nix" "toml" "deno" "kotlin"
# Themes
"catppuccin"
];
userSettings = {
auto_update = false;
base_keymap = "VSCode";
load_direnv = "shell_hook";
show_whitespaces = "boundary";
tab_size = 4;
theme = "Catppuccin Mocha";
buffer_font_family = "FiraCode Nerd Font";
format_on_save = "off";
soft_wrap = "none";
terminal = {
dock = "bottom";
font_family = "FiraCode Nerd Font";
font_size = 14;
line_height = "standard"; # Comfortable breaks my powerline
working_directory = "current_project_directory";
env.TERM = "xterm-256color";
};
lsp = {
rust-analyzer = {
binary = {
path = lib.getExe pkgs.rust-analyzer;
};
};
nix = {
binary = {
path = lib.getExe pkgs.nixd;
};
};
vtsls = {
binary = {
path = lib.getExe pkgs.vtsls;
arguments = [ "--stdio" ];
};
};
kotlin-language-server = {
binary = {
path = lib.getExe' pkgs.kotlin-language-server "kotlin-language-server";
};
};
};
languages = {
Nix = {
language_servers = [ "nixd" "!nil" ];
};
};
# Disable the bullshit
assistant = {
enabled = false;
button = false;
version = "1";
};
features.inline_completion_provider = "none";
telemetry = {
diagnostics = false;
metrics = false;
};
};
};
}

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

@ -1,31 +1,51 @@
{ inputs, system, secrets, lib, config, ... }:
{ inputs, system, secrets, config, lib, ... }:
{
options.ty-home-manager-options = {
plasma.enable = lib.mkEnableOption "plasma configuration";
firefox.enable = lib.mkEnableOption "firefox configuration";
thunderbird.enable = lib.mkEnableOption "thunderbird configuration";
vscode.enable = lib.mkEnableOption "vscode configuration";
beets.enable = lib.mkEnableOption "beets configuration";
rescrobbled.enable = lib.mkEnableOption "rescrobbled configuration";
};
imports = [ ./meta.nix ];
config = {
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
home-manager.sharedModules = [
inputs.plasma-manager.homeManagerModules.plasma-manager
./custom-modules
];
home-manager.extraSpecialArgs = {
inherit inputs system secrets;
inherit (config) ty-home-manager-options;
};
home-manager.backupFileExtension = "backup";
home-manager = let
entrypoint = {
imports = [
# Import meta options for configuring the configuration
./meta.nix
# Import all of my config
./config
];
home-manager.users.ty = {
imports = [
./home.nix
];
};
home.stateVersion = "24.05";
# Inherit my home manager config options
meta.home-manager = config.meta.home-manager;
};
in lib.mkMerge [
## General home-manager.* options
{
# Allow user installation of packages
useGlobalPkgs = true;
useUserPackages = true;
sharedModules = [
# Import plasma manager and all of my custom modules for use
inputs.plasma-manager.homeManagerModules.plasma-manager
inputs.flatpaks.homeManagerModules.declarative-flatpak
./modules
];
# Inherit all of my nixos config custom arguments
extraSpecialArgs = {
inherit inputs system secrets;
};
# Hopefully avoid file conflicts
backupFileExtension = "bak";
}
# The nixos home-manager module and the nix-on-droid compatibility have different options,
# so this handles both in the same file
(if (config.meta.home-manager.interface == "nixos") then {
users.ty = entrypoint;
} else {
config = entrypoint;
})
];
};
}
}

View file

@ -1,22 +0,0 @@
{ lib, config, ... }:
{
home.stateVersion = "24.05";
home.username = "ty";
home.homeDirectory = "/home/ty";
imports = [
./modules/packages.nix
./modules/plasma.nix
./modules/vcs
./modules/firefox.nix
./modules/thunderbird.nix
./modules/accounts
./modules/gpg.nix
./modules/shell
./modules/vscode.nix
./modules/desktop.nix
./modules/gtk.nix
./modules/beets.nix
./modules/rescrobbled.nix
];
}

67
home-manager/meta.nix Normal file
View file

@ -0,0 +1,67 @@
{ lib, config, ... }:
{
options.meta.home-manager = {
# Presets for easy configuring the configuration
preset = lib.mkOption {
type = lib.types.nullOr (lib.types.enum [ "plasma-desktop" "cli" ]);
default = null;
defaultText = lib.literalExpression "null";
description = ''
The preset to use for enabling individual home-manager meta configuration options.
Presets:
- plasma-desktop
- Will enable anything that requires a desktop, and plasma-specific configuration
- cli
- Will only enable what is necessary for a CLI environment, excluding everything else
'';
};
# Individual configuration options
beets.enable = lib.mkEnableOption "beets configuration";
desktop = {
enable = lib.mkEnableOption "configuration that requires a desktop environment";
plasma.enable = lib.mkEnableOption "plasma configuration";
};
email = {
enable = lib.mkEnableOption "email configuration";
thunderbird.enable = lib.mkEnableOption "email configuration for thunderbird";
};
firefox.enable = lib.mkEnableOption "firefox configuration";
rescrobbled.enable = lib.mkEnableOption "rescrobbled configuration";
vscode.enable = lib.mkEnableOption "vscode configuration";
interface = lib.mkOption {
type = lib.types.enum [ "nixos" "nix-on-droid" ];
default = "nixos";
defaultText = lib.literalExpression ''"nixos"'';
description = "The interface to use for configuring home-manger as a module";
};
};
# Handle preset logic
config.meta.home-manager = lib.mkMerge [
# Desktop w/ Plasma preset
(lib.mkIf (config.meta.home-manager.preset == "plasma-desktop") {
beets.enable = true;
desktop.enable = true;
desktop.plasma.enable = true;
email.enable = true;
email.thunderbird.enable = true;
firefox.enable = true;
rescrobbled.enable = true;
vscode.enable = true;
})
# CLI Preset
(lib.mkIf (config.meta.home-manager.preset == "cli") {
beets.enable = false;
desktop.enable = false;
desktop.plasma.enable = false;
email.enable = false;
email.thunderbird.enable = false;
firefox.enable = false;
rescrobbled.enable = false;
vscode.enable = false;
})
];
}

View file

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

View file

@ -1,63 +0,0 @@
{ pkgs, inputs, system, lib, ty-home-manager-options, ... }:
{
home.packages = (with pkgs; [
# :3
fastfetch # Modern & faster neofetch alternative
# CLI Tools
ripgrep # Text searching and manipulation
jq # JSON filtering
eza # Directory lister
bat # File reading
doggo # DNS Requests
nmap # Network scanning
glow # Markdown rendering
tealdeer # TLDR
usbutils # `lsusb`
pciutils # `lspci`
unzip # Extract zip files
# Process tools
btop # Process monitor
nvtopPackages.full # GPU monitor
]) ++ (lib.optionals ty-home-manager-options.plasma.enable (with pkgs; [
# Documents
logseq # Outliner
libreoffice-qt6-fresh # Office-style editing
# Video
jellyfin-media-player # Jellyfin electron client w/ MPV
vlc # Video file player
# Chat
element-desktop # Matrix client
vesktop # Discord client
signal-desktop # Signal client
# KDE Themes
vimix-cursors # Cursors
(pkgs.callPackage ../../packages/beautyline {}) # Icons
(pkgs.callPackage ../../packages/magna-splash-6 {}) # Splash
# Programming
jetbrains.idea-ultimate # Jetbrains IntelliJ Idea Ultimate IDE
nixd # LSP for .nix files
gcc # GNU C++ Compiler
(lib.meta.hiPrio clang) # LLVM C++ Compiler (better than g++)
clang-tools # Clang language server
cling # C++ REPL
deno # Typescript & Javascript runtime
gnumake # Makefile support
# UI Tools
qalculate-qt # Calculator
])) ++ (lib.optionals ty-home-manager-options.firefox.enable [
# Firefox nightly
inputs.firefox-nightly.packages.${system}.firefox-nightly-bin
]) ++ (lib.optionals ty-home-manager-options.plasma.enable (with pkgs.kdePackages; [
kate # IDE
elisa # Music
kdeconnect-kde # Phone sync
polkit-kde-agent-1 # Polkit authentication popup support
]));
}

View file

@ -0,0 +1,82 @@
{ lib, pkgs, config, ... }:
{
options = {
programs.custom.prism-launcher = {
enable = lib.mkEnableOption "prism launcher";
package = lib.mkPackageOption pkgs "Prism Launcher" {
default = "prismlauncher";
};
javaPackages = lib.mkOption {
type = lib.types.listOf lib.types.package;
default = [
# These three JREs cover most minecraft versions
pkgs.temurin-jre-bin-21
pkgs.temurin-jre-bin-17
pkgs.temurin-jre-bin-8
];
defaultText = lib.literalExpression "with pkgs; [ temurin-jre-bin-21 temurin-jre-bin-17 temurin-jre-bin-8 ]";
description = "The java packages to provide to Prism Launcher for running the game";
};
additionalPrograms = lib.mkOption {
type = lib.types.listOf lib.types.package;
default = [];
defaultText = lib.literalExpression "[]";
description = ''
Additional programs that will be added to Prism Launcher's PATH.
Use this for mods that require an extra binary to be present to function.
'';
};
additionalLibs = lib.mkOption {
type = lib.types.listOf lib.types.package;
default = [];
defaultText = lib.literalExpression "[]";
description = ''
Additional dynamic libraries that will be added to Prism Launcher's LD_LIBRARY_PATH.
Use this for mods that require an extra native library to be present to function.
'';
};
controllerSupport = lib.mkOption {
type = lib.types.bool;
default = true;
defaultText = lib.literalExpression "true";
description = "Whether to enable controller support for Prism Launcher";
};
gamemodeSupport = lib.mkOption {
type = lib.types.bool;
default = true;
defaultText = lib.literalExpression "true";
description = "Whether to enable Feral GameMode support for Prism Launcher";
};
textToSpeechSupport = lib.mkOption {
type = lib.types.bool;
default = true;
defaultText = lib.literalExpression "true";
description = "Whether to enable text-to-speech support for Prism Launcher";
};
msaClientID = lib.mkOption {
type = lib.types.nullOr lib.types.str;
default = null;
defaultText = lib.literalExpression "null";
description = ''
A custom MSA Client ID to use for authentication with microsoft servers.
Do not override this unless truly necessary.
'';
};
};
};
config = let
cfg = config.programs.custom.prism-launcher;
in lib.mkIf cfg.enable {
home.packages = [ (cfg.package.override {
jdks = cfg.javaPackages;
inherit (cfg) additionalPrograms additionalLibs controllerSupport gamemodeSupport textToSpeechSupport msaClientID;
}) ];
};
}

View file

@ -1,23 +1,85 @@
{ secrets, lib, ty-home-manager-options, ... }:
{
config = lib.mkIf ty-home-manager-options.rescrobbled.enable {
services.custom.rescrobbled = let s = secrets.programs.rescrobbled; in lib.mkIf s.enable {
enable = true;
{ pkgs, lib, config, ... }:
let tomlFormat = pkgs.formats.toml { }; in {
options = {
services.custom.rescrobbled = {
enable = lib.mkEnableOption "rescrobbled";
session = s.lastfm.session;
package = lib.mkOption {
type = lib.types.package;
default = (pkgs.callPackage ../../packages/rescrobbled {});
defaultText = lib.literalExpression "pkgs.rescrobbled";
description = "The package to use for rescrobbled";
};
settings = {
player-whitelist = [ "elisa" ];
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;
};
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;
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

@ -1,12 +1,17 @@
{ ... }:
{
imports = [
# Folders
./services
# Individual files
./bootloader.nix
./display.nix
./locale.nix
./mounts.nix
./networking.nix
./nixpkgs.nix
./programs.nix
./users.nix
./vscode-server.nix
];
}

View file

@ -18,4 +18,7 @@
}
];
};
# Disable sleep on lid close (because server)
services.logind.lidSwitch = "ignore";
}

View file

@ -0,0 +1,15 @@
{ ... }:
{
fileSystems."/mnt/hdd" = {
device = "/dev/mapper/hdd";
fsType = "btrfs";
options = [ "compression=zstd:3" "autodefrag" "nofail" ];
encrypted = {
enable = true;
label = "hdd";
blkDev = "/dev/disk/by-uuid/eab5e1d6-6956-46fd-b3ac-5fcf525e1df8";
keyFile = "/mnt-root/root/hdd.key";
};
};
}

View file

@ -1,12 +1,12 @@
{ ... }:
{ pkgs, ... }:
{
networking = {
hostName = "ty-laptop-server";
# Enable firewall
# TODO Firewall causes issues with containers, need to fix it
firewall = {
enable = true;
trustedInterfaces = [ "lo" "ve-jellyfin" ];
package = pkgs.iptables;
};
# Enable NetworkManager
@ -19,4 +19,5 @@
useRoutingFeatures = "both";
openFirewall = true;
};
networking.firewall.trustedInterfaces = [ "tailscale0" ];
}

View file

@ -7,9 +7,7 @@
networking = {
nat = {
enable = true;
internalInterfaces = ["ve-jellyfin"];
externalInterface = "wlp2s0";
};
networkmanager.unmanaged = [ "interface-name:ve-jellyfin" ];
};
}

View file

@ -0,0 +1,26 @@
{ ... }:
{
containers.jellyfin = {
config = { pkgs, ...}: {
system.stateVersion = "25.05";
services.jellyfin = {
enable = true;
package = pkgs.jellyfin;
};
# Firewall on the host system is enough + this firewall seems to break networking
networking.firewall.enable = false;
};
autoStart = true;
privateNetwork = true;
hostAddress = "172.30.1.2"; # TODO define in config option
localAddress = "172.30.0.2";
};
networking = {
firewall.trustedInterfaces = [ "ve-jellyfin" ];
nat.internalInterfaces = [ "ve-jellyfin" ];
networkmanager.unmanaged = [ "interface-name:ve-jellyfin" ];
};
}

View file

@ -0,0 +1,8 @@
{ pkgs, ... }:
{
services.vscode-server = {
enable = true;
nodejsPackage = pkgs.nodejs-18_x;
installPath = "$HOME/.vscodium-server";
};
}

View file

@ -8,9 +8,23 @@
{
imports = [
## External modules
# Better command-not-found
inputs.nix-index-database.nixosModules.nix-index
{ programs.nix-index-database.comma.enable = true; }
# Home manager
inputs.home-manager.nixosModules.home-manager
../../home-manager
{ meta.home-manager.preset = "cli"; }
# VSCode server support
inputs.vscode-server.nixosModules.default
## Normal configuration
./hardware-configuration.nix
./modules
./services
./config
];
system.stateVersion = "24.11";

View file

@ -1,17 +0,0 @@
{ config, ... }:
{
containers.jellyfin = {
config = { pkgs, ...}: {
system.stateVersion = "25.05";
services.jellyfin = {
enable = true;
package = pkgs.jellyfin;
};
};
autoStart = true;
privateNetwork = true;
hostAddress = "172.30.0.2"; # TODO define in config option
localAddress = "172.30.0.2";
};
}

View file

@ -4,4 +4,6 @@
services.desktopManager.plasma6.enable = true;
programs.dconf.enable = true;
programs.partition-manager.enable = true;
}
# Fix some programs not using the portal properly
xdg.portal.xdgOpenUsePortal = true;
}

View file

@ -1,6 +1,8 @@
{ pkgs, ... }:
{
fonts = {
fontDir.enable = true;
packages = with pkgs; [
# Core fonts (Arial, Times new roman and the such)
corefonts

View file

@ -2,6 +2,8 @@
{
networking.hostName = "ty-nixos";
# networking.hosts = { "23.95.137.176" = [ "s.optifine.net" ]; };
# Enable firewall
networking.firewall.enable = true;
@ -17,4 +19,4 @@
# Network printing via CUPS
services.printing.enable = true;
}
}

View file

@ -12,7 +12,7 @@
# Experimentally turn off Nvidia GPU when not in use
powerManagement.finegrained = false;
open = false; # Open source module is still very much beta
open = true; # Open source module is still very much beta
nvidiaSettings = true;

View file

@ -1,4 +1,4 @@
{ pkgs, inputs, ... }:
{ pkgs, inputs, system, ... }:
{
# Install system packages
environment.systemPackages = with pkgs; [
@ -6,8 +6,11 @@
wget
curl
neovim
home-manager
wl-clipboard-rs
# Nix utilities
home-manager
inputs.colmena.packages."${system}".colmena
nvd
# VCS
git
jujutsu
@ -18,12 +21,21 @@
# Enable waydroid
virtualisation.waydroid.enable = true;
# Enable flatpak
services.flatpak.enable = true;
# Enable steam
programs.steam = {
enable = true;
extest.enable = true;
extraPackages = [
pkgs.vimix-cursors # Necessary so cursor size and theme are correct while inside the steam window
];
};
programs.gamemode.enable = true;
programs.gamescope.enable = true;
# Install zsh
programs.zsh.enable = true;

View file

@ -1,12 +1,36 @@
{ inputs, ... }:
{
imports = [
## External modules
# Better command-not-found
inputs.nix-index-database.nixosModules.nix-index
{ programs.nix-index-database.comma.enable = true; }
# Home manager
inputs.home-manager.nixosModules.home-manager
../../home-manager
{ meta.home-manager.preset = "plasma-desktop"; }
## Normal configuration
./hardware-configuration.nix
./modules
./config
];
system.stateVersion = "24.05";
nix.settings.experimental-features = [ "nix-command" "flakes" ];
nix.nixPath = [ "nixpkgs=${inputs.nixpkgs}" ];
}
nix.settings = {
experimental-features = [ "nix-command" "flakes" ];
substituters = [
"https://colmena.cachix.org"
];
trusted-public-keys = [
"colmena.cachix.org-1:7BzpDnjjH8ki2CT3f6GdOk7QAzPOl+1t3LvTLXqYcSg="
];
auto-optimise-store = true;
};
nix.gc.automatic = true;
}

View file

@ -0,0 +1,25 @@
{ inputs, pkgs, ... }: {
imports = [
./environment.nix
# Import full home-manager config
../../home-manager
];
meta.home-manager = { preset = "cli"; interface = "nix-on-droid"; };
nix = {
extraOptions = ''
experimental-features = nix-command flakes
'';
nixPath = [ "nixpkgs=${inputs.nixpkgs}" ];
};
user.shell = "${pkgs.zsh}/bin/zsh";
time.timeZone = "America/Denver";
terminal = {
font = "${pkgs.nerd-fonts.fira-code}/share/fonts/truetype/NerdFonts/FiraCode/FiraCodeNerdFont-Regular.ttf";
};
system.stateVersion = "24.05";
}

View file

@ -0,0 +1,39 @@
{ pkgs, ... }:
{
environment = {
etcBackupExtension = ".bak";
packages = with pkgs; [
# Basic necessities
wget
curl
neovim
# Basic necessities copied from https://github.com/nix-community/nix-on-droid/blob/5d88ff2519e4952f8d22472b52c531bb5f1635fc/templates/home-manager/nix-on-droid.nix#L9C1-L26C11
procps
killall
diffutils
findutils
utillinux
tzdata
hostname
man
gnugrep
gnupg
gnused
gnutar
bzip2
gzip
xz
zip
unzip
# Nix tools
nvd
# VCS
git
jujutsu
];
motd = "";
};
}

91
utils/default.nix Normal file
View file

@ -0,0 +1,91 @@
{ inputs, secrets }:
{
createNixosSystem = {
system ? "x86_64-linux",
entrypoint
}: inputs.nixpkgs.lib.nixosSystem {
inherit system;
specialArgs = {
inherit inputs system secrets;
};
modules = [ entrypoint ];
};
createColmenaHive = {
defaultSystem ? "x86_64-linux",
hostConfigs ? []
}: {
# Set meta options for the colmena hive
meta = {
# Standard options
allowApplyAll = false;
# Defaults for nodes
nixpkgs = import inputs.nixpkgs { system = defaultSystem; };
specialArgs = {
inherit inputs secrets;
system = defaultSystem;
};
# Overrides for individual nodes
nodeNixpkgs = (
builtins.foldl'
(acc: cur:
acc // {
${cur.name} = import inputs.nixpkgs { system = cur.system; };
}
)
{}
(builtins.filter
(c: builtins.hasAttr "system" c && c.system != defaultSystem)
hostConfigs)
);
nodeSpecialArgs = (
builtins.foldl'
(acc: cur:
acc // {
${cur.name} = {
inherit inputs secrets;
system = cur.system;
};
}
)
{}
(builtins.filter
(c: builtins.hasAttr "system" c && c.system != defaultSystem)
hostConfigs)
);
};
} // (
# Add all of the hosts
builtins.foldl'
(acc: cur:
acc // {
${cur.name} = { ... }: {
deployment = {
replaceUnknownProfiles = if (builtins.hasAttr "allowLocal" cur) then cur.allowLocal else false;
targetUser = if (builtins.hasAttr "sshUser" cur) then cur.sshUser else "root";
targetHost = if (builtins.hasAttr "sshHost" cur) then cur.sshHost else cur.name;
targetPort = if (builtins.hasAttr "sshPort" cur) then cur.sshPort else 22;
allowLocalDeployment = if (builtins.hasAttr "allowLocal" cur) then cur.allowLocal else false;
};
imports = [ cur.entrypoint ];
};
}
)
{}
hostConfigs
);
createDroidSystem = {
system ? "aarch64-linux",
entrypoint
}: inputs.nix-on-droid.lib.nixOnDroidConfiguration {
pkgs = import inputs.nixpkgs { inherit system; };
modules = [ entrypoint ];
extraSpecialArgs = {
inherit inputs system secrets;
};
};
}