Compare commits

..

1 commit

Author SHA1 Message Date
81269c0f75
Services 2024-12-12 16:23:35 -07:00
71 changed files with 406 additions and 1214 deletions

1
.gitignore vendored
View file

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

366
flake.lock generated
View file

@ -16,42 +16,20 @@
"type": "github" "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": { "firefox-addons": {
"inputs": { "inputs": {
"flake-utils": "flake-utils_2", "flake-utils": "flake-utils",
"nixpkgs": [ "nixpkgs": [
"nixpkgs" "nixpkgs"
] ]
}, },
"locked": { "locked": {
"dir": "/pkgs/firefox-addons", "dir": "/pkgs/firefox-addons",
"lastModified": 1734648163, "lastModified": 1733875367,
"narHash": "sha256-AK7nqONfzyxUzqVVeRoniO6NRv4SaxPrXwuyY8jtCXs=", "narHash": "sha256-eBMHOM1KvbK8dTrM4N8ytNl8NeJF4lLyoPBRae1CqKs=",
"owner": "rycee", "owner": "rycee",
"repo": "nur-expressions", "repo": "nur-expressions",
"rev": "2b5a7eb2719b146f6308dfa51c9a1c4b03d965a3", "rev": "bda0131e0a7b6b5b687f5ffd8a8622054e7c444d",
"type": "gitlab" "type": "gitlab"
}, },
"original": { "original": {
@ -64,7 +42,7 @@
"firefox-nightly": { "firefox-nightly": {
"inputs": { "inputs": {
"cachix": "cachix", "cachix": "cachix",
"flake-compat": "flake-compat_2", "flake-compat": "flake-compat",
"lib-aggregate": "lib-aggregate", "lib-aggregate": "lib-aggregate",
"mozilla": "mozilla", "mozilla": "mozilla",
"nixpkgs": [ "nixpkgs": [
@ -72,11 +50,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1734743419, "lastModified": 1733834155,
"narHash": "sha256-MAl+QDhPVXypYKjLZ6WU5JLY8VjGt4lecdmwCkBwMN8=", "narHash": "sha256-5A7EfzSmdApKmfHGtGZ4NQvMEpI/NI6VIzTNq9sUH4E=",
"owner": "nix-community", "owner": "nix-community",
"repo": "flake-firefox-nightly", "repo": "flake-firefox-nightly",
"rev": "dfb2631ee449ba3df206cb8f1d9558f242851e0b", "rev": "f0ab3cfa3607e08169b1d87e63fe9b1e5a57f515",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -86,22 +64,6 @@
} }
}, },
"flake-compat": { "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": { "locked": {
"lastModified": 1717312683, "lastModified": 1717312683,
"narHash": "sha256-FrlieJH50AuvagamEvWMIE6D2OAnERuDboFDYAED/dE=", "narHash": "sha256-FrlieJH50AuvagamEvWMIE6D2OAnERuDboFDYAED/dE=",
@ -116,7 +78,7 @@
"type": "github" "type": "github"
} }
}, },
"flake-compat_3": { "flake-compat_2": {
"flake": false, "flake": false,
"locked": { "locked": {
"lastModified": 1696426674, "lastModified": 1696426674,
@ -133,21 +95,6 @@
} }
}, },
"flake-utils": { "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": { "locked": {
"lastModified": 1629284811, "lastModified": 1629284811,
"narHash": "sha256-JHgasjPR0/J1J3DRm4KxM4zTyAj4IOJY8vIl75v/kPI=", "narHash": "sha256-JHgasjPR0/J1J3DRm4KxM4zTyAj4IOJY8vIl75v/kPI=",
@ -162,7 +109,7 @@
"type": "github" "type": "github"
} }
}, },
"flake-utils_3": { "flake-utils_2": {
"inputs": { "inputs": {
"systems": "systems" "systems": "systems"
}, },
@ -180,9 +127,9 @@
"type": "github" "type": "github"
} }
}, },
"flake-utils_4": { "flake-utils_3": {
"inputs": { "inputs": {
"systems": "systems_3" "systems": "systems_2"
}, },
"locked": { "locked": {
"lastModified": 1710146030, "lastModified": 1710146030,
@ -198,9 +145,9 @@
"type": "github" "type": "github"
} }
}, },
"flake-utils_5": { "flake-utils_4": {
"inputs": { "inputs": {
"systems": "systems_4" "systems": "systems_3"
}, },
"locked": { "locked": {
"lastModified": 1681202837, "lastModified": 1681202837,
@ -216,30 +163,6 @@
"type": "github" "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": { "home-manager": {
"inputs": { "inputs": {
"nixpkgs": [ "nixpkgs": [
@ -247,11 +170,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1734622215, "lastModified": 1733873195,
"narHash": "sha256-OOfI0XhSJGHblfdNDhfnn8QnZxng63rWk9eeJ2tCbiI=", "narHash": "sha256-dTosiZ3sZ/NKoLKQ++v8nZdEHya0eTNEsaizNp+MUPM=",
"owner": "nix-community", "owner": "nix-community",
"repo": "home-manager", "repo": "home-manager",
"rev": "1395379a7a36e40f2a76e7b9936cc52950baa1be", "rev": "f26aa4b76fb7606127032d33ac73d7d507d82758",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -263,15 +186,15 @@
}, },
"lib-aggregate": { "lib-aggregate": {
"inputs": { "inputs": {
"flake-utils": "flake-utils_3", "flake-utils": "flake-utils_2",
"nixpkgs-lib": "nixpkgs-lib" "nixpkgs-lib": "nixpkgs-lib"
}, },
"locked": { "locked": {
"lastModified": 1734264809, "lastModified": 1733660018,
"narHash": "sha256-94fu5E0gM8aMY0bX/ix7BWGf/e/OfGjoCtNrJfwL0dM=", "narHash": "sha256-DHW2Hzyo8W6wVPGFaYLM9mKMH/qAtHJSUZ4ti7LHMCY=",
"owner": "nix-community", "owner": "nix-community",
"repo": "lib-aggregate", "repo": "lib-aggregate",
"rev": "46bedda9e45f2735f41ec3c01cba2b8ce7ba9808", "rev": "f710791be27b31ea1ee9c40a94d08bcbba99b3c0",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -296,53 +219,6 @@
"type": "github" "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": { "nix-index-database": {
"inputs": { "inputs": {
"nixpkgs": [ "nixpkgs": [
@ -350,11 +226,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1734234111, "lastModified": 1733629314,
"narHash": "sha256-icEMqBt4HtGH52PU5FHidgBrNJvOfXH6VQKNtnD1aw8=", "narHash": "sha256-U0vivjQFAwjNDYt49Krevs1murX9hKBFe2Ye0cHpgbU=",
"owner": "nix-community", "owner": "nix-community",
"repo": "nix-index-database", "repo": "nix-index-database",
"rev": "311d6cf3ad3f56cb051ffab1f480b2909b3f754d", "rev": "f1e477a7dd11e27e7f98b646349cd66bbabf2fb8",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -363,33 +239,6 @@
"type": "github" "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": { "nixos-grub-themes": {
"inputs": { "inputs": {
"nixpkgs": [ "nixpkgs": [
@ -412,11 +261,11 @@
}, },
"nixpkgs": { "nixpkgs": {
"locked": { "locked": {
"lastModified": 1730785428, "lastModified": 1733759999,
"narHash": "sha256-Zwl8YgTVJTEum+L+0zVAWvXAGbWAuXHax3KzuejaDyo=", "narHash": "sha256-463SNPWmz46iLzJKRzO3Q2b0Aurff3U1n0nYItxq7jU=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "4aa36568d413aca0ea84a1684d2d46f55dbabad7", "rev": "a73246e2eef4c6ed172979932bc80e1404ba2d56",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -426,45 +275,29 @@
"type": "github" "type": "github"
} }
}, },
"nixpkgs-docs": { "nixpkgs-24-11": {
"locked": { "locked": {
"lastModified": 1705957679, "lastModified": 1733550349,
"narHash": "sha256-Q8LJaVZGJ9wo33wBafvZSzapYsjOaNjP/pOnSiKVGHY=", "narHash": "sha256-NcGumB4Lr6KSDq+nIqXtNA8QwAQKDSZT7N9OTGWbTrs=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "9a333eaa80901efe01df07eade2c16d183761fa3", "rev": "e2605d0744c2417b09f8bf850dfca42fcf537d34",
"type": "github" "type": "github"
}, },
"original": { "original": {
"owner": "NixOS", "owner": "NixOS",
"ref": "release-23.05", "ref": "nixos-24.11",
"repo": "nixpkgs", "repo": "nixpkgs",
"type": "github" "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": { "nixpkgs-lib": {
"locked": { "locked": {
"lastModified": 1734224914, "lastModified": 1733620091,
"narHash": "sha256-hKWALzQ/RxxXdKWsLKXULru6XTag9Cc5exgVyS4a/AE=", "narHash": "sha256-5WoMeCkaXqTZwwCNLRzyLxEJn8ISwjx4cNqLgqKwg9s=",
"owner": "nix-community", "owner": "nix-community",
"repo": "nixpkgs.lib", "repo": "nixpkgs.lib",
"rev": "538697b664a64fade8ce628d01f35d1f1fd82d77", "rev": "f4dc9a6c02e5e14d91d158522f69f6ab4194eb5b",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -475,56 +308,16 @@
}, },
"nixpkgs_2": { "nixpkgs_2": {
"locked": { "locked": {
"lastModified": 1734424634, "lastModified": 1682134069,
"narHash": "sha256-cHar1vqHOOyC7f1+tVycPoWTfKIaqkoe1Q6TnKzuti4=", "narHash": "sha256-TnI/ZXSmRxQDt2sjRYK/8j8iha4B4zP2cnQCZZ3vp7k=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "d3c42f187194c26d9f0309a8ecc469d6c878ce33", "rev": "fd901ef4bf93499374c5af385b2943f5801c0833",
"type": "github" "type": "github"
}, },
"original": { "original": {
"owner": "NixOS", "id": "nixpkgs",
"ref": "nixos-unstable", "type": "indirect"
"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": { "plasma-manager": {
@ -552,37 +345,19 @@
}, },
"root": { "root": {
"inputs": { "inputs": {
"colmena": "colmena",
"firefox-addons": "firefox-addons", "firefox-addons": "firefox-addons",
"firefox-nightly": "firefox-nightly", "firefox-nightly": "firefox-nightly",
"flatpaks": "flatpaks",
"home-manager": "home-manager", "home-manager": "home-manager",
"nix-index-database": "nix-index-database", "nix-index-database": "nix-index-database",
"nix-on-droid": "nix-on-droid",
"nixos-grub-themes": "nixos-grub-themes", "nixos-grub-themes": "nixos-grub-themes",
"nixpkgs": "nixpkgs_2", "nixpkgs": "nixpkgs",
"nixpkgs-24-11": "nixpkgs-24-11",
"plasma-manager": "plasma-manager", "plasma-manager": "plasma-manager",
"sddm-sugar-candy-nix": "sddm-sugar-candy-nix", "sddm-sugar-candy-nix": "sddm-sugar-candy-nix",
"vscode-extensions": "vscode-extensions", "vscode-extensions": "vscode-extensions",
"vscode-server": "vscode-server" "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": { "sddm-sugar-candy-nix": {
"inputs": { "inputs": {
"nixpkgs": [ "nixpkgs": [
@ -603,22 +378,6 @@
"type": "github" "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": { "systems": {
"locked": { "locked": {
"lastModified": 1681028828, "lastModified": 1681028828,
@ -636,16 +395,16 @@
}, },
"systems_2": { "systems_2": {
"locked": { "locked": {
"lastModified": 1689347949, "lastModified": 1681028828,
"narHash": "sha256-12tWmuL2zgBgZkdoB6qXZsgJEH9LR3oUgpaQq2RbI80=", "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
"owner": "nix-systems", "owner": "nix-systems",
"repo": "default-linux", "repo": "default",
"rev": "31732fcf5e8fea42e59c2488ad31a0e651500f68", "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
"type": "github" "type": "github"
}, },
"original": { "original": {
"owner": "nix-systems", "owner": "nix-systems",
"repo": "default-linux", "repo": "default",
"type": "github" "type": "github"
} }
}, },
@ -664,35 +423,20 @@
"type": "github" "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": { "vscode-extensions": {
"inputs": { "inputs": {
"flake-compat": "flake-compat_3", "flake-compat": "flake-compat_2",
"flake-utils": "flake-utils_4", "flake-utils": "flake-utils_3",
"nixpkgs": [ "nixpkgs": [
"nixpkgs" "nixpkgs"
] ]
}, },
"locked": { "locked": {
"lastModified": 1734659394, "lastModified": 1733795858,
"narHash": "sha256-rI7fcI4+J+iAiCvQ0J3hECJJGD9cAVTAFRTj1xrX6Qo=", "narHash": "sha256-K595Q2PrZv2iiumdBkwM2G456T2lKsLD71bn/fbJiQ0=",
"owner": "nix-community", "owner": "nix-community",
"repo": "nix-vscode-extensions", "repo": "nix-vscode-extensions",
"rev": "1792f1bbfccbd5ebcb745250e4fc57067c6dfd9c", "rev": "66ced222ef9235f90dbdd754ede3d6476722aaa9",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -703,10 +447,8 @@
}, },
"vscode-server": { "vscode-server": {
"inputs": { "inputs": {
"flake-utils": "flake-utils_5", "flake-utils": "flake-utils_4",
"nixpkgs": [ "nixpkgs": "nixpkgs_2"
"nixpkgs"
]
}, },
"locked": { "locked": {
"lastModified": 1729422940, "lastModified": 1729422940,

124
flake.nix
View file

@ -4,11 +4,7 @@
inputs = { inputs = {
# General NixOS config # General NixOS config
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
# Colmena unstable nixpkgs-24-11.url = "github:NixOS/nixpkgs/nixos-24.11";
colmena = {
url = "github:zhaofengli/colmena";
# inputs.nixpkgs.follows = "nixpkgs";
};
# Nixpkgs index for command-not-found support # Nixpkgs index for command-not-found support
nix-index-database = { nix-index-database = {
url = "github:nix-community/nix-index-database"; url = "github:nix-community/nix-index-database";
@ -53,58 +49,76 @@
inputs.nixpkgs.follows = "nixpkgs"; inputs.nixpkgs.follows = "nixpkgs";
}; };
# VSCode server support # VSCode server support
vscode-server = { vscode-server.url = "github:nix-community/nixos-vscode-server";
url = "github:nix-community/nixos-vscode-server"; };
inputs.nixpkgs.follows = "nixpkgs";
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;
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;
};
}; };
# Flatpak support
flatpaks = { nixosConfigurations."ty-laptop-server" = nixpkgs.lib.nixosSystem {
url = "github:GermanBread/declarative-flatpak"; inherit system;
inputs.nixpkgs.follows = "nixpkgs";
inputs.home-manager.follows = "home-manager"; modules = [
}; ./hosts/laptop-server
# Nix-on-droid support
nix-on-droid = { # Better command-not-found
url = "github:nix-community/nix-on-droid"; nix-index-database.nixosModules.nix-index
inputs = { { programs.nix-index-database.comma.enable = true; }
nixpkgs.follows = "nixpkgs";
home-manager.follows = "home-manager"; # Home manager
home-manager.nixosModules.home-manager
./home-manager
{
ty-home-manager-options = {
plasma.enable = false;
beets.enable = false;
firefox.enable = false;
thunderbird.enable = false;
rescrobbled.enable = false;
vscode.enable = false;
};
}
# 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;
}; };
}; };
}; };
outputs = inputs@{ self, nixpkgs, colmena, nix-on-droid, ... }: let
utils = import ./utils {
inherit inputs;
secrets = import ./secrets.nix;
};
in {
# Setup nixos-rebuild configurations
nixosConfigurations = {
"ty-nixos" = utils.createNixosSystem { entrypoint = ./hosts/laptop; };
"ty-laptop-server" = utils.createNixosSystem { entrypoint = ./hosts/laptop-server; };
};
# Setup colmena configurations
colmena = utils.createColmenaHive {
hostConfigs = [
{
name = "ty-nixos";
entrypoint = ./hosts/laptop;
allowLocal = true;
}
{
name = "ty-laptop-server";
entrypoint = ./hosts/laptop-server;
sshHost = "old-lenovo-laptop";
}
];
};
# 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,23 +0,0 @@
{ ... }:
{
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,15 +0,0 @@
{ 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,91 +0,0 @@
{ 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 +0,0 @@
{ config, lib, ... }:
{
programs.custom.prism-launcher = lib.mkIf config.meta.home-manager.desktop.enable {
enable = true;
};
}

View file

@ -1,23 +0,0 @@
{ 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

@ -1,79 +0,0 @@
{ 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,7 +1,6 @@
{ ... }: { ... }:
{ {
imports = [ imports = [
./prismlauncher.nix
./rescrobbled.nix ./rescrobbled.nix
]; ];
} }

View file

@ -0,0 +1,85 @@
{ 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,51 +1,31 @@
{ inputs, system, secrets, config, lib, ... }: { inputs, system, secrets, lib, config, ... }:
{ {
imports = [ ./meta.nix ]; 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";
};
config = { config = {
home-manager = let home-manager.useGlobalPkgs = true;
entrypoint = { home-manager.useUserPackages = true;
imports = [ home-manager.sharedModules = [
# Import meta options for configuring the configuration inputs.plasma-manager.homeManagerModules.plasma-manager
./meta.nix ./custom-modules
# Import all of my config
./config
];
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;
})
]; ];
home-manager.extraSpecialArgs = {
inherit inputs system secrets;
inherit (config) ty-home-manager-options;
};
home-manager.backupFileExtension = "backup";
home-manager.users.ty = {
imports = [
./home.nix
];
};
}; };
} }

22
home-manager/home.nix Executable file
View file

@ -0,0 +1,22 @@
{ 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
];
}

View file

@ -1,67 +0,0 @@
{ 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,4 +1,4 @@
{ ... }: { lib, config, ... }:
{ {
imports = [ imports = [
./email.nix ./email.nix

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -0,0 +1,63 @@
{ 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

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

View file

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

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

View file

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

View file

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

View file

@ -24,17 +24,6 @@
bindkey "^H" backward-kill-word bindkey "^H" backward-kill-word
bindkey "^Z" undo 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 # Atuin shell history

View file

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

View file

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

View file

@ -1,15 +0,0 @@
{ ... }:
{
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,26 +0,0 @@
{ ... }:
{
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

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

View file

@ -8,23 +8,9 @@
{ {
imports = [ 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 ./hardware-configuration.nix
./config ./modules
./services
]; ];
system.stateVersion = "24.11"; system.stateVersion = "24.11";

View file

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

View file

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

View file

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

View file

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

View file

@ -0,0 +1,17 @@
{ 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

@ -1,36 +1,12 @@
{ inputs, ... }: { inputs, ... }:
{ {
imports = [ 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 ./hardware-configuration.nix
./config ./modules
]; ];
system.stateVersion = "24.05"; system.stateVersion = "24.05";
nix.settings.experimental-features = [ "nix-command" "flakes" ];
nix.nixPath = [ "nixpkgs=${inputs.nixpkgs}" ]; 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

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

View file

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

View file

@ -2,8 +2,6 @@
{ {
networking.hostName = "ty-nixos"; networking.hostName = "ty-nixos";
# networking.hosts = { "23.95.137.176" = [ "s.optifine.net" ]; };
# Enable firewall # Enable firewall
networking.firewall.enable = true; networking.firewall.enable = true;

View file

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

View file

@ -1,4 +1,4 @@
{ pkgs, inputs, system, ... }: { pkgs, inputs, ... }:
{ {
# Install system packages # Install system packages
environment.systemPackages = with pkgs; [ environment.systemPackages = with pkgs; [
@ -6,11 +6,8 @@
wget wget
curl curl
neovim neovim
wl-clipboard-rs
# Nix utilities
home-manager home-manager
inputs.colmena.packages."${system}".colmena wl-clipboard-rs
nvd
# VCS # VCS
git git
jujutsu jujutsu
@ -21,21 +18,12 @@
# Enable waydroid # Enable waydroid
virtualisation.waydroid.enable = true; virtualisation.waydroid.enable = true;
# Enable flatpak
services.flatpak.enable = true;
# Enable steam # Enable steam
programs.steam = { programs.steam = {
enable = true; enable = true;
extest.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 # Install zsh
programs.zsh.enable = true; programs.zsh.enable = true;

View file

@ -1,25 +0,0 @@
{ 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

@ -1,39 +0,0 @@
{ 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 = "";
};
}

View file

@ -1,91 +0,0 @@
{ 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;
};
};
}