mirror of
https://github.com/lightly-toasted/nix-config.git
synced 2025-12-10 03:49:44 +00:00
Compare commits
No commits in common. "b4bbf014a89f8b6bd9293aca0f1fc42b8eda8801" and "63b25a91748487c3b0713e9df6d0a753bce828b4" have entirely different histories.
b4bbf014a8
...
63b25a9174
5 changed files with 10 additions and 68 deletions
|
|
@ -5,7 +5,7 @@ My personal NixOS and home-manager configurations.
|
||||||
- `nixos`: My main computer.
|
- `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).
|
- `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).
|
- `wsl`: NixOS on WSL via [NixOS-WSL](https://github.com/nix-community/NixOS-WSL).
|
||||||
- `y2q`: Spare Galaxy S20+ phone, repurposed as a Ubuntu server using [chroot-distro](https://github.com/Magisk-Modules-Alt-Repo/chroot-distro).
|
- `y2q`: Spare Galaxy S20+ phone, repurposed as a Raspbian server using [Pi Deploy](https://github.com/DesktopECHO/Pi-hole-for-Android).
|
||||||
|
|
||||||
## Deploy
|
## Deploy
|
||||||
```sh
|
```sh
|
||||||
|
|
|
||||||
11
flake.nix
11
flake.nix
|
|
@ -70,7 +70,7 @@
|
||||||
extraSpecialArgs = { inherit inputs rootPath; };
|
extraSpecialArgs = { inherit inputs rootPath; };
|
||||||
modules = [ ./home/hosts/wsl.nix ];
|
modules = [ ./home/hosts/wsl.nix ];
|
||||||
};
|
};
|
||||||
"toast@y2q" = home-manager.lib.homeManagerConfiguration {
|
"android@y2q" = home-manager.lib.homeManagerConfiguration {
|
||||||
pkgs = nixpkgs.legacyPackages.aarch64-linux;
|
pkgs = nixpkgs.legacyPackages.aarch64-linux;
|
||||||
extraSpecialArgs = { inherit inputs rootPath; };
|
extraSpecialArgs = { inherit inputs rootPath; };
|
||||||
modules = [ ./home/hosts/y2q.nix ];
|
modules = [ ./home/hosts/y2q.nix ];
|
||||||
|
|
@ -89,9 +89,12 @@
|
||||||
pkgs.sops
|
pkgs.sops
|
||||||
];
|
];
|
||||||
|
|
||||||
shellHook = ''
|
packages = [
|
||||||
export PATH=${builtins.toPath ./bin}:$PATH
|
(pkgs.symlinkJoin {
|
||||||
'';
|
name = "deploy-bin";
|
||||||
|
paths = [ ./bin ];
|
||||||
|
})
|
||||||
|
];
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,6 @@
|
||||||
imports = [
|
imports = [
|
||||||
inputs.nixvim.homeModules.nixvim
|
inputs.nixvim.homeModules.nixvim
|
||||||
|
|
||||||
../modules/runit
|
|
||||||
../modules/cli/git.nix
|
../modules/cli/git.nix
|
||||||
../modules/cli/ripgrep.nix
|
../modules/cli/ripgrep.nix
|
||||||
../modules/cli/btop.nix
|
../modules/cli/btop.nix
|
||||||
|
|
@ -15,8 +14,8 @@
|
||||||
];
|
];
|
||||||
|
|
||||||
home = {
|
home = {
|
||||||
username = "toast";
|
username = "android";
|
||||||
homeDirectory = "/home/toast";
|
homeDirectory = "/home/android";
|
||||||
stateVersion = "24.11";
|
stateVersion = "24.11";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,50 +0,0 @@
|
||||||
{ 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
|
|
||||||
);
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
@ -1,10 +0,0 @@
|
||||||
{ pkgs, ... }:
|
|
||||||
|
|
||||||
{
|
|
||||||
runit.services.glances = {
|
|
||||||
script = ''
|
|
||||||
#!/bin/bash
|
|
||||||
${pkgs.glances}/bin/glances -w
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
}
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue