Set up autoformat

This commit is contained in:
Sridhar Ratnakumar 2021-04-07 18:29:14 -04:00
parent 488e911ed7
commit cd0ee36e18
5 changed files with 34 additions and 16 deletions

View file

@ -1,5 +1,6 @@
{
"recommendations": [
"bbenoist.nix"
"bbenoist.nix",
"b4dm4n.nixpkgs-fmt"
]
}

6
.vscode/settings.json vendored Normal file
View file

@ -0,0 +1,6 @@
{
"nixEnvSelector.nixFile": "${workspaceRoot}/shell.nix",
"editor.defaultFormatter": "B4dM4n.nixpkgs-fmt",
"editor.formatOnSave": true,
"editor.formatOnType": true
}

View file

@ -7,8 +7,8 @@
himalaya.url = "github:srid/himalaya/nixify";
};
outputs = inputs@{ self, home-manager, nixpkgs, ... }:
let
outputs = inputs@{ self, home-manager, nixpkgs, ... }:
let
system = "x86_64-linux";
# Make configuration for any computer I use in my home office.
mkHomeMachine = configurationNix: nixpkgs.lib.nixosSystem {
@ -23,17 +23,19 @@
# Packages from flake inputs
({ pkgs, lib, ... }: {
environment.systemPackages =
let
environment.systemPackages =
let
# Wrap himalaya to be aware of ProtonMail's bridge cert.
himalaya = lib.getAttrFromPath [system] inputs.himalaya.defaultPackage;
himalayaWithSslEnv =
himalaya = lib.getAttrFromPath [ system ] inputs.himalaya.defaultPackage;
himalayaWithSslEnv =
pkgs.writeScriptBin "h" ''
#!${pkgs.stdenv.shell}
export SSL_CERT_FILE=~/.config/protonmail/bridge/cert.pem
exec ${himalaya}/bin/himalaya
'';
in [
'';
in
[
himalayaWithSslEnv
];
})
@ -47,7 +49,8 @@
}
];
};
in {
in
{
nixosConfigurations.p71 = mkHomeMachine ./hosts/p71.nix;
nixosConfigurations.x1c7 = mkHomeMachine ./hosts/x1c7.nix;
};

View file

@ -2,7 +2,8 @@
{
imports =
[ (modulesPath + "/installer/scan/not-detected.nix")
[
(modulesPath + "/installer/scan/not-detected.nix")
];
boot.initrd.availableKernelModules = [ "xhci_pci" "nvme" "usbhid" "usb_storage" "sd_mod" "rtsx_pci_sdmmc" ];
@ -11,16 +12,17 @@
boot.extraModulePackages = [ ];
fileSystems."/" =
{ device = "/dev/disk/by-uuid/4200ca92-3b3c-4a41-98d5-92bbc0a5597e";
{
device = "/dev/disk/by-uuid/4200ca92-3b3c-4a41-98d5-92bbc0a5597e";
fsType = "ext4";
};
fileSystems."/boot" =
{ device = "/dev/disk/by-uuid/7C8B-3F49";
{
device = "/dev/disk/by-uuid/7C8B-3F49";
fsType = "vfat";
};
swapDevices =
[ { device = "/dev/disk/by-uuid/b03a08aa-1c9c-4674-b03b-ec59003306f5"; }
];
[{ device = "/dev/disk/by-uuid/b03a08aa-1c9c-4674-b03b-ec59003306f5"; }];
powerManagement.cpuFreqGovernor = lib.mkDefault "powersave";
# high-resolution display
@ -65,7 +67,7 @@
services.xserver.desktopManager.gnome3.enable = true;
services.openssh.enable = true;
services.ipfs.enable = true;
# Define a user account. Don't forget to set a password with passwd.
users.users.srid = {
isNormalUser = true;

6
shell.nix Normal file
View file

@ -0,0 +1,6 @@
{ pkgs ? import <nixpkgs> {}, ...}:
pkgs.mkShell {
buildInputs = [
pkgs.nixpkgs-fmt
];
}