refactor: fit structure of main directories
All checks were successful
Discord / discord commits (push) Has been skipped

This commit is contained in:
matt1432 2025-01-04 21:34:36 -05:00
parent 49dc072b81
commit d2625fa290
12 changed files with 110 additions and 99 deletions

View file

@ -1,14 +1,14 @@
# My NixOS configs
TODO: add directory structure info and enforce it
- every root folder in the repo represents a flake output except inputs
- every root folder only has a `default.nix` and subfolders for each
- [x] every root folder in the repo represents a flake output except inputs
- [] every root folder only has an optional `default.nix` and subfolders for each
of its attrs
- in a subfolder, there should always be a `default.nix`
- if there is non nix code, it will be in a `config` folder
- redo docs
- every module should not do anything if imported
- all nix files that represent a module should be `default.nix` (a nix file
- [] in a subfolder, there should always be a `default.nix`
- [] if there is non nix code, it will be in a `config` folder
- [] redo docs
- [] every module should not do anything if imported
- [] all nix files that represent a module should be `default.nix` (a nix file
which is imported directly can be called anything alongside `default.nix`)
## AGS

View file

@ -22,7 +22,7 @@ in
prePatch = ''
mv ./tsconfig.json ./project.json
sed 's/^ *\/\/.*//' ${../config/tsconfig.json} > ./base.json
sed 's/^ *\/\/.*//' ${./config/tsconfig.json} > ./base.json
${jq}/bin/jq -sr '.[0] * .[1] | del(.extends)' ./project.json ./base.json > ./tsconfig.json
rm base.json project.json
'';

View file

@ -5,7 +5,7 @@
}: let
inherit (pkgs.lib) getExe listToAttrs nameValuePair;
buildApp = attrs: (pkgs.callPackage ./nix/buildApp.nix ({} // inputs // attrs));
buildApp = attrs: (pkgs.callPackage ./buildApp.nix ({} // inputs // attrs));
mkApp = file: {
program = getExe (pkgs.callPackage file ({inherit buildApp;} // inputs));

View file

@ -32,7 +32,7 @@
after = ["spotifyd.service"];
path = builtins.attrValues {
inherit (pkgs) bluez;
inherit (config.hardware.pulseaudio) package;
inherit (config.services.pulseaudio) package;
};
script = ''
if [[ "$(pactl get-default-sink)" == "auto_null" ]]; then

View file

@ -5,7 +5,7 @@
}: let
inherit (builtins) attrValues;
langsShells = import ./langs.nix {inherit pkgs self;};
neovimShells = import ./neovim-shells {inherit pkgs self;};
bumpNpmDeps = pkgs.writeShellApplication {
name = "bumpNpmDeps";
@ -24,91 +24,13 @@
};
in
{
default = pkgs.mkShell {
packages = [
(pkgs.writeShellApplication {
name = "mkIso";
flake = pkgs.callPackage ./flake {};
default = self.devShells.${pkgs.system}.flake;
runtimeInputs = attrValues {
inherit
(pkgs)
nix-output-monitor
;
};
netdaemon = pkgs.callPackage ./netdaemon {};
text = ''
isoConfig="nixosConfigurations.live-image.config.system.build.isoImage"
nom build "$FLAKE#$isoConfig"
'';
})
node = pkgs.callPackage ./node {inherit bumpNpmDeps;};
(pkgs.writeShellApplication {
name = "fixUidChange";
runtimeInputs = attrValues {
inherit
(pkgs)
findutils
gnused
;
};
text = ''
GROUP="$1"
OLD_GID="$2"
NEW_GID="$3"
# Remove generated group entry
sudo sed -i -e "/^$GROUP:/d" /etc/group
# Change GID on existing files
sudo find / -gid "$OLD_GID" -exec chgrp "$NEW_GID" {} +
'';
})
];
};
netdaemon = pkgs.mkShell {
packages = attrValues {
inherit
(pkgs.dotnetCorePackages)
sdk_9_0
;
};
};
node = pkgs.mkShell {
packages = attrValues {
inherit
(pkgs)
nodejs_latest
typescript
;
inherit
bumpNpmDeps
;
};
};
subtitles-dev = pkgs.mkShell {
packages = attrValues {
inherit
(pkgs)
nodejs_latest
typescript
ffmpeg-full
;
inherit
(pkgs.nodePackages)
ts-node
;
inherit
bumpNpmDeps
;
};
};
subtitles-dev = pkgs.callPackage ./subtitle-dev {inherit bumpNpmDeps;};
}
// langsShells
// neovimShells

View file

@ -0,0 +1,46 @@
{
mkShell,
writeShellApplication,
# deps
findutils,
gnused,
nix-output-monitor,
...
}:
mkShell {
packages = [
(writeShellApplication {
name = "mkIso";
runtimeInputs = [
nix-output-monitor
];
text = ''
isoConfig="nixosConfigurations.live-image.config.system.build.isoImage"
nom build "$FLAKE#$isoConfig"
'';
})
(writeShellApplication {
name = "fixUidChange";
runtimeInputs = [
findutils
gnused
];
text = ''
GROUP="$1"
OLD_GID="$2"
NEW_GID="$3"
# Remove generated group entry
sudo sed -i -e "/^$GROUP:/d" /etc/group
# Change GID on existing files
sudo find / -gid "$OLD_GID" -exec chgrp "$NEW_GID" {} +
'';
})
];
}

View file

@ -6,7 +6,7 @@
inherit (pkgs.lib) listToAttrs nameValuePair;
mkLangsShells = langs:
listToAttrs (map (l:
nameValuePair l (pkgs.callPackage ../homeManagerModules/neovim/langs/${l}/shell.nix {inherit self;}))
nameValuePair l (pkgs.callPackage "${self}/homeManagerModules/neovim/langs/${l}/shell.nix" {inherit self;}))
langs);
in
mkLangsShells [

View file

@ -0,0 +1,10 @@
{
mkShell,
dotnetCorePackages,
...
}:
mkShell {
packages = [
dotnetCorePackages.sdk_9_0
];
}

View file

@ -0,0 +1,14 @@
{
mkShell,
bumpNpmDeps,
nodejs_latest,
typescript,
...
}:
mkShell {
packages = [
bumpNpmDeps
nodejs_latest
typescript
];
}

View file

@ -0,0 +1,19 @@
{
mkShell,
bumpNpmDeps,
ffmpeg-full,
nodejs_latest,
nodePackages,
typescript,
...
}:
mkShell {
packages = [
nodejs_latest
typescript
ffmpeg-full
nodePackages.ts-node
bumpNpmDeps
];
}

View file

@ -137,7 +137,7 @@
appsPackages =
perSystem (pkgs:
import ./apps/nix/packages.nix {inherit pkgs self;});
import ./apps/packages.nix {inherit pkgs self;});
devShells =
perSystem (pkgs: