A simple autologin service.
- Nix 60.7%
- Rust 39.3%
| nix | Adjust PAM configuration | |
| src |
Add --close-stdout
|
|
| .envrc | Simplify the Flake | |
| .gitignore | Hello world | |
| Cargo.lock | Update dependencies | |
| Cargo.toml | Replace slog with tracing | |
| flake.lock | Update Flake inputs | |
| flake.nix | Fix devshell | |
| README.md | Add a README | |
Usage
{
inputs = {
# ...
authologin.url = "git+https://codeberg.org/ollijh/authologin";
authologin.inputs.nixpkgs.follows = "nixpkgs";
# ...
};
outputs = { nixpkgs, authologin, ... }: {
nixosConfigurations.joes-desktop = nixpkgs.lib.nixosSystem {
# ...
modules = [
# ...
authologin.nixosModules.default
({lib, ...}: {
services.authologin = {
enable = true;
user = "joe"; # Replace with your username.
command = lib.getExe config.programs.sway.package; # To start Sway, for example.
};
})
];
};
};
}
Will try to use your disk encryption password to authenticate and open GNOME keyring if your root disk is encrypted.
Note that the PAM configuration is rather fixed (see
flake.nix), so if you need to alter it you have to
replace the whole thing.