Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/numtide/system-manager
Manage system config using nix on any distro
https://github.com/numtide/system-manager
buildbot-numtide nix nix-modules
Last synced: about 24 hours ago
JSON representation
Manage system config using nix on any distro
- Host: GitHub
- URL: https://github.com/numtide/system-manager
- Owner: numtide
- License: mit
- Created: 2023-03-22T16:38:41.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2024-12-31T13:06:31.000Z (11 days ago)
- Last Synced: 2025-01-03T14:06:43.801Z (8 days ago)
- Topics: buildbot-numtide, nix, nix-modules
- Language: Rust
- Homepage:
- Size: 592 KB
- Stars: 828
- Watchers: 19
- Forks: 23
- Open Issues: 30
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- stars - numtide/system-manager
- awesome-nix - System Manager - A non-NixOS Linux system configuration tool built on Nix. (Overlays / Webinterface)
- awesome-starred - numtide/system-manager - Manage system config using nix on any distro (Rust)
- awesome-starred - numtide/system-manager - Manage system config using nix on any distro (Rust)
README
This project provides a basic method to manage system configuration using [Nix][nixos]
on any Linux distribution.
It builds on the many modules that already exist in [NixOS][nixos].*Warning*: System Manager is a work in progress, you can expect things not to work or to break.
[nixos]: https://nixos.org
# Usage
## Getting Nix
In order to use System Manager, you will first need to install Nix.
You can either use your distro's package manager, or use one of the different options
to install Nix, like [the official installer][official-installer] or this
[new installer][detsys-installer].[official-installer]: https://nixos.org/download.html
[detsys-installer]: https://github.com/DeterminateSystems/nix-installer## Usage with flakes
### Defining the configuration
A basic Nix flake using System Manager would look something like this:
```nix
{
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";system-manager = {
url = "github:numtide/system-manager";
inputs.nixpkgs.follows = "nixpkgs";
};
};outputs = { self, flake-utils, nixpkgs, system-manager }: {
systemConfigs.default = system-manager.lib.makeSystemConfig {
modules = [
./modules
];
};
};
}
```And you would then put your System Manager modules in the `modules` directory,
which should contain a `default.nix` file which functions as the entrance point.A simple System Manager module could look something like this:
```nix
{ config, lib, pkgs, ... }:{
config = {
nixpkgs.hostPlatform = "x86_64-linux";environment = {
etc = {
"foo.conf".text = ''
launch_the_rockets = true
'';
};
systemPackages = [
pkgs.ripgrep
pkgs.fd
pkgs.hello
];
};systemd.services = {
foo = {
enable = true;
serviceConfig = {
Type = "oneshot";
RemainAfterExit = true;
};
wantedBy = [ "system-manager.target" ];
script = ''
${lib.getBin pkgs.hello}/bin/hello
echo "We launched the rockets!"
'';
};
};
};
}
```### Activating the configuration
Once the configuration is defined, you can activate it using the `system-manager` CLI:
```sh
nix run 'github:numtide/system-manager' -- switch --flake '.'
```# Currently supported features
Currently it is possible to configure files under `/etc/` and systemd services.
More features may follow later.## Supported Systems
System Manager is currently only supported on NixOS and Ubuntu. However, it can be used on other distributions by enabling the following:
```nix
{
config = {
system-manager.allowAnyDistro = true;
}
}
```> [!WARNING]
> This is unsupported and untested. Use at your own risk.## Commercial support
Looking for help or customization?
Get in touch with Numtide to get a quote. We make it easy for companies to
work with Open Source projects: