summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFuwn <[email protected]>2025-01-06 12:17:49 -0800
committerFuwn <[email protected]>2025-01-06 12:17:49 -0800
commit9a790114041382c00958657afd54ac89eb52e05c (patch)
treec1a6ce1725ba766dd1efaa22f8803610d0fc46c6
parentnara: organise home programs (diff)
downloadnixos-config-9a790114041382c00958657afd54ac89eb52e05c.tar.xz
nixos-config-9a790114041382c00958657afd54ac89eb52e05c.zip
flake: format all files
-rw-r--r--flake.nix75
-rw-r--r--modules/base/nix.nix7
-rwxr-xr-xscripts/generate_clean_mas_apps.sh4
3 files changed, 60 insertions, 26 deletions
diff --git a/flake.nix b/flake.nix
index 87fb6d7..68ec9ce 100644
--- a/flake.nix
+++ b/flake.nix
@@ -1,16 +1,31 @@
{
- outputs = { devenv, flake-root, flake-parts, home-manager, just-flake, nixpkgs
- , pre-commit-hooks, self, ... }@inputs:
+ outputs =
+ {
+ devenv,
+ flake-root,
+ flake-parts,
+ home-manager,
+ just-flake,
+ nixpkgs,
+ pre-commit-hooks,
+ self,
+ ...
+ }@inputs:
let
lib = nixpkgs.lib // home-manager.lib;
- secrets =
- builtins.fromTOML (builtins.readFile "${self}/secrets/secrets.toml");
+ secrets = builtins.fromTOML (builtins.readFile "${self}/secrets/secrets.toml");
systemsAttributes = lib.genAttrs lib.systems.flakeExposed;
kansaiPkgs = import "${self}/lib/kansai-pkgs.nix" {
- inherit systemsAttributes nixpkgs self inputs;
+ inherit
+ systemsAttributes
+ nixpkgs
+ self
+ inputs
+ ;
};
- in flake-parts.lib.mkFlake { inherit inputs; } {
+ in
+ flake-parts.lib.mkFlake { inherit inputs; } {
systems = builtins.attrNames (systemsAttributes (system: system));
imports = [
@@ -19,26 +34,44 @@
just-flake.flakeModule
(import ./home {
- inherit kansaiPkgs self lib inputs secrets;
+ inherit
+ kansaiPkgs
+ self
+ lib
+ inputs
+ secrets
+ ;
inherit (self) outputs;
})
(import ./hosts {
- inherit kansaiPkgs self lib inputs secrets;
+ inherit
+ kansaiPkgs
+ self
+ lib
+ inputs
+ secrets
+ ;
inherit (self) outputs;
})
];
- perSystem = { system, config, ... }:
- let pkgs = (kansaiPkgs { })."${system}";
- in {
- imports = let parts = "${self}/parts";
- in [
- (import "${parts}/checks.nix" { inherit pre-commit-hooks system; })
- (import "${parts}/devenv.nix" { inherit config lib pkgs; })
- ];
+ perSystem =
+ { system, config, ... }:
+ let
+ pkgs = (kansaiPkgs { })."${system}";
+ in
+ {
+ imports =
+ let
+ parts = "${self}/parts";
+ in
+ [
+ (import "${parts}/checks.nix" { inherit pre-commit-hooks system; })
+ (import "${parts}/devenv.nix" { inherit config lib pkgs; })
+ ];
packages.default = home-manager.defaultPackage."${system}";
formatter = pkgs.nixfmt-rfc-style;
@@ -46,11 +79,9 @@
};
inputs = {
- determinate.url =
- "https://flakehub.com/f/DeterminateSystems/determinate/0.1";
+ determinate.url = "https://flakehub.com/f/DeterminateSystems/determinate/0.1";
flake-root.url = "github:srid/flake-root";
- flake-schemas.url =
- "https://flakehub.com/f/DeterminateSystems/flake-schemas/=0.1.5.tar.gz";
+ flake-schemas.url = "https://flakehub.com/f/DeterminateSystems/flake-schemas/=0.1.5.tar.gz";
just-flake.url = "github:juspay/just-flake";
nix-filter.url = "github:numtide/nix-filter";
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
@@ -77,7 +108,6 @@
};
};
-
artginzburg-homebrew-tap = {
url = "github:artginzburg/homebrew-tap";
flake = false;
@@ -437,8 +467,7 @@
};
umu = {
- url =
- "git+https://github.com/Open-Wine-Components/umu-launcher/?dir=packaging/nix&submodules=1";
+ url = "git+https://github.com/Open-Wine-Components/umu-launcher/?dir=packaging/nix&submodules=1";
inputs.nixpkgs.follows = "nixpkgs";
};
};
diff --git a/modules/base/nix.nix b/modules/base/nix.nix
index ff1ba2c..1b4703c 100644
--- a/modules/base/nix.nix
+++ b/modules/base/nix.nix
@@ -1,4 +1,9 @@
-{ inputs, lib, pkgs, ... }:
+{
+ inputs,
+ lib,
+ pkgs,
+ ...
+}:
{
nix = {
optimise.automatic = true;
diff --git a/scripts/generate_clean_mas_apps.sh b/scripts/generate_clean_mas_apps.sh
index ee66d70..6bd50f6 100755
--- a/scripts/generate_clean_mas_apps.sh
+++ b/scripts/generate_clean_mas_apps.sh
@@ -9,7 +9,7 @@ echo "fetching installed apps from app store ..."
apps=$(mas list)
-if [[ -z "${apps}" ]]; then
+if [[ -z ${apps} ]]; then
echo "no apps installed from app store"
exit 0
fi
@@ -24,7 +24,7 @@ while IFS= read -r line; do
sed 's/[[:space:]]+$//' |
sed 's/^[[:space:]]*//;s/[[:space:]]*$//')
- if [[ "${app_name}" =~ [[:space:]] ]]; then
+ if [[ ${app_name} =~ [[:space:]] ]]; then
output+=" \"${app_name}\" = ${app_id};\n"
else
output+=" ${app_name} = ${app_id};\n"