From ad596709a7f71b2348b874eb982be7b1d21e2e8f Mon Sep 17 00:00:00 2001 From: Spencer Brower Date: Fri, 2 Sep 2022 15:53:16 -0400 Subject: [PATCH] feat: Added formatter to default template. --- templates/default/Vagrantfile | 4 ++-- templates/default/flake.nix | 40 +++++++++++++++++++++-------------- 2 files changed, 26 insertions(+), 18 deletions(-) diff --git a/templates/default/Vagrantfile b/templates/default/Vagrantfile index da41397..fce8d60 100644 --- a/templates/default/Vagrantfile +++ b/templates/default/Vagrantfile @@ -25,8 +25,8 @@ Vagrant.configure("2") do |config| end config.vm.provision "shell", inline: <<-SHELL - # nix develop 'nixpkgs#git' --command "sudo nixos-rebuild switch --flake /vagrant" - nix-shell -p git --command "sudo nixos-rebuild switch --flake /vagrant" + # nix develop 'nixpkgs#git' --command "sudo nixos-rebuild switch --flake /vagrant#vagrant" + nix-shell -p git --command "sudo nixos-rebuild switch --flake /vagrant#vagrant" SHELL end \ No newline at end of file diff --git a/templates/default/flake.nix b/templates/default/flake.nix index 5090b24..3a58271 100644 --- a/templates/default/flake.nix +++ b/templates/default/flake.nix @@ -2,25 +2,33 @@ description = "A very basic flake"; inputs = { + # nixpkgs.url = "github:NixOS/nixpkgs/22.05"; + sbrow.url = "github:sbrow/nix"; + + flake-utils.url = "github:numtide/flake-utils"; }; - outputs = { self, nixpkgs, sbrow }: { - nixosModules.default = { config, nixpkgs, ... }: { - config = { - environment.systemPackages = with nixpkgs; [ git ]; - /* Your config here */ + outputs = { self, nixpkgs, sbrow }: + flake-utils.lib.eachSystem flake-utils.lib.allSystems + (system: { + formatter = nixpkgs.legacyPackages.${system}.nixpkgs-fmt; + }) // { + nixosModules.default = { config, nixpkgs, ... }: { + config = { + environment.systemPackages = with nixpkgs; [ git ]; + /* Your config here */ + }; + }; + + # A Vagrant box for testing + nixosConfigurations.vagrant = nixpkgs.lib.nixosSystem { + system = "x86_64-linux"; + modules = [ + (nixpkgs + "/nixos/modules/virtualisation/virtualbox-image.nix") + sbrow.nixosModules.vagrant + self.nixosModules.default + ]; }; }; - - # A Vagrant box for testing - nixosConfigurations.vagrant = nixpkgs.lib.nixosSystem { - system = "x86_64-linux"; - modules = [ - (nixpkgs + "/nixos/modules/virtualisation/virtualbox-image.nix") - sbrow.nixosModules.vagrant - self.nixosModules.default - ]; - }; - }; }