mirror of
https://github.com/lightly-toasted/nix-config.git
synced 2025-12-10 03:49:44 +00:00
Compare commits
4 commits
63b25a9174
...
b4bbf014a8
| Author | SHA1 | Date | |
|---|---|---|---|
| b4bbf014a8 | |||
| 179c67f058 | |||
| 6ff05be31f | |||
| a29c713ca5 |
5 changed files with 68 additions and 10 deletions
|
|
@ -5,7 +5,7 @@ My personal NixOS and home-manager configurations.
|
|||
- `nixos`: My main computer.
|
||||
- `vps`: 2GB KVM VPS server on [RackNerd](https://www.racknerd.com/), installed with NixOS using [nixos-infect](https://github.com/elitak/nixos-infect).
|
||||
- `wsl`: NixOS on WSL via [NixOS-WSL](https://github.com/nix-community/NixOS-WSL).
|
||||
- `y2q`: Spare Galaxy S20+ phone, repurposed as a Raspbian server using [Pi Deploy](https://github.com/DesktopECHO/Pi-hole-for-Android).
|
||||
- `y2q`: Spare Galaxy S20+ phone, repurposed as a Ubuntu server using [chroot-distro](https://github.com/Magisk-Modules-Alt-Repo/chroot-distro).
|
||||
|
||||
## Deploy
|
||||
```sh
|
||||
|
|
|
|||
11
flake.nix
11
flake.nix
|
|
@ -70,7 +70,7 @@
|
|||
extraSpecialArgs = { inherit inputs rootPath; };
|
||||
modules = [ ./home/hosts/wsl.nix ];
|
||||
};
|
||||
"android@y2q" = home-manager.lib.homeManagerConfiguration {
|
||||
"toast@y2q" = home-manager.lib.homeManagerConfiguration {
|
||||
pkgs = nixpkgs.legacyPackages.aarch64-linux;
|
||||
extraSpecialArgs = { inherit inputs rootPath; };
|
||||
modules = [ ./home/hosts/y2q.nix ];
|
||||
|
|
@ -89,12 +89,9 @@
|
|||
pkgs.sops
|
||||
];
|
||||
|
||||
packages = [
|
||||
(pkgs.symlinkJoin {
|
||||
name = "deploy-bin";
|
||||
paths = [ ./bin ];
|
||||
})
|
||||
];
|
||||
shellHook = ''
|
||||
export PATH=${builtins.toPath ./bin}:$PATH
|
||||
'';
|
||||
};
|
||||
}
|
||||
);
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@
|
|||
imports = [
|
||||
inputs.nixvim.homeModules.nixvim
|
||||
|
||||
../modules/runit
|
||||
../modules/cli/git.nix
|
||||
../modules/cli/ripgrep.nix
|
||||
../modules/cli/btop.nix
|
||||
|
|
@ -14,8 +15,8 @@
|
|||
];
|
||||
|
||||
home = {
|
||||
username = "android";
|
||||
homeDirectory = "/home/android";
|
||||
username = "toast";
|
||||
homeDirectory = "/home/toast";
|
||||
stateVersion = "24.11";
|
||||
};
|
||||
|
||||
|
|
|
|||
50
home/modules/runit/default.nix
Normal file
50
home/modules/runit/default.nix
Normal file
|
|
@ -0,0 +1,50 @@
|
|||
{ config, lib, ... }:
|
||||
|
||||
{
|
||||
imports = (
|
||||
let
|
||||
servicesPath = ./services;
|
||||
serviceModules = builtins.attrNames (builtins.readDir (servicesPath));
|
||||
in
|
||||
map (module: servicesPath + "/${module}") serviceModules
|
||||
);
|
||||
|
||||
options.runit = {
|
||||
services = lib.mkOption {
|
||||
type = lib.types.attrsOf (lib.types.submodule ({ name, ... }: {
|
||||
options = {
|
||||
script = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
description = "Shell commands executed as the service's main process";
|
||||
};
|
||||
log.enable = lib.mkEnableOption "Enable logging";
|
||||
};
|
||||
}));
|
||||
};
|
||||
default = {};
|
||||
description = "User-level runit services under ~/runit/services/";
|
||||
};
|
||||
|
||||
config = {
|
||||
home.file = lib.mkMerge (
|
||||
lib.mapAttrsToList (serviceName: sCfg:
|
||||
{
|
||||
# run script
|
||||
"runit/services/${serviceName}/run" = {
|
||||
text = sCfg.script;
|
||||
executable = true;
|
||||
};
|
||||
|
||||
# logging
|
||||
"runit/services/${serviceName}/log/run" = lib.mkIf sCfg.log.enable {
|
||||
text = ''
|
||||
#!/bin/sh
|
||||
exec svlogd -t ./main
|
||||
'';
|
||||
};
|
||||
}
|
||||
) config.runit.services
|
||||
);
|
||||
};
|
||||
}
|
||||
|
||||
10
home/modules/runit/services/glances.nix
Normal file
10
home/modules/runit/services/glances.nix
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
{ pkgs, ... }:
|
||||
|
||||
{
|
||||
runit.services.glances = {
|
||||
script = ''
|
||||
#!/bin/bash
|
||||
${pkgs.glances}/bin/glances -w
|
||||
'';
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue