NixOS deployment for LinuxLab
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

69 lines
1.7 KiB

1 month ago
  1. { config, lib, pkgs, inputs, ... }:
  2. {
  3. nixpkgs.overlays = [
  4. # Make nixpkgs-unstable available as subtree
  5. (_: _: {
  6. unstable = import inputs.nixpkgs-unstable {
  7. inherit (config.nixpkgs) system;
  8. config = {
  9. allowUnfree = true;
  10. };
  11. };
  12. })
  13. # Let builders fetch sources directly instead of uploading
  14. (self: super: (super.prefer-remote-fetch self super))
  15. ];
  16. # Who cares about licenses?
  17. nixpkgs.config.allowUnfree = true;
  18. # Link nixpkgs to etc for usage in NIX_PATH.
  19. # This allows update to the symlinks when updating nixpkgs without changes
  20. # to NIX_PATH, which requires a new session to bekome active.
  21. environment.etc.nixpkgs.source = pkgs.linkFarm "nixpkgs" [
  22. { name = "nixpkgs"; inherit (pkgs) path; }
  23. { name = "nixpkgs-unstable"; inherit (pkgs.unstable) path; }
  24. ];
  25. nix = {
  26. nixPath = lib.mkForce [
  27. "nixpkgs=/etc/nixpkgs/nixpkgs"
  28. "nixpkgs-unstable=/etc/nixpkgs/nixpkgs-unstable"
  29. ];
  30. registry = {
  31. "nixpkgs" = {
  32. from = { type = "indirect"; id = "nixpkgs"; };
  33. to = { type = "path"; path = "/etc/nixpkgs/nixpkgs"; };
  34. };
  35. "nixpkgs-unstable" = {
  36. from = { type = "indirect"; id = "nixpkgs-unstable"; };
  37. to = { type = "path"; path = "/etc/nixpkgs/nixpkgs-unstable"; };
  38. };
  39. };
  40. # Take out the trash
  41. gc = {
  42. automatic = true;
  43. dates = "monthly";
  44. options = "--delete-older-than 30d";
  45. };
  46. # Optimize the store
  47. optimise = {
  48. automatic = true;
  49. dates = [ "monthly" ];
  50. };
  51. # Enable modern commands
  52. settings = {
  53. experimental-features = [
  54. "flakes"
  55. "nix-command"
  56. ];
  57. };
  58. };
  59. }