Skip to content

Commit

Permalink
fix the formatting according to nixfmt
Browse files Browse the repository at this point in the history
somehow the formatting is off in these files. this has been adjusted
now through running `nix fmt`

Signed-off-by: Brian McGillion <[email protected]>
  • Loading branch information
brianmcgillion committed Dec 11, 2024
1 parent 581aefe commit 62385df
Show file tree
Hide file tree
Showing 10 changed files with 53 additions and 52 deletions.
12 changes: 8 additions & 4 deletions lib.nix
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,14 @@ nixpkgs.lib.extend (
lib.filterAttrs (
_: value:
let
platforms = lib.attrByPath [
"meta"
"platforms"
] [ ] value;
platforms =
lib.attrByPath
[
"meta"
"platforms"
]
[ ]
value;
in
lib.elem system platforms
);
Expand Down
3 changes: 2 additions & 1 deletion modules/common/boot/systemd-boot-dtb.nix
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ in

config = mkIf cfg.enable {
boot.loader.systemd-boot = {
extraFiles."dtbs/${config.hardware.deviceTree.name}" = "${config.hardware.deviceTree.package}/${config.hardware.deviceTree.name}";
extraFiles."dtbs/${config.hardware.deviceTree.name}" =
"${config.hardware.deviceTree.package}/${config.hardware.deviceTree.name}";
extraInstallCommands = ''
# Find out the latest generation from loader.conf
default_cfg=$(${pkgs.coreutils}/bin/cat /boot/loader/loader.conf | ${pkgs.gnugrep}/bin/grep default | ${pkgs.gawk}/bin/awk '{print $2}')
Expand Down
50 changes: 21 additions & 29 deletions modules/desktop/graphics/labwc.config.nix
Original file line number Diff line number Diff line change
Expand Up @@ -105,16 +105,14 @@ let
</desktops>
<keyboard>
<default />
${
lib.concatStringsSep "\n" (
builtins.map (index: ''
<keybind key="W-${toString index}">
<action name="GoToDesktop" to="${toString index}" />
<action name="Execute" command="bash -c 'echo 1 > ~/.config/eww/workspace; ${ghaf-workspace}/bin/ghaf-workspace update ${toString index}'" />
</keybind>
'') (lib.lists.range 1 cfg.maxDesktops)
)
}
${lib.concatStringsSep "\n" (
builtins.map (index: ''
<keybind key="W-${toString index}">
<action name="GoToDesktop" to="${toString index}" />
<action name="Execute" command="bash -c 'echo 1 > ~/.config/eww/workspace; ${ghaf-workspace}/bin/ghaf-workspace update ${toString index}'" />
</keybind>
'') (lib.lists.range 1 cfg.maxDesktops)
)}
<keybind key="W-A-Right">
<action name="Execute" command="bash -c 'echo 1 > ~/.config/eww/workspace; ${ghaf-workspace}/bin/ghaf-workspace next'" />
</keybind>
Expand Down Expand Up @@ -162,31 +160,25 @@ let
<context name="Root">
<mousebind button="Left" action="Press" />
<mousebind button="Middle" action="Press" />
${
lib.optionalString (!config.ghaf.profiles.debug.enable) ''
<mousebind button="Right" action="Press" />
''
}
${lib.optionalString (!config.ghaf.profiles.debug.enable) ''
<mousebind button="Right" action="Press" />
''}
<!--Disable default scrolling behavior of switching workspaces-->
<mousebind direction="Up" action="Scroll" />
<mousebind direction="Down" action="Scroll" />
</context>
</mouse>
<windowRules>
${
lib.concatStringsSep "\n" (
map (rule: ''
<windowRule identifier="${rule.identifier}" borderColor="${rule.colour}" serverDecoration="yes" skipTaskbar="no" />
'') cfg.frameColouring
)
}
${
lib.concatStringsSep "\n" (
map (rule: ''
<windowRule sandboxAppId="${rule.identifier}" borderColor="${rule.color}" serverDecoration="yes" skipTaskbar="no" />
'') cfg.securityContext
)
}
${lib.concatStringsSep "\n" (
map (rule: ''
<windowRule identifier="${rule.identifier}" borderColor="${rule.colour}" serverDecoration="yes" skipTaskbar="no" />
'') cfg.frameColouring
)}
${lib.concatStringsSep "\n" (
map (rule: ''
<windowRule sandboxAppId="${rule.identifier}" borderColor="${rule.color}" serverDecoration="yes" skipTaskbar="no" />
'') cfg.securityContext
)}
</windowRules>
<libinput>
<device category="touchpad"><naturalScroll>yes</naturalScroll></device>
Expand Down
2 changes: 1 addition & 1 deletion modules/desktop/graphics/styles/lock-layout.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# SPDX-License-Identifier: Apache-2.0

# Ghaf lock screen layout
# Base layout taken from gtklock upstream: https://github.com/jovanlanik/gtklock/blob/master/res/gtklock.ui
# Base layout taken from gtklock upstream: https://github.com/jovanlanik/gtklock/blob/master/res/gtklock.ui
{
writeText,
...
Expand Down
13 changes: 8 additions & 5 deletions modules/microvm/virtualization/microvm/appvm.nix
Original file line number Diff line number Diff line change
Expand Up @@ -137,11 +137,14 @@ let
nixpkgs.buildPlatform.system = configHost.nixpkgs.buildPlatform.system;
nixpkgs.hostPlatform.system = configHost.nixpkgs.hostPlatform.system;

environment.systemPackages = [
pkgs.tpm2-tools
pkgs.opensc
pkgs.givc-cli
] ++ vm.packages ++ appPackages;
environment.systemPackages =
[
pkgs.tpm2-tools
pkgs.opensc
pkgs.givc-cli
]
++ vm.packages
++ appPackages;

security.tpm2 = {
enable = true;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ let
cfg = config.ghaf.hardware.nvidia.orin.agx;
in
{
options.ghaf.hardware.nvidia.orin.agx.enableNetvmWlanPCIPassthrough = lib.mkEnableOption "WLAN card PCI passthrough to NetVM";
options.ghaf.hardware.nvidia.orin.agx.enableNetvmWlanPCIPassthrough =
lib.mkEnableOption "WLAN card PCI passthrough to NetVM";
config = lib.mkIf cfg.enableNetvmWlanPCIPassthrough {
# Orin AGX WLAN card PCI passthrough
ghaf.hardware.nvidia.orin.enablePCIPassthroughCommon = true;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ let
cfg = config.ghaf.hardware.nvidia.orin.nx;
in
{
options.ghaf.hardware.nvidia.orin.nx.enableNetvmEthernetPCIPassthrough = lib.mkEnableOption "Ethernet card PCI passthrough to NetVM";
options.ghaf.hardware.nvidia.orin.nx.enableNetvmEthernetPCIPassthrough =
lib.mkEnableOption "Ethernet card PCI passthrough to NetVM";
config = lib.mkIf cfg.enableNetvmEthernetPCIPassthrough {
# Orin NX Ethernet card PCI Passthrough
ghaf.hardware.nvidia.orin.enablePCIPassthroughCommon = true;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ let
cfg = config.ghaf.hardware.nvidia.orin;
in
{
options.ghaf.hardware.nvidia.orin.enablePCIPassthroughCommon = lib.mkEnableOption "Enable common options related to PCI passthrough on Orin AGX and NX";
options.ghaf.hardware.nvidia.orin.enablePCIPassthroughCommon =
lib.mkEnableOption "Enable common options related to PCI passthrough on Orin AGX and NX";
config = lib.mkIf cfg.enablePCIPassthroughCommon {
boot.kernelModules = [
"vfio_pci"
Expand Down
5 changes: 2 additions & 3 deletions modules/reference/programs/google-chrome.nix
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,8 @@ in
<https://cloud.google.com/docs/chrome-enterprise/policies/>
Make sure the selected policy is supported on Linux and your browser version.
'';
default =
{
};
default = {
};
example = lib.literalExpression ''
{
"BrowserSignin" = 0;
Expand Down
11 changes: 5 additions & 6 deletions modules/reference/services/proxy-server/3proxy-config.nix
Original file line number Diff line number Diff line change
Expand Up @@ -90,17 +90,16 @@ in
};

config = mkIf cfg.enable {
assertions =
[
];
assertions = [
];
# Define a new group for proxy management
users.groups.${proxyGroupName} = { }; # Create a group named proxy-admin

# Define a new user with a specific username
users.users.${proxyUserName} = {
isSystemUser = true;
description = "Proxy User for managing allowlist and services";
# extraGroups = [ "${proxyGroupName}" ]; # Adding to 'proxy-admin' for specific access
# extraGroups = [ "${proxyGroupName}" ]; # Adding to 'proxy-admin' for specific access
group = "${proxyGroupName}";
};

Expand All @@ -126,8 +125,8 @@ in
polkit = {
enable = true;
debug = true;
# Polkit rules for allowing proxy-user to run proxy related systemctl
# commands without sudo and password requirement
# Polkit rules for allowing proxy-user to run proxy related systemctl
# commands without sudo and password requirement
extraConfig = ''
polkit.addRule(function(action, subject) {
if ((action.id == "org.freedesktop.systemd1.manage-units" &&
Expand Down

0 comments on commit 62385df

Please sign in to comment.