Add nixos-gui among the installer tools.

Add it as a default for the graphical profile.

svn path=/nixos/trunk/; revision=26960
This commit is contained in:
Nicolas Pierron 2011-04-25 01:03:57 +00:00
parent 97b39bd17c
commit 921231b555
5 changed files with 49 additions and 25 deletions

View File

@ -1,19 +1,16 @@
This file should become a nix expression.
This file should become a nix expression. (see modules/installer/tools/tools.nix)
you need to:
- download the latest jQuery from:
http://jqueryjs.googlecode.com/files/jquery-1.3.2.js
SHA1 Checksum: f0b95e99225f314fbe37ccf6b74ce2f916c517de
- download the latest jQuery from and copy it to chrome/content:
http://code.jquery.com/jquery-1.5.2.js
- install 'xulrunner' with nix:
nix-env -i xulrunner
nix-env -Ai nixpkgs_sys.firefox40Pkgs.xulrunner
- install and add nix-intantiate in your path
- make sure nixos-option in your path
- have /etc/nixos/nixpkgs
- have /etc/nixos/nixos
to run it, either:
- cd /etc/nixos/nixos/gui; ./nixos-gui
- xulrunner /etc/nixos/nixos/gui/application.ini
run it:
- xulrunner /etc/nixos/nixos/gui/application.ini -jsconsole

View File

@ -8,15 +8,16 @@ Vendor=NixOS
Name=NixOS-gui
;
; This field specifies your application's version. This field is optional.
Version=0.0
Version=0.1
;
; This field specifies your application's build ID (timestamp). This field is
; required.
BuildID=20090925
BuildID=20110424
;
; This field specifies a compact copyright notice for your application. This
; field is optional.
;Copyright=
;
; This ID is just an example. Every XUL app ought to have it's own unique ID.
; You can use the microsoft "guidgen" or "uuidgen" tools, or go on

View File

@ -1,3 +0,0 @@
#!/bin/sh
exec xulrunner "./application.ini"

View File

@ -1,33 +1,34 @@
# This module generates nixos-install, nixos-rebuild,
# nixos-hardware-scan, etc.
{config, pkgs, ...}:
{config, pkgs, modulesPath, ...}:
let
### implementation
cfg = config.installer;
makeProg = args: pkgs.substituteAll (args // {
dir = "bin";
isExecutable = true;
});
nixosBuildVMS = makeProg {
name = "nixos-build-vms";
src = ./nixos-build-vms/nixos-build-vms.sh;
};
nixosDeployNetwork = makeProg {
name = "nixos-deploy-network";
src = ./nixos-deploy-network/nixos-deploy-network.sh;
};
nixosInstall = makeProg {
name = "nixos-install";
src = ./nixos-install.sh;
inherit (pkgs) perl pathsFromGraph;
nix = config.environment.nix;
nixpkgsURL = config.installer.nixpkgsURL;
nixpkgsURL = cfg.nixpkgsURL;
nixClosure = pkgs.runCommand "closure"
{exportReferencesGraph = ["refs" config.environment.nix];}
@ -64,7 +65,7 @@ let
inherit nixClosure nix;
# TODO shell ?
nixpkgsURL = config.installer.nixpkgsURL;
nixpkgsURL = cfg.nixpkgsURL;
};
# see ./nixos-bootstrap-archive/README-BOOTSTRAP-NIXOS
@ -90,7 +91,7 @@ let
name = "nixos-hardware-scan";
src = ./nixos-hardware-scan.pl;
inherit (pkgs) perl;
profile = config.installer.installProfile;
profile = cfg.installProfile;
};
nixosOption = makeProg {
@ -98,11 +99,28 @@ let
src = ./nixos-option.sh;
};
nixosGui = pkgs.xulrunnerWrapper {
launcher = "nixos-gui";
application = pkgs.stdenv.mkDerivation {
name = "nixos-gui";
buildCommand = ''
ensureDir $out
cp -r $source $out
cp $jquery $out/chrome/content/jquery-1.5.2.js
'';
sources = pkgs.lib.cleanSource "${modulesPath}/../gui";
jquery = pkgs.fetchurl {
url = http://code.jquery.com/jquery-1.5.2.min.js;
sha256 = "e2107c8ecdb479c36d822d82bda2a8caf4429ab2d2cf9f20d5c931f75275403c";
};
};
};
in
{
options = {
installer.nixpkgsURL = pkgs.lib.mkOption {
default = "";
example = http://nixos.org/releases/nix/nixpkgs-0.11pre7577;
@ -131,7 +149,16 @@ in
Name of the profile used when generating the hardware-scan.
'';
};
installer.enableGraphicalTools = pkgs.lib.mkOption {
default = false;
type = with pkgs.lib.types; bool;
example = true;
description = ''
Enable the installation of graphical tools.
'';
};
};
config = {
@ -146,7 +173,7 @@ in
installer2.runInChroot
installer2.nixosPrepareInstall
];
] ++ pkgs.lib.optional cfg.enableGraphicalTools nixosGui;
system.build = {
inherit nixosInstall nixosHardwareScan nixosOption;

View File

@ -13,4 +13,6 @@
desktopManager.default = "kde4";
desktopManager.kde4.enable = true;
};
installer.enableGraphicalTools = true;
}