lemanschik / nixos-ide

web editor for nix files. edit nixos configuration in a graphical webinterface
MIT License
0 stars 0 forks source link

translate nix => ESM #1

Open lemanschik opened 1 year ago

lemanschik commented 1 year ago
{ config, pkgs, ... }: 

{
    # Import other configuration modules
    # (hardware-configuration.nix is autogenerated upon installation)
    # paths in nix expressions are always relative the file which defines them
    imports =
        [
            ./hardware-configuration.nix
            ./my-dev-tools.nix
            ./my-desktop-env.nix
            ./etc.nix
        ];

    # Name your host machine
    networking.hostName = "mymachine"; 

    # Set your time zone.
    time.timeZone = "Europe/Utrecht";

    # Enter keyboard layout
    services.xserver.layout = "us";
    services.xserver.xkbVariant = "altgr-intl";

    # Define user accounts
    users.extraUsers = 
        { 
            myuser = 
            {
                extraGroups = [ "wheel" "networkmanager" ];
                isNormalUser = true;
            };
        };

    # Install some packages
    environment.systemPackages = 
            with pkgs; 
            [
                ddate
                testdisk
                zsh
            ]; 

    # Enable the OpenSSH daemon
    services.openssh.enable = true;

}
lemanschik commented 1 year ago
{ config, pkgs, ... }: 

{
    # Import other configuration modules
    # (hardware-configuration.nix is autogenerated upon installation)
    # paths in nix expressions are always relative the file which defines them
    imports =
        [
           `${[].join('\n')}`
        ];

    # Name your host machine
    networking.hostName = "mymachine"; 

    # Set your time zone.
    time.timeZone = "Europe/Utrecht";

    # Enter keyboard layout
    services.xserver.layout = "us";
    services.xserver.xkbVariant = "altgr-intl";

    # Define user accounts
    users.extraUsers = 
        { 
            myuser = 
            {
                extraGroups = [ "wheel" "networkmanager" ]; // `extraGroups =  [ ${[].join(' ')} ]`
                isNormalUser = true;
            };
        };

    # Install some packages
    environment.systemPackages = 
            with pkgs; 
            [
                ddate
                testdisk
                zsh
            ]; 

    # Enable the OpenSSH daemon
    services.openssh.enable = true;

}
lemanschik commented 1 year ago

ok nix format is ini format + function + array space new line sperated.

using the following bultins https://nixos.org/manual/nix/stable/language/builtins.html

object scoped ini syntax support for object propertys

supports a web-module standadard like import

with import (fetchTarball {
  url = "https://github.com/NixOS/nixpkgs/archive/nixos-14.12.tar.gz";
  sha256 = "1jppksrfvbk5ypiqdz4cddxdl8z6zyzdb2srq8fcffr327ld5jj2";
}) {};

smallest denominator launch watch of the kernel and also the filesystem storage. need to look into the storage.

got similar versioning shema like web-modules

/nix/store/kq82idx6g0nyzsp2s14gfsc38npai7lf-cairo-1.0.4.ta

we would prefer to put the stuff of the hash at the end. followed by a total incremented rev like

/nix/store/kq82idx6g0nyzsp2s14gfsc38npai7lf-cairo-1.0.4.ta
/nix/store/cairo-1.0.4.ta-kq82idx6g0nyzsp2s14gfsc38npai7lf.0

above bespoken change allows for better compat with other parsing representations as also svn version compat

for example it is nice to rev something by name-tag-ignorehash-takehighest increment

lemanschik commented 1 year ago

@milahu please start reviewing README.md and launch.js

lemanschik commented 1 year ago

@milahu i putted your backend stuff into launch.js and in the readme are the new start instructions as this does not really depend on a package.json ok at present it will do as we have no global package cache but that will change

this uses puppeteer and our CDP pipe it allows you to directly start extensions and PWA's via puppeteer launch

will refactor your repl soon to use streams did started with that you can start inspecting it.

when all is refactored to streams i guess it will be less lines of code and you will understand the concepts more easy this replaces electron and has full devtools access via so called stdio pipe

milahu commented 1 year ago

translate nix => ESM

your next grandiose idea ...

problem is, javascript devs will hate this, because https://github.com/lemanschik/web-modules/issues/4#issuecomment-1336388561

one problem with a "pure" system like nix: when i want to patch a dependency somewhere in the middle of the dep-graph, then i must rebuild that dependency and all "dirty" packages. ... because /nix/store is read-only. workaround: https://discourse.nixos.org/t/writable-nix-store/18964

javascript devs will hate this

so they wont use it - project failed

to me, NPM is the best package system

you seem to have no idea of the basics, but you wanna build castles in the sky

lemanschik commented 1 year ago

@milahu you did not understand the importent part was the refactoring on your code and your correct npm is better then this nix stuff but the references of the nix import are correct that is exactly what a web-module should export specifier and integrity hash.

milahu commented 1 year ago

the importent part was the refactoring on your code

no, you just did some copy paste

the references of the nix import are correct that is exactly what a web-module should export specifier and integrity hash

stop talking, just do it

implement a working prototype, then we can talk