refactor: flake dir -> outputs/sys -> nixos

This commit is contained in:
ooks-io 2024-06-08 23:06:08 +12:00
parent 3615bb010f
commit a6d5e892a1
73 changed files with 9 additions and 2 deletions

60
outputs/nixos.nix Normal file
View file

@ -0,0 +1,60 @@
{ inputs, self, ... }:
let
inherit (inputs.nixpkgs.lib) nixosSystem;
hm = inputs.home-manager.nixosModules.home-manager;
sys = "${self}/sys";
hosts = "${self}/hosts";
base = "${sys}/modules/base";
roles = "${sys}/modules/roles";
gaming = "${roles}/gaming";
workstation = "${roles}/workstation";
media-server = "${roles}/media-server";
specialArgs = {inherit inputs self;};
in
{
flake.nixosConfigurations = {
ooksdesk = nixosSystem {
inherit specialArgs;
system = "x86_64-linux";
modules = [
"${hosts}/ooksdesk"
hm
base
gaming
workstation
];
};
ookst480s = nixosSystem {
inherit specialArgs;
system = "x86_64-linux";
modules = [
"${hosts}/ookst480s"
hm
base
workstation
];
};
ooksmedia = nixosSystem {
inherit specialArgs;
system = "x86_64-linux";
modules = [
"${hosts}/ooksmedia"
hm
base
gaming
workstation
media-server
];
};
};
}

View file

@ -0,0 +1,26 @@
{ outputs, inputs, ... }:
{
# For every flake input, aliases 'pkgs.inputs.${flake}' to
# 'inputs.${flake}.packages.${pkgs.system}' or
# 'inputs.${flake}.legacyPackages.${pkgs.system}'
flake-inputs = final: _: {
inputs = builtins.mapAttrs
(_: flake: let
legacyPackages = ((flake.legacyPackages or {}).${final.system} or {});
packages = ((flake.packages or {}).${final.system} or {});
in
if legacyPackages != {} then legacyPackages else packages
)
inputs;
};
zjstatus = final: prev: {
zjstatus = inputs.zjstatus.packages.${prev.system}.default;
};
# waybar = final: prev: {
# waybar = inputs.nixpkgs-wayland.packages.${prev.system}.waybar;
# };
additions = final: prev: import ../pkgs { pkgs = final; };
}

7
outputs/pkgs/default.nix Normal file
View file

@ -0,0 +1,7 @@
{
perSystem = { system, pkgs, inputs, ... }: {
packages = {
live-buds-cli = pkgs.callPackage ./live-buds-cli {};
};
};
}

View file

@ -0,0 +1,25 @@
{ lib, rustPlatform, fetchFromGitHub, pkg-config, dbus, libpulseaudio, bluez }:
rustPlatform.buildRustPackage rec {
pname = "live-buds-cli";
version = "0.1.9";
src = fetchFromGitHub {
owner = "JojiiOfficial";
repo = "LiveBudsCli";
rev = "v${version}";
sha256 = "A4XQiJrk4ehb6+935L2JFOeAhUJ7bdukV5mL0Jxn0sQ=";
};
cargoSha256 = "w/dt7Q9TACw5N/+QNAKMUEngf8sAhWyGslnw3B16crQ=";
nativeBuildInputs = [ pkg-config ];
buildInputs = [ libpulseaudio bluez dbus ];
meta = with lib; {
description = "A free cli tool to control your Galaxy buds live, Galaxy Buds+, Galaxy Buds Pro, Galaxy Buds 2 and Galaxy Buds 2 Pro";
license = licenses.gpl3;
platforms = platforms.unix;
};
}

7
outputs/shell.nix Normal file
View file

@ -0,0 +1,7 @@
{ pkgs ? (import ./nixpkgs.nix) { } }: {
default = pkgs.mkShell {
# Enable experimental features without having to specify the argument
NIX_CONFIG = "experimental-features = nix-command flakes";
nativeBuildInputs = with pkgs; [ nix home-manager git neovim ];
};
}