Skip to content

Instantly share code, notes, and snippets.

@superherointj
Created December 17, 2020 15:35
Show Gist options
  • Save superherointj/5ce794172071adb45efecce3047b168a to your computer and use it in GitHub Desktop.
Save superherointj/5ce794172071adb45efecce3047b168a to your computer and use it in GitHub Desktop.
Retornar 2 derivações para o environment.systemPackages
# configuration.nix
{ config, pkgs, ... }:
environment.systemPackages = [ (import ./win10boot.nix {inherit pkgs; }) ]
# ./win10boot.nix
{ pkgs, ... }: with pkgs;
let desktop-item = makeDesktopItem {
name = "win10-boot-now";
desktopName = "Windows 10 => Boot Now!";
type = "Application";
exec = "win10-boot-now";
};
winscript = pkgs.writeScriptBin "win10-boot-now" ''
#! /usr/bin/env nix-shell
#! nix-shell -i bash -p efibootmgr -I nixpkgs=https://github.com/NixOS/nixpkgs-channels/archive/nixos-unstable.tar.gz
WINENTRY=`efibootmgr -v | grep "Windows Boot Manager" | cut -d' ' -f1 | tr -d Boot*`
sudo efibootmgr -n''${WINENTRY}
reboot
'';
in
[ desktop-item winscript ] # Quero retornar essas duas derivações. Isso aqui vai dar erro. Mas coloquei assim pra passar a idéia.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment