{"id":22865568,"url":"https://github.com/pipelight/nixos-tidy","last_synced_at":"2025-10-28T06:04:51.803Z","repository":{"id":217650597,"uuid":"744433453","full_name":"pipelight/nixos-tidy","owner":"pipelight","description":"Nix functions to create sharable, flexible and standardized Nixos configurations.","archived":false,"fork":false,"pushed_at":"2025-03-28T12:41:35.000Z","size":481,"stargazers_count":69,"open_issues_count":1,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-05-05T15:18:54.280Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Nix","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pipelight.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-01-17T09:42:02.000Z","updated_at":"2025-04-23T18:55:57.000Z","dependencies_parsed_at":"2024-07-24T18:44:16.430Z","dependency_job_id":"f7dd3111-d55a-4c2c-8884-74ee08c1c643","html_url":"https://github.com/pipelight/nixos-tidy","commit_stats":null,"previous_names":["pipelight/home-merger","pipelight/nixos-utils"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pipelight%2Fnixos-tidy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pipelight%2Fnixos-tidy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pipelight%2Fnixos-tidy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pipelight%2Fnixos-tidy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pipelight","download_url":"https://codeload.github.com/pipelight/nixos-tidy/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252522175,"owners_count":21761685,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-12-13T11:37:39.339Z","updated_at":"2025-10-28T06:04:51.798Z","avatar_url":"https://github.com/pipelight.png","language":"Nix","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Nixos-tidy - Make filesystem based configurations.\n\n\u003cimg src=\"./public/images/nixos-tidy.png\" width=\"300px\"/\u003e\n\nModules and library for filesystem based configuration.\n\n## Install (add to your config).\n\nAdd the flake to your existing configuration.\n\n```nix\n# flake.nix\ninputs = {\n  nixos-tidy = {\n    url = \"github:pipelight/nixos-tidy\";\n    inputs.nixpkgs.follows = \"nixpkgs\";\n  };\n};\n```\n\n```nix\n# flake.nix\noutputs = {\n  self,\n  nixpkgs,\n  ...\n}: {\n  nixosConfiguration = {\n    default = pkgs.lib.nixosSystem {\n      modules = [\n        # pick some modules\n        inputs.nixos-tidy.nixosModules.home-merger\n        ({\n          config,\n          pkgs,\n          lib,\n          inputs,\n          ...\n        }: let\n            # Use functions from library.\n            slib = inputs.nixos-tidy.lib;\n        in {\n\n        })\n      ];\n    };\n  }\n};\n```\n\n## Examples\n\n- Minimalist\n\n  Find many minimalists examples self-contained in a single `flake.nix` file,\n  in the [templates directory](https://github.com/pipelight/nixos-tidy/blob/master/templates/).\n\n- Real world\n\n  And a complete working example at [crocuda.nixos](https://github.com/pipelight/crocuda.nixos).\n  Where all the magic happens in `default.nix`.\n\n## A single Top-level imports 🤌 (umports).\n\nUse `slib = inputs.nixos-tidy.lib`\n\nGet rid of **imports** statements everywhere.\nYou only need **one top-level imports** statement.\n\nIt imports recursively all the files from inside a directory.\n\n### Nix only (without home-manager)\n\n```nix\n# flake.nix\nimports = let\n  slib = inputs.nixos-tidy.lib;\nin\n  []\n  # Import all nixos modules recursively\n  ++ slib.umportNixModules {\n    paths = [\n      inputs.anOtherFlake.nixosModules.default\n      ./.\n    ];\n    exclude = [\n      # Do not forget to exclude current file\n      # and flake definition.\n      ./default.nix\n      ./flake.nix\n    ];\n  };\n```\n\n### With home-manager\n\nIt enables a most wanted separation of concerns,\nwhere home-manager modules and nix modules\ncan lay in the same directory.\n\n```sh\n.\n├── gnome\n│   ├── default.nix\n│   ├── test.nix\n│   └── home.nix\n├── hyprland\n│   ├── default.nix\n│   ├── test.nix\n│   └── home.nix\n└── flake.nix # put boilerplate code at the flake top-level.\n```\n\n```nix\nimports = let\n  slib = inputs.nixos-tidy.lib;\nin\n  [\n    inputs.anOtherFlake.nixosModules.default\n  ]\n  # Import all nixos modules recursively\n  ++ slib.umportNixModules {\n    paths = [\n      ./.\n    ];\n    exclude = [\n      # Do not forget to exclude current file\n      # and flake definition.\n      ./default.nix\n      ./flake.nix\n    ]\n  }\n  ++ slib.umportHomeModules {\n    paths = [\n      ./.\n    ];\n  }\n  # Home-merger options\n  {\n    imports = [\n      inputs.nur.modules.homeManager.default\n    ];\n    users = [\"anon\"];\n  };\n```\n\n### File naming constraints.\n\nSee the [template flake with umports](https://github.com/pipelight/nixos-tidy/blob/master/templates/umports/flake.nix) for a working example (with home-manager).\n\nUmports makes the distinctions between module types based on\nfilenames.\nSo be sure to have your filenames checked.\n\nNix: \\*.nix\nHome-manager: home.nix || home.\\*.nix || home\\_\\*.nix\nUnit-tests: test.nix || test.\\*.nix || test\\_\\*.nix.\n\n## A flexible home-manager (Home-merger).\n\nUse `inputs.nixos-tidy.nixosModules.home-merger`.\nCheckout module definition for\n[options list](https://github.com/pipelight/nixos-tidy/blob/master/modules/home-merger/default.nix).\n\nHome-merger is a wrapper around home-manager that you can call multiple times,\nin order to scatter user definitions in separate files.\n\n### Top-level import (Umports)\n\n- Use it to split user definition.\n\n```nix\n# file_1.nix\nhome-merger = {\n  users = [\"alice\"];\n  umports.paths = [\n    ./alice_modules\n  ];\n};\n```\n\n```nix\n# file_2.nix\nhome-merger = {\n  users = [\"bob\"];\n  extraSpecialArgs = {inherit inputs;};\n  imports = [\n    inputs.anOtherModule.homeManagerModules.default\n  ];\n  umports.paths = [\n    ./bob_modules\n  ];\n};\n```\n\n- Or use it\n  to import a `home.nix` module\n  from an adjacent `default.nix` module.\n\n```sh\n.\n└── fish\n    ├── default.nix\n    └── home.nix\n```\n\n```nix\n# fish/default.nix\nprograms.fish.enable = true;\n\nhome-merger = {\n  users = [\"bob\"];\n  umports.paths = [\n      ./home.nix\n  ];\n};\n```\n\n```nix\n# fish/home.nix\nhome.programs.fish.enable = true;\n```\n\n## Allow-unfree\n\nUse `inputs.nixos-tidy.nixosModules.allow-unfree`\n\nCherry-pick unfree software exceptions with regexes.\n\n```nix\n#default.nix\nallow-unfree = [\n  # use regexes\n  \"nvidia-.*\"\n  \"cuda.*\"\n];\n```\n\n## Network privacy (ipv6)\n\nUse `inputs.nixos-tidy.nixosModules.networking-privacy`\n\nNot released yet.\nOnly on dev branch.\n\nStrengthen ipv6 privacy configuration for\nLinux kernel,\nNetworkManager,\nopenvswitch,\nstatic configuration\nand systemd-networkd.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpipelight%2Fnixos-tidy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpipelight%2Fnixos-tidy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpipelight%2Fnixos-tidy/lists"}