diff --git a/.vscode/extensions.json b/.vscode/extensions.json index 482f80d..d07e141 100644 --- a/.vscode/extensions.json +++ b/.vscode/extensions.json @@ -1,5 +1,6 @@ { "recommendations": [ - "bbenoist.nix" + "bbenoist.nix", + "b4dm4n.nixpkgs-fmt" ] } \ No newline at end of file diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..ab7e433 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,6 @@ +{ + "nixEnvSelector.nixFile": "${workspaceRoot}/shell.nix", + "editor.defaultFormatter": "B4dM4n.nixpkgs-fmt", + "editor.formatOnSave": true, + "editor.formatOnType": true +} \ No newline at end of file diff --git a/flake.nix b/flake.nix index fbff823..8c6731d 100644 --- a/flake.nix +++ b/flake.nix @@ -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; }; diff --git a/hosts/p71.nix b/hosts/p71.nix index 2aebb24..4d45bda 100644 --- a/hosts/p71.nix +++ b/hosts/p71.nix @@ -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; diff --git a/shell.nix b/shell.nix new file mode 100644 index 0000000..6ca6c44 --- /dev/null +++ b/shell.nix @@ -0,0 +1,6 @@ +{ pkgs ? import {}, ...}: +pkgs.mkShell { + buildInputs = [ + pkgs.nixpkgs-fmt + ]; +} \ No newline at end of file