[feat] Nixfmt all

This commit is contained in:
uttarayan21
2024-03-01 01:52:23 +05:30
parent 50cd5e549b
commit d26ef52267
10 changed files with 213 additions and 238 deletions

View File

@@ -1 +1,19 @@
{ device, ... }: { programs.firefox = { enable = device.isLinux; }; }
{ device, pkgs, ... }: {
programs.firefox = {
enable = device.isLinux;
profiles.default = {
userChrome = let
csshacks = pkgs.fetchFromGitHub {
owner = "MrOtherGuy";
repo = "firefox-csshacks";
rev = "master";
sha256 = "sha256-r5CKOOcRWZQzYA9M6j7m2CAulOQItCuWsTSNGOYN87w=";
};
in ''
@import url(${csshacks}/chrome/tabs_on_bottom.css);
@import url(${csshacks}/chrome/toolbars_below_content.css);
'';
};
nativeMessagingHosts = [ pkgs.tridactyl-native ];
};
}

View File

@@ -2,9 +2,8 @@
let
start-tmux = (import ../scripts/start-tmux.nix) pkgs;
# https://mipmip.github.io/home-manager-option-search/
lazy = false;
in
{
lazy = true;
in {
imports = [
# Include the results of the hardware scan.
./tmux.nix
@@ -123,14 +122,12 @@ in
enable = true;
enableFishIntegration = true;
enableNushellIntegration = true;
settings =
let flavour = "mocha"; # Replace with your preferred palette
settings = let flavour = "mocha"; # Replace with your preferred palette
in {
# Other config here
format = "$all"; # Remove this line to disable the default prompt format
palette = "catppuccin_${flavour}";
} // builtins.fromTOML (builtins.readFile (pkgs.fetchFromGitHub
{
} // builtins.fromTOML (builtins.readFile (pkgs.fetchFromGitHub {
owner = "catppuccin";
repo = "starship";
rev = "main"; # Replace with the latest commit hash
@@ -163,8 +160,7 @@ in
enable = true;
config = { theme = "catppuccin"; };
themes = {
catppuccin =
let flavor = "mocha";
catppuccin = let flavor = "mocha";
in {
src = pkgs.fetchFromGitHub {
owner = "catppuccin";
@@ -186,8 +182,7 @@ in
# Home Manager needs a bit of information about you and the paths it should
# manage.
username = device.user;
homeDirectory =
if device.isMac then
homeDirectory = if device.isMac then
lib.mkForce "/Users/${device.user}"
else
lib.mkForce "/home/${device.user}";
@@ -206,7 +201,8 @@ in
} // (if lazy then {
".config/nvim/lua".source = ../../nvim/lua;
".config/nvim/init.lua".source = ../../nvim/init.lua;
} else { });
} else
{ });
sessionVariables = {
EDITOR = "nvim";

View File

@@ -21,9 +21,7 @@
undofile = true;
};
globals = {
mapleader = " ";
};
globals = { mapleader = " "; };
plugins = {
lspconfig = {
enable = true;

60
config/nix/flake.lock generated
View File

@@ -311,11 +311,11 @@
"systems": "systems_3"
},
"locked": {
"lastModified": 1705309234,
"narHash": "sha256-uNRRNRKmJyCRC/8y1RqBkqWBLM034y4qN7EprSdmgyA=",
"lastModified": 1709126324,
"narHash": "sha256-q6EQdSeUZOG26WelxqkmR7kArjgWCdw5sfJVHPH/7j8=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "1ef2e671c3b0c19053962c07dbda38332dcebf26",
"rev": "d465f4819400de7c8d874d50b982301f28a84605",
"type": "github"
},
"original": {
@@ -382,11 +382,11 @@
"systems": "systems_7"
},
"locked": {
"lastModified": 1705309234,
"narHash": "sha256-uNRRNRKmJyCRC/8y1RqBkqWBLM034y4qN7EprSdmgyA=",
"lastModified": 1709126324,
"narHash": "sha256-q6EQdSeUZOG26WelxqkmR7kArjgWCdw5sfJVHPH/7j8=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "1ef2e671c3b0c19053962c07dbda38332dcebf26",
"rev": "d465f4819400de7c8d874d50b982301f28a84605",
"type": "github"
},
"original": {
@@ -483,11 +483,11 @@
]
},
"locked": {
"lastModified": 1708988456,
"narHash": "sha256-RCz7Xe64tN2zgWk+MVHkzg224znwqknJ1RnB7rVqUWw=",
"lastModified": 1709204054,
"narHash": "sha256-U1idK0JHs1XOfSI1APYuXi4AEADf+B+ZU4Wifc0pBHk=",
"owner": "nix-community",
"repo": "home-manager",
"rev": "1d085ea4444d26aa52297758b333b449b2aa6fca",
"rev": "2f3367769a93b226c467551315e9e270c3f78b15",
"type": "github"
},
"original": {
@@ -504,11 +504,11 @@
]
},
"locked": {
"lastModified": 1708806879,
"narHash": "sha256-MSbxtF3RThI8ANs/G4o1zIqF5/XlShHvwjl9Ws0QAbI=",
"lastModified": 1709204054,
"narHash": "sha256-U1idK0JHs1XOfSI1APYuXi4AEADf+B+ZU4Wifc0pBHk=",
"owner": "nix-community",
"repo": "home-manager",
"rev": "4ee704cb13a5a7645436f400b9acc89a67b9c08a",
"rev": "2f3367769a93b226c467551315e9e270c3f78b15",
"type": "github"
},
"original": {
@@ -527,11 +527,11 @@
"rust-overlay": "rust-overlay_3"
},
"locked": {
"lastModified": 1708987072,
"narHash": "sha256-FVoalv8tlPldD6+6yyGFtiuao+YdEH1KbUPUmsEgUVc=",
"lastModified": 1709065223,
"narHash": "sha256-7zuh1ait7C6OAVfhl5fVloxrAc0WJBxEOu1XqPhlwI0=",
"owner": "JakeStanger",
"repo": "ironbar",
"rev": "d29d4fde8c09c25141ff0cebe994d3ce771b658e",
"rev": "149b57a73701af9d430ddf97252c6cc72074b2d2",
"type": "github"
},
"original": {
@@ -640,11 +640,11 @@
]
},
"locked": {
"lastModified": 1709001452,
"narHash": "sha256-FnZ54wkil54hKvr1irdKic1TE27lHQI9dKQmOJRrtlU=",
"lastModified": 1709112925,
"narHash": "sha256-5y8Dhw1HYdc+BWv+qQjJUIwc+ByoudtoGaHEcrXYlXw=",
"owner": "LnL7",
"repo": "nix-darwin",
"rev": "6c06334f0843c7300d1678726bb607ce526f6b36",
"rev": "283d59778e6b8c41cac4bdeac5b2512d6de51150",
"type": "github"
},
"original": {
@@ -727,11 +727,11 @@
"nmt": "nmt"
},
"locked": {
"lastModified": 1708966912,
"narHash": "sha256-Ee92D/hOgJX2mGHxYEB50zu6OoqVFN4chTxxpAYj57c=",
"lastModified": 1709216523,
"narHash": "sha256-8BaqUeMgwDBsXVpyE+AYVW7QBjR0DnsGnY0qZHdi9Ew=",
"owner": "nixneovim",
"repo": "nixneovim",
"rev": "81f257a375aa66d0ae8cd2ac1c3215b42b20786e",
"rev": "eebce182253d8c665a8a19e0b056f6cfaf97872c",
"type": "github"
},
"original": {
@@ -753,11 +753,11 @@
"poetry2nix": "poetry2nix"
},
"locked": {
"lastModified": 1708870615,
"narHash": "sha256-9GeZzoT8kxJY3OkpeOo/eJ4bqwaQTGggv3fR/5UdIkY=",
"lastModified": 1709216468,
"narHash": "sha256-3b3RFHQzea2L7lMUiS87r2A/RC+TJbBo/g7IY+5DYfk=",
"owner": "nixneovim",
"repo": "nixneovimplugins",
"rev": "eb98507f0309ddb74d81367838e742d47e9e456f",
"rev": "03cd562d0e4700216dcf8c3e14a4eebf0b2e5681",
"type": "github"
},
"original": {
@@ -775,11 +775,11 @@
"poetry2nix": "poetry2nix_2"
},
"locked": {
"lastModified": 1708870615,
"narHash": "sha256-9GeZzoT8kxJY3OkpeOo/eJ4bqwaQTGggv3fR/5UdIkY=",
"lastModified": 1709216547,
"narHash": "sha256-BZcxoobO6CaJ4Y2CdEiiY1381G/LdUr82mjKXEftGow=",
"owner": "NixNeovim",
"repo": "NixNeovimPlugins",
"rev": "eb98507f0309ddb74d81367838e742d47e9e456f",
"rev": "acad18539f283314a9c5cd4dee8eb70dd782c663",
"type": "github"
},
"original": {
@@ -885,11 +885,11 @@
},
"nixpkgs_5": {
"locked": {
"lastModified": 1708807242,
"narHash": "sha256-sRTRkhMD4delO/hPxxi+XwLqPn8BuUq6nnj4JqLwOu0=",
"lastModified": 1709150264,
"narHash": "sha256-HofykKuisObPUfj0E9CJVfaMhawXkYx3G8UIFR/XQ38=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "73de017ef2d18a04ac4bfd0c02650007ccb31c2a",
"rev": "9099616b93301d5cf84274b184a3a5ec69e94e08",
"type": "github"
},
"original": {

View File

@@ -57,8 +57,12 @@
inputs.nixpkgs.follows = "nixpkgs";
};
# { pkgs, inputs, system, ... }:
nur = {
url = "github:nix-community/nur";
inputs.nixpkgs.follows = "nixpkgs";
};
# { pkgs, inputs, system, ... }:
# {
# nixpkgs.overlays = [
# (final: prev: {
@@ -77,16 +81,8 @@
};
outputs =
{ nixpkgs
, # nixos,
home-manager
, nix-darwin
, flake-utils
, anyrun
, neovim-nightly-overlay
, ...
}@inputs:
outputs = { nixpkgs, home-manager, nix-darwin, flake-utils, anyrun
, neovim-nightly-overlay, ... }@inputs:
let
config_devices = [
{
@@ -158,22 +154,18 @@
inputs.nixneovim.overlays.default
inputs.nixneovimplugins.overlays.default
];
in
{
nixosConfigurations =
let devices = nixos_devices;
in {
nixosConfigurations = let devices = nixos_devices;
in import ./nixos/device.nix {
inherit devices inputs nixpkgs home-manager overlays;
};
darwinConfigurations =
let devices = darwin_devices;
darwinConfigurations = let devices = darwin_devices;
in import ./darwin/device.nix {
inherit devices inputs nixpkgs home-manager overlays nix-darwin;
};
homeConfigurations =
let devices = linux_devices;
homeConfigurations = let devices = linux_devices;
in import ./linux/device.nix {
inherit devices inputs nixpkgs home-manager overlays;
};

View File

@@ -1,10 +1,4 @@
{
inputs,
pkgs,
device,
osConfig,
...
}: {
{ inputs, pkgs, device, osConfig, ... }: {
imports = [ inputs.anyrun.nixosModules.home-manager ];
programs.anyrun = {
enable = true;
@@ -32,12 +26,10 @@
extraConfigFiles = {
"nixos-options.ron".text = let
nixos-options =
pkgs.lib.optionalString device.isNix
nixos-options = pkgs.lib.optionalString device.isNix
osConfig.system.build.manual.optionsJSON
+ "/share/doc/nixos/options.json";
hm-options =
inputs.home-manager.packages.${pkgs.system}.docs-json
hm-options = inputs.home-manager.packages.${pkgs.system}.docs-json
+ "/share/doc/home-manager/options.json";
# or alternatively if you wish to read any other documentation options, such as home-manager
# get the docs-json package from the home-manager flake
@@ -50,14 +42,7 @@
# };
options = builtins.toJSON ({
":hm" = [ hm-options ];
}
// (
if device.isNix
then {
":nix" = [nixos-options];
}
else {}
));
} // (if device.isNix then { ":nix" = [ nixos-options ]; } else { }));
in ''
Config(
options: ${options},

View File

@@ -1,10 +1,4 @@
{
devices,
inputs,
overlays,
home-manager,
...
}:
{ devices, inputs, overlays, home-manager, ... }:
builtins.listToAttrs (builtins.map (device: {
name = device.user;
value = let
@@ -12,19 +6,12 @@ builtins.listToAttrs (builtins.map (device: {
inherit overlays;
system = device.system;
};
in
home-manager.lib.homeManagerConfiguration {
in home-manager.lib.homeManagerConfiguration {
inherit pkgs;
extraSpecialArgs = {
inherit inputs;
inherit device;
};
modules = [
{
nixpkgs.config.allowUnfree = true;
}
../common/home.nix
];
modules = [ { nixpkgs.config.allowUnfree = true; } ../common/home.nix ];
};
})
devices)
}) devices)

View File

@@ -67,8 +67,7 @@
}];
};
};
style =
let
style = let
# mocha = fetchurl {
# url = "https://github.com/catppuccin/waybar/releases/download/v1.0/mocha.css";
# sha256 = pkgs.lib.fakeSha256;
@@ -80,7 +79,6 @@
sha256 = "sha256-vfwfBE3iqIN1cGoItSssR7h0z6tuJAhNarkziGFlNBw";
};
mocha = builtins.readFile "${catppuccin}/mocha.css";
in
mocha + builtins.readFile ./ironbar.css;
in mocha + builtins.readFile ./ironbar.css;
};
}

View File

@@ -12,16 +12,18 @@
pkiBundle = "/etc/secureboot";
};
environment.etc = {
"wireplumber/bluetooth.lua.d/51-bluez-config.lua".text = ''
bluez_monitor.properties = {
["bluez5.enable-sbc-xq"] = true,
["bluez5.enable-msbc"] = true,
["bluez5.enable-hw-volume"] = true,
["bluez5.headset-roles"] = "[ hsp_hs hsp_ag hfp_hf hfp_ag ]"
}
'';
};
# services.wireplumber.configPackages = with pkgs; [ bluez ];
# environment.etc = {
# "wireplumber/bluetooth.lua.d/51-bluez-config.lua".text = ''
# bluez_monitor.properties = {
# ["bluez5.enable-sbc-xq"] = true,
# ["bluez5.enable-msbc"] = true,
# ["bluez5.enable-hw-volume"] = true,
# ["bluez5.headset-roles"] = "[ hsp_hs hsp_ag hfp_hf hfp_ag ]"
# }
# '';
# };
hardware.bluetooth.enable = true;
hardware.bluetooth.powerOnBoot = true;
@@ -96,8 +98,7 @@
fish
nushellFull
(pkgs.wrapFirefox
(pkgs.firefox-unwrapped.override { pipewireSupport = true; })
{ })
(pkgs.firefox-unwrapped.override { pipewireSupport = true; }) { })
gnumake
python3
(nerdfonts.override { fonts = [ "FiraCode" "Hasklig" ]; })