Skip to content

Commit

Permalink
treewide: nixfmt everything
Browse files Browse the repository at this point in the history
  • Loading branch information
ElXreno committed Jul 18, 2024
1 parent 735432c commit eb8c1f7
Show file tree
Hide file tree
Showing 75 changed files with 905 additions and 921 deletions.
5 changes: 1 addition & 4 deletions devshell/android.nix
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
{ pkgs, ... }:
pkgs.mkShell {
nativeBuildInputs = with pkgs; [
androidStudioPackages.canary
flutter
];
nativeBuildInputs = with pkgs; [ androidStudioPackages.canary flutter ];

buildInputs = with pkgs; [ ];
}
17 changes: 8 additions & 9 deletions devshell/default.nix
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
{ pkgs, ... }:
pkgs.mkShell {
nativeBuildInputs = with pkgs; [
# Rust
pkg-config
clang
gnumake
rustup
] ++ (with jetbrains; [
clion
]);
nativeBuildInputs = with pkgs;
[
# Rust
pkg-config
clang
gnumake
rustup
] ++ (with jetbrains; [ clion ]);

buildInputs = with pkgs; [
# Rust
Expand Down
12 changes: 3 additions & 9 deletions devshell/dotnet.nix
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,10 @@ let

dotnetSdkPackage = pkgs."dotnet-sdk_${dotnetMajorVer}";
monoPackage = pkgs."mono${dotnetMajorVer}";
in
pkgs.mkShell {
nativeBuildInputs = with pkgs; [
jetbrains.rider
];
in pkgs.mkShell {
nativeBuildInputs = with pkgs; [ jetbrains.rider ];

buildInputs = with pkgs; [
dotnetSdkPackage
monoPackage
];
buildInputs = with pkgs; [ dotnetSdkPackage monoPackage ];

NIX_LD = pkgs.lib.fileContents "${pkgs.stdenv.cc}/nix-support/dynamic-linker";

Expand Down
57 changes: 27 additions & 30 deletions devshell/fhs-android.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,36 +2,33 @@

(pkgs.buildFHSUserEnv {
name = "fhs-android";
targetPkgs = pkgs: (with pkgs; [
bison
curl
flex
git
gitRepo
gnumake
gnupg
gperf
jdk
libxml2
lzop
m4
nettools
openssl
perl
procps
python2
python3
schedtool
unzip
utillinux
zip
pkgconfig
]);
multiPkgs = pkgs: (with pkgs; [
ncurses5
zlib
glibc.dev
]);
targetPkgs = pkgs:
(with pkgs; [
bison
curl
flex
git
gitRepo
gnumake
gnupg
gperf
jdk
libxml2
lzop
m4
nettools
openssl
perl
procps
python2
python3
schedtool
unzip
utillinux
zip
pkgconfig
]);
multiPkgs = pkgs: (with pkgs; [ ncurses5 zlib glibc.dev ]);
runScript = "bash";
profile = ''
export ALLOW_NINJA_ENV=true
Expand Down
4 changes: 1 addition & 3 deletions devshell/java.nix
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
{ pkgs, ... }:
pkgs.mkShell {
nativeBuildInputs = with pkgs; [
jetbrains.idea-ultimate
];
nativeBuildInputs = with pkgs; [ jetbrains.idea-ultimate ];

buildInputs = with pkgs; [ ];
}
16 changes: 5 additions & 11 deletions devshell/php.nix
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,13 @@ let
phpMajorVer = toString 82;

php = pkgs."php${phpMajorVer}".buildEnv {
extensions = { enabled, all }: enabled ++ (with all; [
xdebug
]);
extensions = { enabled, all }: enabled ++ (with all; [ xdebug ]);
extraConfig = ''
xdebug.mode=debug
xdebug.mode=debug
'';
};
in
pkgs.mkShell {
nativeBuildInputs = with pkgs; [
php
jetbrains.phpstorm
];
};
in pkgs.mkShell {
nativeBuildInputs = with pkgs; [ php jetbrains.phpstorm ];

buildInputs = with pkgs; [ ];
}
24 changes: 10 additions & 14 deletions devshell/python.nix
Original file line number Diff line number Diff line change
@@ -1,20 +1,16 @@
{ pkgs, ... }:
let python = pkgs.python311;
in
pkgs.mkShell {
nativeBuildInputs = with pkgs; [
pkg-config
clang
gnumake
python
] ++ (with jetbrains; [
pycharm-professional
]);
in pkgs.mkShell {
nativeBuildInputs = with pkgs;
[ pkg-config clang gnumake python ]
++ (with jetbrains; [ pycharm-professional ]);

buildInputs = with pkgs; with python.pkgs; [
# Python
venvShellHook
];
buildInputs = with pkgs;
with python.pkgs;
[
# Python
venvShellHook
];

NIX_LD = pkgs.lib.fileContents "${pkgs.stdenv.cc}/nix-support/dynamic-linker";

Expand Down
20 changes: 9 additions & 11 deletions disko/external-hdd.nix
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,15 @@
content = {
type = "table";
format = "gpt";
partitions = [
{
name = "zfs";
start = "1MiB";
end = "100%";
content = {
type = "zfs";
pool = "externalhdd";
};
}
];
partitions = [{
name = "zfs";
start = "1MiB";
end = "100%";
content = {
type = "zfs";
pool = "externalhdd";
};
}];
};
};
};
Expand Down
17 changes: 7 additions & 10 deletions disko/infinity.nix
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
{ ... }:
let
defaultMountOptions = [ "compress-force=zstd" ];
in
{
{ ... }:
let defaultMountOptions = [ "compress-force=zstd" ];
in {
disko.devices = {
disk = {
nvme = {
Expand Down Expand Up @@ -32,9 +30,7 @@ in
type = "luks";
name = "crypted";
extraOpenArgs = [ "--allow-discards" ];
settings = {
allowDiscards = true;
};
settings = { allowDiscards = true; };
content = {
type = "btrfs";
extraArgs = [ "-f" ];
Expand All @@ -51,7 +47,7 @@ in
mountpoint = "/nix";
mountOptions = defaultMountOptions ++ [ "noatime" ];
};
"/var" = {
"/var" = {
mountpoint = "/var";
mountOptions = defaultMountOptions;
};
Expand All @@ -66,7 +62,8 @@ in
};

fileSystems = {
"/var".neededForBoot = true; # Ensure that /var will be mounted with the sops key
"/var".neededForBoot =
true; # Ensure that /var will be mounted with the sops key
};
}

6 changes: 2 additions & 4 deletions disko/timeweb.nix
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
{ ... }:
let
defaultMountOptions = [ "compress-force=zstd:1" ];
in
{
let defaultMountOptions = [ "compress-force=zstd:1" ];
in {
disko.devices = {
disk = {
x = {
Expand Down
56 changes: 25 additions & 31 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -64,40 +64,35 @@
findModules = dir:
builtins.concatLists (builtins.attrValues (builtins.mapAttrs
(name: type:
if type == "regular" then
[{
name = builtins.elemAt (builtins.match "(.*)\\.nix" name) 0;
value = dir + "/${name}";
}]
else if (builtins.readDir (dir + "/${name}"))
? "default.nix" then [{
if type == "regular" then [{
name = builtins.elemAt (builtins.match "(.*)\\.nix" name) 0;
value = dir + "/${name}";
}] else if (builtins.readDir (dir + "/${name}"))
? "default.nix" then [{
inherit name;
value = dir + "/${name}";
}] else
findModules (dir + "/${name}"))
(builtins.readDir dir)));
in
{
findModules (dir + "/${name}")) (builtins.readDir dir)));
in {
nixosModules = builtins.listToAttrs (findModules ./modules);

nixosProfiles = builtins.listToAttrs (findModules ./profiles);

nixosRoles = import ./roles;

nixOnDroidConfigurations.default = nix-on-droid.lib.nixOnDroidConfiguration {
modules = [ ./nix-on-droid ];
extraSpecialArgs = { inherit inputs; };
nixOnDroidConfigurations.default =
nix-on-droid.lib.nixOnDroidConfiguration {
modules = [ ./nix-on-droid ];
extraSpecialArgs = { inherit inputs; };

pkgs = import nixpkgs {
system = "aarch64-linux";
pkgs = import nixpkgs {
system = "aarch64-linux";

overlays = [
nix-on-droid.overlays.default
];
};
overlays = [ nix-on-droid.overlays.default ];
};

home-manager-path = inputs.home-manager.outPath;
};
home-manager-path = inputs.home-manager.outPath;
};

nixosConfigurations = with nixpkgs.lib;
let
Expand All @@ -109,8 +104,7 @@
[ (import (./machines + "/${name}")) { device = name; } ];
specialArgs = { inherit inputs; };
};
in
genAttrs hosts mkHost;
in genAttrs hosts mkHost;

diskoConfigurations = builtins.listToAttrs (findModules ./disko);

Expand All @@ -121,11 +115,12 @@

devShells.x86_64-linux = with nixpkgs.lib;
let
inherit ((builtins.head (builtins.attrValues self.nixosConfigurations))) pkgs config;
mkShells = mapAttrs
(_name: value: import value { inherit pkgs config; });
in
mkShells (builtins.listToAttrs (findModules ./devshell));
inherit ((builtins.head
(builtins.attrValues self.nixosConfigurations)))
pkgs config;
mkShells =
mapAttrs (_name: value: import value { inherit pkgs config; });
in mkShells (builtins.listToAttrs (findModules ./devshell));

deploy = {
user = "root";
Expand All @@ -152,7 +147,6 @@

hydraJobs = with nixpkgs.lib;
(mapAttrs (_: val: val.config.system.build.toplevel)
self.nixosConfigurations
);
self.nixosConfigurations);
};
}
Loading

0 comments on commit eb8c1f7

Please sign in to comment.