Compare commits

...

3 commits

Author SHA1 Message Date
2462e16382
flake.nix: add prettier hook 2024-02-01 17:49:02 -05:00
c65b649ff4
ags: fmt with prettier 2024-02-01 17:48:30 -05:00
3a3965b4d9
docs: fmt with prettier 2024-02-01 17:31:35 -05:00
15 changed files with 155 additions and 163 deletions

View file

@ -25,8 +25,8 @@
## :open_book: Table of contents ## :open_book: Table of contents
+ :house_with_garden: [home](src/branch/master/home) - :house_with_garden: [home](src/branch/master/home)
+ :computer: [hosts](src/branch/master/hosts) - :computer: [hosts](src/branch/master/hosts)
- :cloud_with_rain: [ame](src/branch/master/hosts/ame) - :cloud_with_rain: [ame](src/branch/master/hosts/ame)
- :cloud_with_lightning_and_rain: [arashi](src/branch/master/hosts/arashi) - :cloud_with_lightning_and_rain: [arashi](src/branch/master/hosts/arashi)
- :hibiscus: [haru](src/branch/master/hosts/haru) - :hibiscus: [haru](src/branch/master/hosts/haru)
@ -37,29 +37,31 @@
- :full_moon: [tsuki](src/branch/master/hosts/tsuki) - :full_moon: [tsuki](src/branch/master/hosts/tsuki)
- :building_construction: [tsuru](src/branch/master/hosts/tsuru) - :building_construction: [tsuru](src/branch/master/hosts/tsuru)
- :snowflake: [yuki](src/branch/master/hosts/yuki) - :snowflake: [yuki](src/branch/master/hosts/yuki)
+ :electric_plug: [modules](src/branch/master/modules) - :electric_plug: [modules](src/branch/master/modules)
+ :package: [pkgs](src/branch/master/pkgs) - :package: [pkgs](src/branch/master/pkgs)
+ :lock: [secrets](src/branch/master/secrets) - :lock: [secrets](src/branch/master/secrets)
## :spiral_notepad: Features ## :spiral_notepad: Features
+ multi-config repo, with configs for servers, laptop, and desktop - multi-config repo, with configs for servers, laptop, and desktop
+ multi-system home-manager setup - multi-system home-manager setup
+ secrets provisioning with [sops-nix](https://github.com/Mic92/sops-nix) - secrets provisioning with [sops-nix](https://github.com/Mic92/sops-nix)
+ multiple fully declarative self hosted services (and some containerized ones, with a docker backend) - multiple fully declarative self hosted services (and some containerized ones, with a docker backend)
+ wayland config for hyprland - wayland config for hyprland
+ custom packages not found in nixpkgs - custom packages not found in nixpkgs
+ linted & styled with [alejandra](https://github.com/kamadorueda/alejandra), [deadnix](https://github.com/astro/deadnix), and [statix](https://github.com/nerdypepper/statix) - linted & styled with [alejandra](https://github.com/kamadorueda/alejandra), [deadnix](https://github.com/astro/deadnix), and [statix](https://github.com/nerdypepper/statix)
## :busts_in_silhouette: Credit ## :busts_in_silhouette: Credit
#### people who've inspired me to dive into nix, and i've stolen stuff from (you guys are awesome!) #### people who've inspired me to dive into nix, and i've stolen stuff from (you guys are awesome!)
+ [fufexan](https://github.com/fufexan) - a ton of home manager, hyprland stuff, and some gh workflows
+ [Misterio77](https://github.com/Misterio77) - flake, and some other boilerplate - [fufexan](https://github.com/fufexan) - a ton of home manager, hyprland stuff, and some gh workflows
+ [NobbZ](https://github.com/NobbZ) - general nix assistance - [Misterio77](https://github.com/Misterio77) - flake, and some other boilerplate
+ [MatthiasBenaets](https://github.com/MatthiasBenaets) - amazing nixos introduction video - [NobbZ](https://github.com/NobbZ) - general nix assistance
+ [sioodmy](https://github.com/sioodmy) - general dotfile, readme badges, and hyprland stuff - [MatthiasBenaets](https://github.com/MatthiasBenaets) - amazing nixos introduction video
+ [MatthewCroughan](https://github.com/MatthewCroughan) - traefik config used as reference - [sioodmy](https://github.com/sioodmy) - general dotfile, readme badges, and hyprland stuff
+ [seqizz](https://github.com/seqizz/nixos-config/blob/3ee51f406a8c7aa3afde9cdee97a43641b2ed2ef/modules/server/rustypaste.nix) - rustypaste config - [MatthewCroughan](https://github.com/MatthewCroughan) - traefik config used as reference
+ [Yavko](https://github.com/yavko) - ironbar config used as reference - [seqizz](https://github.com/seqizz/nixos-config/blob/3ee51f406a8c7aa3afde9cdee97a43641b2ed2ef/modules/server/rustypaste.nix) - rustypaste config
+ [hlissner](https://github.com/hlissner) - [security.nix](modules/security.nix) - [Yavko](https://github.com/yavko) - ironbar config used as reference
+ [noc](https://git.flake.sh/noc) - networking diagram + a ton of other stuff - [hlissner](https://github.com/hlissner) - [security.nix](modules/security.nix)
- [noc](https://git.flake.sh/noc) - networking diagram + a ton of other stuff

View file

@ -63,6 +63,10 @@
enable = true; enable = true;
excludes = ["overlays.nix"]; excludes = ["overlays.nix"];
}; };
prettier = {
enable = true;
files = "\\.(js|ts|md)$";
};
}; };
}; };
}; };
@ -72,13 +76,8 @@
packages = with pkgs; [ packages = with pkgs; [
git git
sops sops
alejandra
statix
deadnix
stylua
yaml-language-server yaml-language-server
lua-language-server lua-language-server
nodePackages.typescript-language-server
]; ];
}; };
formatter.${system} = pkgs.alejandra; formatter.${system} = pkgs.alejandra;

View file

@ -2,27 +2,27 @@
the home of my dotfiles. configured in, and managed by home-manager. the home of my dotfiles. configured in, and managed by home-manager.
name | description | name | description |
--------------- | ----------- | ---------------- | -------------------------------------------------------------------------- |
`ags` | aylurs gtk shell | `ags` | aylurs gtk shell |
`anyrun` | wayland native application launcher | `anyrun` | wayland native application launcher |
`cava` | terminal audio visualizer | `cava` | terminal audio visualizer |
`direnv` | a shell extension, that loads environment variables in certain directories | `direnv` | a shell extension, that loads environment variables in certain directories |
`editors` | houses my main editors, helix and nvim | `editors` | houses my main editors, helix and nvim |
`default` | used for commonly shared modules, for multiple home-manager configs | `default` | used for commonly shared modules, for multiple home-manager configs |
`git` | version control system | `git` | version control system |
`gtk` | themes | `gtk` | themes |
`helix` | modal text editor | `helix` | modal text editor |
`ironbar` | wayland specific bar, written in Rust | `ironbar` | wayland specific bar, written in Rust |
`lazygit` | terminal based git command system | `lazygit` | terminal based git command system |
`mako` | a lightweight wayland notification daemon | `mako` | a lightweight wayland notification daemon |
`neofetch` | fetch program | `neofetch` | fetch program |
`nushell` | my shell of choice | `nushell` | my shell of choice |
`spotify-player`| terminal music player for spotify | `spotify-player` | terminal music player for spotify |
`starship` | shell prompt | `starship` | shell prompt |
`wayland` | has my hyprland config, along with session variables for wayland | `wayland` | has my hyprland config, along with session variables for wayland |
`wezterm` | my terminal of choice | `wezterm` | my terminal of choice |
`yazi` | terminal file manager | `yazi` | terminal file manager |
`zathura` | pdf viewer | `zathura` | pdf viewer |
`zellij` | terminal multiplexer | `zellij` | terminal multiplexer |
`zoxide` | a smarter cd command | `zoxide` | a smarter cd command |

View file

@ -1,26 +1,23 @@
module.exports = { module.exports = {
"env": { env: {
"browser": true, browser: true,
"es2021": true es2021: true
}, },
"extends": "eslint:recommended", extends: "eslint:recommended",
"overrides": [ overrides: [
{ {
"env": { env: {
"node": true node: true
}, },
"files": [ files: [".eslintrc.{js,cjs}"],
".eslintrc.{js,cjs}" parserOptions: {
], sourceType: "script"
"parserOptions": { }
"sourceType": "script"
}
}
],
"parserOptions": {
"ecmaVersion": "latest",
"sourceType": "module"
},
"rules": {
} }
} ],
parserOptions: {
ecmaVersion: "latest",
sourceType: "module"
},
rules: {}
};

View file

@ -0,0 +1,3 @@
{
"trailingComma" : "none"
}

View file

@ -7,17 +7,15 @@ const css = App.configDir + "/style.css";
Utils.exec(`sass ${scss} ${css}`); Utils.exec(`sass ${scss} ${css}`);
function reloadCss() { function reloadCss() {
console.log("scss updating"); console.log("scss updating");
Utils.exec(`sass ${scss} ${css}`); Utils.exec(`sass ${scss} ${css}`);
App.resetCss(); App.resetCss();
App.applyCss(css); App.applyCss(css);
} }
Utils.monitorFile(`${App.configDir}/scss`, reloadCss, "directory"); Utils.monitorFile(`${App.configDir}/scss`, reloadCss, "directory");
export default { export default {
style: css, style: css,
windows: [ windows: [Bar(2)]
Bar(2),
],
}; };

View file

@ -7,23 +7,16 @@ import { Workspaces } from "./widgets/hyprland.js";
const Start = () => const Start = () =>
Widget.Box({ Widget.Box({
hpack: "start", hpack: "start",
children: [ children: [nixosLogo(), Workspaces()]
nixosLogo(),
Workspaces(),
],
}); });
const Center = () => const Center = () =>
Widget.Box({ Widget.Box({
children: [ children: [Media()]
Media(),
],
}); });
const End = () => const End = () =>
Widget.Box({ Widget.Box({
hpack: "end", hpack: "end",
children: [ children: [Time()]
Time(),
],
}); });
const Bar = (monitor) => const Bar = (monitor) =>
@ -35,8 +28,8 @@ const Bar = (monitor) =>
child: Widget.CenterBox({ child: Widget.CenterBox({
startWidget: Start(), startWidget: Start(),
centerWidget: Center(), centerWidget: Center(),
endWidget: End(), endWidget: End()
}), })
}); });
export { Bar }; export { Bar };

View file

@ -8,11 +8,12 @@ const Workspaces = () =>
Widget.Button({ Widget.Button({
on_clicked: () => Hyprland.sendMessage(`dispatch workspace ${id}`), on_clicked: () => Hyprland.sendMessage(`dispatch workspace ${id}`),
child: Widget.Label(`${id}`), child: Widget.Label(`${id}`),
class_name: Hyprland.active.workspace.bind("id") class_name: Hyprland.active.workspace
.transform((i) => `${i === id ? "focused" : ""}`), .bind("id")
.transform((i) => `${i === id ? "focused" : ""}`)
}) })
); );
}), })
}); });
export { Workspaces }; export { Workspaces };

View file

@ -3,14 +3,18 @@ import { Mpris, Widget } from "../../import.js";
const Media = () => const Media = () =>
Widget.Box({ Widget.Box({
class_name: "media", class_name: "media",
child: Widget.Label("-").hook(Mpris, (self) => { child: Widget.Label("-").hook(
if (Mpris.players[0]) { Mpris,
const { track_artists, track_title } = Mpris.players[0]; (self) => {
self.label = `${track_artists.join(", ")} - ${track_title}`; if (Mpris.players[0]) {
} else { const { track_artists, track_title } = Mpris.players[0];
self.label = "Nothing is playing"; self.label = `${track_artists.join(", ")} - ${track_title}`;
} } else {
}, "player-changed"), self.label = "Nothing is playing";
}
},
"player-changed"
)
}); });
export { Media }; export { Media };

View file

@ -3,14 +3,12 @@ import { Utils, Widget } from "../../import.js";
const Time = () => const Time = () =>
Widget.Box({ Widget.Box({
child: Widget.Label({ child: Widget.Label({
className: "date", className: "date"
}).poll( }).poll(1000, (self) =>
1000, Utils.execAsync(["date", "+%a %b %d %H:%M"]).then(
(self) => (time) => (self.label = time)
Utils.execAsync(["date", "+%a %b %d %H:%M"]).then((time) => )
self.label = time )
),
),
}); });
export { Time }; export { Time };

View file

@ -1,15 +1,12 @@
{ {
"compilerOptions": { "compilerOptions": {
"module": "ESNext", "module": "ESNext",
"moduleResolution": "Node", "moduleResolution": "Node",
"target": "ES2020", "target": "ES2020",
"jsx": "react", "jsx": "react",
"allowImportingTsExtensions": true, "allowImportingTsExtensions": true,
"strictNullChecks": true, "strictNullChecks": true,
"strictFunctionTypes": true "strictFunctionTypes": true
}, },
"exclude": [ "exclude": ["node_modules", "**/node_modules/*"]
"node_modules",
"**/node_modules/*"
]
} }

View file

@ -2,17 +2,17 @@
my different hosts, each with their own unique configurations and purposes. my different hosts, each with their own unique configurations and purposes.
Name | Description | Name | Description |
--------------- | ----------- | --------- | --------------------------------------------------------------------------------------------------------------- |
`ame` | T480 laptop, mainly used for experimenting atm | `ame` | T480 laptop, mainly used for experimenting atm |
`arashi` | postgres / redis vm | `arashi` | postgres / redis vm |
`haru` | adblocker / DNS proxy vm | `haru` | adblocker / DNS proxy vm |
`kariru` | *arr stack / seedbox vm | `kariru` | \*arr stack / seedbox vm |
`kaze` | s3 storage ran on a [buyvm slice](https://buyvm.net/kvm-dedicated-server-slices/), with block storage attached. | `kaze` | s3 storage ran on a [buyvm slice](https://buyvm.net/kvm-dedicated-server-slices/), with block storage attached. |
`sakura` | main vm, hosting most internet connected services | `sakura` | main vm, hosting most internet connected services |
`sora` | hetzner vps | `sora` | hetzner vps |
`tsuki` | main machine running hyprland | `tsuki` | main machine running hyprland |
`tsuru` | vm for ci/cd runners, and (potentially) a binary cache | `tsuru` | vm for ci/cd runners, and (potentially) a binary cache |
`yuki` | my old proxmox machine, now running pure nix | `yuki` | my old proxmox machine, now running pure nix |
`default` | defines `nixosConfigurations` | `default` | defines `nixosConfigurations` |
`deploy` | defines deployment nodes for deploy-rs | `deploy` | defines deployment nodes for deploy-rs |

View file

@ -2,16 +2,16 @@
this directory hosts some common modules / services / security tweaks used on (most) hosts. this directory hosts some common modules / services / security tweaks used on (most) hosts.
name | description | name | description |
--------------- | ----------- | ---------------- | ---------------------------------------------------------------------------------- |
`prometheus` | has default prometheus config for all hosts, along with exporters for select hosts | `prometheus` | has default prometheus config for all hosts, along with exporters for select hosts |
`default` | used for commonly shared modules | `default` | used for commonly shared modules |
`fonts` | font handling | `fonts` | font handling |
`nix` | common nix configuration | `nix` | common nix configuration |
`openssh` | configures openssh options | `openssh` | configures openssh options |
`security` | stolen from [hlissner](https://github.com/hlissner) | `security` | stolen from [hlissner](https://github.com/hlissner) |
`sops` | configures sops-nix | `sops` | configures sops-nix |
`system` | commonly shared system settings | `system` | commonly shared system settings |
`time` | force sets the time on all systems | `time` | force sets the time on all systems |
`users` | defines all hosts users & groups | `users` | defines all hosts users & groups |
`virtualisation`| basic docker configuration | `virtualisation` | basic docker configuration |

View file

@ -2,8 +2,8 @@
this directory hosts derivations of packages not found in nixpkgs, and overrides. this directory hosts derivations of packages not found in nixpkgs, and overrides.
name | description | name | description |
--------------- | ----------- | -------------- | ---------------------------------------------------------------------------------------------- |
`chatterino7` | [7tv fork](https://github.com/SevenTV/chatterino7) of chatterino2, a chat client for twitch.tv | `chatterino7` | [7tv fork](https://github.com/SevenTV/chatterino7) of chatterino2, a chat client for twitch.tv |
`jellyfin-rpc` | [discord rpc client](https://github.com/Radiicall/jellyfin-rpc) for jellyfin | `jellyfin-rpc` | [discord rpc client](https://github.com/Radiicall/jellyfin-rpc) for jellyfin |
`overlays.nix` | has overlays that i use | `overlays.nix` | has overlays that i use |