Skip to content

Commit

Permalink
switch to nixfmt-rfc-style
Browse files Browse the repository at this point in the history
  • Loading branch information
xanderio committed Jun 19, 2024
1 parent eded898 commit 3925196
Show file tree
Hide file tree
Showing 79 changed files with 955 additions and 642 deletions.
10 changes: 7 additions & 3 deletions checks/darwinConfigurations.nix
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,11 @@ let
filterSystem = system: lib.filterAttrs (_: darwin: darwin.pkgs.hostPlatform.system == system);
in
{
perSystem = { system, ... }: {
checks = lib.mapAttrs' (name: darwin: lib.nameValuePair "darwinConfigurations-${name}" darwin.config.system.build.toplevel) (filterSystem system self.darwinConfigurations);
};
perSystem =
{ system, ... }:
{
checks = lib.mapAttrs' (
name: darwin: lib.nameValuePair "darwinConfigurations-${name}" darwin.config.system.build.toplevel
) (filterSystem system self.darwinConfigurations);
};
}
8 changes: 5 additions & 3 deletions checks/devShells.nix
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@ let
inherit (inputs.nixpkgs) lib;
in
{
perSystem = { self', ... }: {
checks = lib.mapAttrs' (name: value: lib.nameValuePair "devShell-${name}" value) self'.devShells;
};
perSystem =
{ self', ... }:
{
checks = lib.mapAttrs' (name: value: lib.nameValuePair "devShell-${name}" value) self'.devShells;
};
}
10 changes: 7 additions & 3 deletions checks/nixosConfigurations.nix
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,11 @@ let
filterSystem = system: lib.filterAttrs (_: nixos: nixos.pkgs.hostPlatform.system == system);
in
{
perSystem = { system, ... }: {
checks = lib.mapAttrs' (name: nixos: lib.nameValuePair "nixosConfigurations-${name}" nixos.config.system.build.toplevel) (filterSystem system self.nixosConfigurations);
};
perSystem =
{ system, ... }:
{
checks = lib.mapAttrs' (
name: nixos: lib.nameValuePair "nixosConfigurations-${name}" nixos.config.system.build.toplevel
) (filterSystem system self.nixosConfigurations);
};
}
8 changes: 5 additions & 3 deletions checks/packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@ let
inherit (inputs.nixpkgs) lib;
in
{
perSystem = { self', ... }: {
checks = lib.mapAttrs' (name: value: lib.nameValuePair "package-${name}" value) self'.packages;
};
perSystem =
{ self', ... }:
{
checks = lib.mapAttrs' (name: value: lib.nameValuePair "package-${name}" value) self'.packages;
};
}
6 changes: 1 addition & 5 deletions darwin/default.nix
Original file line number Diff line number Diff line change
@@ -1,5 +1 @@
{
imports = [
./ook
];
}
{ imports = [ ./ook ]; }
44 changes: 27 additions & 17 deletions darwin/ook/default.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{ inputs, self, ... }: {
{ inputs, self, ... }:
{
flake.darwinConfigurations = {
ook =
let
Expand Down Expand Up @@ -40,7 +41,9 @@
in
darwinSystem {
inherit system;
specialArgs = { inherit inputs; };
specialArgs = {
inherit inputs;
};
modules = [
inputs.home-manager.darwinModules.home-manager
{
Expand All @@ -60,7 +63,10 @@
fallback = true;
connect-timeout = 5;
log-lines = 25;
trusted-users = [ "root" "xanderio" ];
trusted-users = [
"root"
"xanderio"
];
builders-use-substitutes = true;

substituters = [
Expand All @@ -73,19 +79,21 @@
];
};
distributedBuilds = true;
buildMachines = [{
sshUser = "builder";
hostName = "linux-builder";
systems = [
linuxSystem
"x86_64-linux"
];
maxJobs = 4;
supportedFeatures = [ "big-parallel" ];
sshKey = "/etc/nix/builder_ed25519";
protocol = "ssh-ng";
publicHostKey = "c3NoLWVkMjU1MTkgQUFBQUMzTnphQzFsWkRJMU5URTVBQUFBSUpCV2N4Yi9CbGFxdDFhdU90RStGOFFVV3JVb3RpQzVxQkorVXVFV2RWQ2Igcm9vdEBuaXhvcwo";
}];
buildMachines = [
{
sshUser = "builder";
hostName = "linux-builder";
systems = [
linuxSystem
"x86_64-linux"
];
maxJobs = 4;
supportedFeatures = [ "big-parallel" ];
sshKey = "/etc/nix/builder_ed25519";
protocol = "ssh-ng";
publicHostKey = "c3NoLWVkMjU1MTkgQUFBQUMzTnphQzFsWkRJMU5URTVBQUFBSUpCV2N4Yi9CbGFxdDFhdU90RStGOFFVV3JVb3RpQzVxQkorVXVFV2RWQ2Igcm9vdEBuaXhvcwo";
}
];
};

environment.shellAliases = {
Expand All @@ -112,7 +120,9 @@

home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
home-manager.extraSpecialArgs = { inherit inputs; };
home-manager.extraSpecialArgs = {
inherit inputs;
};
home-manager.users.xanderio.imports = homeImports.ook;
}
];
Expand Down
38 changes: 26 additions & 12 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -47,15 +47,20 @@
inputs."flake-parts".follows = "flake-parts";
};
nix-fast-build = {
url = "github:Mic92/nix-fast-build";
url = "github:Mic92/nix-fast-build";
inputs."nixpkgs".follows = "nixpkgs";
inputs."flake-parts".follows = "flake-parts";
};
};

outputs = inputs@{ flake-parts, self, ... }:
outputs =
inputs@{ flake-parts, self, ... }:
flake-parts.lib.mkFlake { inherit inputs; } {
systems = [ "x86_64-linux" "aarch64-linux" "aarch64-darwin" ];
systems = [
"x86_64-linux"
"aarch64-linux"
"aarch64-darwin"
];
imports = [
./hosts
./darwin
Expand All @@ -64,15 +69,24 @@
flake = {
inherit (import ./home/profiles inputs) homeConfigurations;
};
perSystem = { pkgs, lib, inputs', self', system, ... }: {
formatter = pkgs.nixpkgs-fmt;
devShells.default = pkgs.mkShellNoCC {
buildInputs = [
pkgs.colmena
pkgs.sops
inputs'.sops-to-age.packages.ssh-to-age
];
perSystem =
{
pkgs,
lib,
inputs',
self',
system,
...
}:
{
formatter = pkgs.nixfmt-rfc-style;
devShells.default = pkgs.mkShellNoCC {
buildInputs = [
pkgs.colmena
pkgs.sops
inputs'.sops-to-age.packages.ssh-to-age
];
};
};
};
};
}
3 changes: 1 addition & 2 deletions home/default.nix
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
{
}
{ }
12 changes: 7 additions & 5 deletions home/desktop/default.nix
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{ pkgs, ... }: {
imports = [
./wayland
];
{ pkgs, ... }:
{
imports = [ ./wayland ];
home = {
sessionVariables = {
BROWSER = "firefox";
Expand Down Expand Up @@ -59,7 +58,10 @@
programs = {
chromium = {
enable = true;
commandLineArgs = [ "--enable-features=UseOzonePlatform" "--ozone-platform=wayland" ];
commandLineArgs = [
"--enable-features=UseOzonePlatform"
"--ozone-platform=wayland"
];
};
firefox = {
enable = true;
Expand Down
3 changes: 2 additions & 1 deletion home/desktop/wayland/default.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{ pkgs, ... }: {
{ pkgs, ... }:
{
imports = [
./kanshi.nix
./mako.nix
Expand Down
3 changes: 2 additions & 1 deletion home/desktop/wayland/kanshi.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{ pkgs, ... }: {
{ pkgs, ... }:
{
services.kanshi =
let
swaymsg = "${pkgs.sway}/bin/swaymsg";
Expand Down
12 changes: 9 additions & 3 deletions home/desktop/wayland/mako.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{ pkgs, ... }: {
{ pkgs, ... }:
{
services.mako = {
enable = true;

Expand Down Expand Up @@ -27,11 +28,16 @@
systemd.user.services.mako = {
Unit = {
Description = "Mako Notification daemon";
After = [ "graphical-session-pre.target" "tray.target" ];
After = [
"graphical-session-pre.target"
"tray.target"
];
PartOf = [ "graphical-session.target" ];
};

Install = { WantedBy = [ "graphical-session.target" ]; };
Install = {
WantedBy = [ "graphical-session.target" ];
};

Service = {
ExecStart = "${pkgs.mako}/bin/mako";
Expand Down
12 changes: 7 additions & 5 deletions home/desktop/wayland/sway/default.nix
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
{ pkgs
, lib
, config
, ...
{
pkgs,
lib,
config,
...
}:
with lib; let
with lib;
let
fuzzelOptions = lib.strings.concatStringsSep " " [
''--font="JetBrains Mono"''
"--background-color=282a36ee"
Expand Down
3 changes: 2 additions & 1 deletion home/desktop/wayland/swaylock/default.nix
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{ pkgs, ... }: {
{ pkgs, ... }:
{
xdg.configFile."swaylock/config".source = ./config;
}
16 changes: 12 additions & 4 deletions home/desktop/wayland/tray-items.nix
Original file line number Diff line number Diff line change
@@ -1,15 +1,23 @@
{ pkgs, nixosConfig, ... }: {
{ pkgs, nixosConfig, ... }:
{
services.blueman-applet.enable = true;
systemd.user.services._1password = {
Unit = {
Description = "1Password";
Requires = [ "tray.target" ];
After = [ "graphical-session-pre.target" "tray.target" ];
After = [
"graphical-session-pre.target"
"tray.target"
];
PartOf = [ "graphical-session.target" ];
};

Install = { WantedBy = [ "graphical-session.target" ]; };
Install = {
WantedBy = [ "graphical-session.target" ];
};

Service = { ExecStart = "${nixosConfig.programs._1password-gui.package}/bin/1password --silent"; };
Service = {
ExecStart = "${nixosConfig.programs._1password-gui.package}/bin/1password --silent";
};
};
}
25 changes: 21 additions & 4 deletions home/desktop/wayland/waybar/default.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{ pkgs, ... }: {
{ pkgs, ... }:
{
programs.waybar = {
enable = true;
systemd.enable = true;
Expand All @@ -9,9 +10,19 @@
position = "top";
height = 25;
spacing = 0;
modules-left = [ "sway/workspaces" "sway/mode" ];
modules-left = [
"sway/workspaces"
"sway/mode"
];
modules-center = [ "sway/window" ];
modules-right = [ "network" "idle_inhibitor" "pulseaudio" "battery" "clock" "tray" ];
modules-right = [
"network"
"idle_inhibitor"
"pulseaudio"
"battery"
"clock"
"tray"
];
"sway/workspaces" = {
disable-scroll = true;
disable-markup = false;
Expand Down Expand Up @@ -55,7 +66,13 @@
critical = 15;
};
format = "{icon} {capacity}%";
format-icons = [ "" "" "" "" "" ];
format-icons = [
""
""
""
""
""
];
};
};
};
Expand Down
Loading

0 comments on commit 3925196

Please sign in to comment.