Skip to content

Instantly share code, notes, and snippets.

@pbogdan
Last active April 21, 2017 18:42
Show Gist options
  • Save pbogdan/f6b75dc8ba7ca3b4741ed2e249ec98f2 to your computer and use it in GitHub Desktop.
Save pbogdan/f6b75dc8ba7ca3b4741ed2e249ec98f2 to your computer and use it in GitHub Desktop.

This is all assuming you are on 17.03 as I haven't tested my changes against unstable. Leave a comment here if you have any questions.

  • fork https://github.com/NixOS/nixpkgs on github

  • clone it locally:

    $ git clone git@github.com:erlandsona/nixpkgs.git
    $ cd nixpkgs
    
  • get channel information via git:

    $ git remote add channels git://github.com/NixOS/nixpkgs-channels.git
    $ git remote update channels
    
  • set up new local branch based on 17.03:

    $ git checkout -b local-17.03 channels/nixos-17.03
    
  • add a remote for my fork:

    $ git remote add pbogdan git@github.com:pbogdan/nixpkgs.git
    $ git remote update pbogdan
    
  • pick the lightdm changes:

    $ git cherry-pick c48e9e386374ae4f3b90dbd64c2c934ce8475a36
    $ git cherry-pick 89e9f1473553114619738718173f82af19565063
    

    the c48e9e386374ae4f3b90dbd64c2c934ce8475a36 commit isn't really required but will save having to resolve a merge conflict manually as it's not in 17.03, see NixOS/nixpkgs#24135

  • adjust /etc/nixos/configuration.nix with the new options:

    services.xserver = {
       ...
       displayManager = {
         lightdm = {
           enable = true;
             greeters = {
               gtk = {
                 enable = true;
                 cursorTheme = {
                   package = pkgs.gnome3.defaultIconTheme;
                   name = "Adwaita";
                   size = 32;
               };
             };
           };
        };
        ...
      };
    };
    
  • rebuild the system using your own fork:

    $ sudo nixos-rebuild switch -I nixpkgs=/home/erlandsona/nixpkgs
    

    (adjust the path as needed)

You would need to use -I nixpkgs=/home/erlandsona/nixpkgs whenever your rebuild. If at some point you would want to use your own fork for your user with nix-env you can point to it with nix-env -i somepackage -f ~/nixpkgs/.

If you want to update and get the latest upstream changes from 17.03 you would run:

$ git remote update channels
$ git rebase channels/nixos-17.03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment